3 #include <SharedSubTaskCompletionHandler.h>
5 #include <boost/thread.hpp>
28 std::shared_ptr<SharedSubTaskCompletionHandler>
ch;
41 std::shared_ptr<boost::thread>
thread =
nullptr;
66 if(
ch !=
nullptr)
ch->onSharedSubTaskCompletion(
key);
76 virtual void run() = 0;
A shared task is said to be a collection of shared sub-tasks. Each shared sub-task can be computed in...
Definition: SharedSubTask.h:16
virtual void setThread(std::shared_ptr< boost::thread > thread)
Set the thread associated to the shared sub-task.
Definition: SharedSubTask.h:113
size_t key
The key identifying the shared sub task inside the shared task sequencer context.
Definition: SharedSubTask.h:35
virtual void postProcess()
Post-processing to be applied after shared sub-task has finished. By default it is a void function wh...
Definition: SharedSubTask.h:82
virtual void setKey(size_t const key)
Set the key of the shared sub-task inside the shared task sequencer context.
Definition: SharedSubTask.h:101
std::shared_ptr< boost::thread > thread
The thread associated with the shared sub-tasks. It is nullptr until the shared sub-task has been sta...
Definition: SharedSubTask.h:41
virtual void operator()()
The functor that will be called by any thread. It calls the SharedSubTask::run method to solve/comput...
Definition: SharedSubTask.h:64
virtual size_t getKey()
Obtain the key of the shared sub-task inside the shared task sequencer context.
Definition: SharedSubTask.h:93
virtual void run()=0
Abstract run function that must be implemented by any derived class which pretends to provide a concr...
SharedSubTask(std::shared_ptr< SharedSubTaskCompletionHandler > ch)
Default constructor for shared sub-task.
Definition: SharedSubTask.h:50
std::shared_ptr< SharedSubTaskCompletionHandler > ch
The shared sub-task completion handler that handles what must be done after a shared sub-task executi...
Definition: SharedSubTask.h:28
virtual std::shared_ptr< boost::thread > getThread()
Get the thread associated to the shared sub-task.
Definition: SharedSubTask.h:107