comparison Core/JobsEngine/Operations/SequenceOfOperationsJob.h @ 2616:2f3007bf0708 jobs

event queues in Lua, serialization of sequence of operations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 May 2018 12:25:37 +0200
parents 25225f0b4f33
children 1232922c8793
comparison
equal deleted inserted replaced
2614:3200223f9ade 2616:2f3007bf0708
59 }; 59 };
60 60
61 private: 61 private:
62 class Operation; 62 class Operation;
63 63
64 std::string jobType_; 64 std::string description_;
65 bool done_; 65 bool done_;
66 boost::mutex mutex_; 66 boost::mutex mutex_;
67 std::vector<Operation*> operations_; 67 std::vector<Operation*> operations_;
68 size_t current_; 68 size_t current_;
69 boost::condition_variable operationAdded_; 69 boost::condition_variable operationAdded_;
70 boost::posix_time::time_duration trailingTimeout_; 70 boost::posix_time::time_duration trailingTimeout_;
71 std::list<IObserver*> observers_; 71 std::list<IObserver*> observers_;
72 TimeoutDicomConnectionManager connectionManager_; 72 TimeoutDicomConnectionManager connectionManager_;
73 73
74 void Setup();
75
76 public: 74 public:
77 SequenceOfOperationsJob() : 75 SequenceOfOperationsJob();
78 jobType_("SequenceOfOperations")
79 {
80 Setup();
81 }
82
83 SequenceOfOperationsJob(const std::string& jobType) :
84 jobType_(jobType)
85 {
86 Setup();
87 }
88 76
89 virtual ~SequenceOfOperationsJob(); 77 virtual ~SequenceOfOperationsJob();
78
79 void SetDescription(const std::string& description);
90 80
91 void Register(IObserver& observer); 81 void Register(IObserver& observer);
92 82
93 // This lock allows adding new operations to the end of the job, 83 // This lock allows adding new operations to the end of the job,
94 // from another thread than the worker thread, after the job has 84 // from another thread than the worker thread, after the job has
141 131
142 virtual float GetProgress(); 132 virtual float GetProgress();
143 133
144 virtual void GetJobType(std::string& target) 134 virtual void GetJobType(std::string& target)
145 { 135 {
146 target = jobType_; 136 target = "SequenceOfOperations";
147 } 137 }
148 138
149 virtual void GetPublicContent(Json::Value& value); 139 virtual void GetPublicContent(Json::Value& value);
150 140
151 virtual void GetInternalContent(Json::Value& value) 141 virtual void GetInternalContent(Json::Value& value);
152 {
153 // TODO
154 }
155 }; 142 };
156 } 143 }