VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
asyncJob.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright 2010 VT MAK
3 *******************************************************************************/
4 
7 
8 #pragma once
9 
10 #include <vrfutil/vrfutilDefines.h>
11 
12 #include <vlutil/vlPrint.h>
13 #include <vlutil/vlExceptions.h>
14 
15 #include "asyncJobMapEntry.h"
16 #include "asyncJobServer.h"
17 
19 #include "vrfutil/objectCounter.h"
20 
21 #include <tbb/task.h>
22 
23 #include <boost/function.hpp>
24 
25 class DtAsyncJob;
26 
28 struct job_canceled{};
29 
33 {
34 public:
35  DtJobCancelledFunc(const DtAsyncJob& job);
36  bool operator()() const;
37 
38 protected:
39  const DtAsyncJob& job;
40 };
41 
48  : public tbb::task
49  , public DtAlgorithmManager
50  , public DtObjectDebugger<DtAsyncJob>
51 {
52 public:
54  DtAsyncJob();
55 
57  virtual ~DtAsyncJob();
58 
60  virtual task* execute();
61 
63  virtual task* onExecute() = 0;
64 
66  virtual task* onException() = 0;
67 
69  virtual void tick();
70 
73  virtual boost::shared_ptr<DtAsyncJobMapEntry> getEntry() const = 0;
74 
76  virtual void setEntry(boost::shared_ptr<DtAsyncJobMapEntry>) = 0;
77 
79  bool cancel() const;
80 
81 protected:
83 };
84 
90 {
91 public:
92  boost::shared_ptr<DtAsyncJobMapEntry> getEntry() const;
93  void setEntry(boost::shared_ptr<DtAsyncJobMapEntry>);
94 
95 protected:
96  boost::weak_ptr<DtAsyncJobMapEntry> myEntry;
97 };
98 
104 {
105 public:
106  boost::shared_ptr<DtAsyncJobMapEntry> getEntry() const;
107  void setEntry(boost::shared_ptr<DtAsyncJobMapEntry>);
108 
109  task* execute();
110 
111 protected:
112  boost::shared_ptr<DtAsyncJobMapEntry> myEntry;
113 };
114 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)