VR-Forces 4.2 Class Documentation
asyncJob.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright 2010 VT MAK
3 *******************************************************************************/
4 
7 
8 #pragma once
9 
10 #include <vlutil/vlPrint.h>
11 #include <vlutil/vlExceptions.h>
12 
13 #include "asyncJobMapEntry.h"
14 #include "asyncJobServer.h"
15 
16 #include "tbb/task.h"
17 
18 #include "boost/function.hpp"
19 
24 
25 #include <vrfutil/vrfutilDefines.h>
26 
27 class DtAsyncJob;
28 
29 struct job_canceled{}; //exception for termination of a task during execution.
30 struct outside_search_radius{}; //exception for graph search has gone too far out of the way.
31 
35 {
36 public:
37  DtJobCancelledFunc(const DtAsyncJob& job);
38  bool operator()() const;
39 
40 protected:
41  const DtAsyncJob& job;
42 };
43 
45 class DT_DLL_vrfutil DtAsyncJob : public tbb::task
46 {
47 public:
49  DtAsyncJob();
50 
52  virtual ~DtAsyncJob();
53 
55  virtual task* execute();
56 
58  virtual task* onExecute() = 0;
60  virtual task* onException() = 0;
61 
64  virtual boost::shared_ptr<DtAsyncJobMapEntry> getEntry() const;
65 
67  virtual void setEntry(boost::shared_ptr<DtAsyncJobMapEntry>);
68 
69 protected:
70  boost::weak_ptr<DtAsyncJobMapEntry> myEntry;
72 };

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)