gatb.core-API-0.0.0
|
Launches commands in current thread. More...
#include <Command.hpp>
Public Member Functions | |
virtual | ~SerialDispatcher () |
size_t | dispatchCommands (std::vector< ICommand * > &commands, ICommand *postTreatment=0) |
size_t | getExecutionUnitsNumber () |
void | setGroupSize (size_t groupSize) |
size_t | getGroupSize () const |
Public Member Functions inherited from IDispatcher | |
template<typename Item , typename Functor > | |
Status | iterate (Iterator< Item > *iterator, const Functor &functor, size_t groupSize=1000, bool deleteSynchro=false) |
template<typename Item , typename Functor > | |
Status | iterate (const Iterator< Item > &iterator, const Functor &functor, size_t groupSize=1000, bool deleteSynchro=false) |
Public Member Functions inherited from SmartPointer | |
void | use () |
void | forget () |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
Additional Inherited Members | |
Protected Member Functions inherited from IDispatcher | |
template<typename Item , typename Functor > | |
Status | iterate (Iterator< Item > *iterator, std::vector< Functor * > &functors, size_t groupSize=1000, bool deleteSynchro=false) |
Protected Member Functions inherited from SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Launches commands in current thread.
A dispatcher that uses the calling thread, so no parallelization.
This implementation can be useful to process ICommand instances in an serial way when it is required, while keeping an uniform API (ie. call dispatchCommands) for running ICommand instances.
|
inlinevirtual |
Destructor (defined because of presence of virtual methods).
|
virtual |
Dispatch commands execution in some separate contexts (threads for instance). Once the commands are launched, this dispatcher waits for the commands finish. Then, it may have to execute a post treatment command (if any).
[in] | commands | : commands to be executed |
[in] | postTreatment | : command to be executed after all the commands are done |
Implements IDispatcher.
|
inlinevirtual |
Returns the number of execution units for this dispatcher. For instance, it could be the number of cores in a multi cores architecture.
Implements IDispatcher.
|
inlinevirtual |
Get the number of items to be retrieved from the iterator by one thread in a synchronized way.
Implements IDispatcher.
|
inlinevirtual |
Set the number of items to be retrieved from the iterator by one thread in a synchronized way.
[in] | groupSize | : number of items to be retrieved. |
Implements IDispatcher.