![]() |
VR-Link API Documentation for HLA Evolved
|
DtParallelExecutionContainer is implementation of DtExecutionContainer which executes methods on all contained objects in parallel on multiple threads. More...
Inheritance diagram for DtParallelExecutionContainer< Texec >:
Collaboration diagram for DtParallelExecutionContainer< Texec >:Classes | |
| class | ExecutableItem |
| This class is used by TBB to manage the work units to perform. More... | |
Public Types | |
| typedef std::vector< Texec * > | PecContainerType |
| typedef PecContainerType::iterator | PecIteratorType |
Public Member Functions | |
| DtParallelExecutionContainer (bool parallel=true) | |
| Default to parallel execution. More... | |
| virtual | ~DtParallelExecutionContainer () |
| virtual void | add (Texec *item) |
| Add a reference to the list. More... | |
| virtual void | remove (Texec *item) |
| Remove a reference from the list. More... | |
| virtual void | clear () |
| Clear the list. More... | |
| virtual bool | empty () |
| Returns true if the container is empty. More... | |
| virtual unsigned int | count () |
| Returns the number of items in the container. More... | |
| virtual void | deleteAndClear () |
| Delete all referenced objects and then clear the list. More... | |
| virtual PecIteratorType | begin () |
| Iterators over the collection. More... | |
| virtual PecIteratorType | end () |
| virtual void | executeMethod (void(Texec::*theMethodPtr)()) |
| worker methods More... | |
| virtual void | setParallel (bool parallel) |
| The 'parallel' property determines if the methods are executed in parallel or serial. More... | |
| virtual bool | isParallel () const |
| virtual void | setMaxNumberThreads (int numThreads) |
| Set maximum number of threads created during executeMothod calls. Default is -1, which uses as many threads as possible. More... | |
| virtual int | maxNumberThreads () const |
Protected Member Functions | |
| virtual void | executeMethodParallel (void(Texec::*theMethodPtr)()) |
| Execute method on all contained objects in parallel using multiple threads. More... | |
| virtual void | executeMethodSerial (void(Texec::*theMethodPtr)()) |
| For test and debug, a convenience to execute methods serially. More... | |
| virtual void | beginParallel () |
| executed before entering a parallel section More... | |
| virtual void | endParallel () |
| executed after leaving a parallel section More... | |
Protected Attributes | |
| PecContainerType | myExecVec |
| Contains pointers to published entities. More... | |
Private Attributes | |
| bool | useParallel |
| true if using parallel execution, false for serial More... | |
| int | myNumThreads |
| default is -1 for maximum concurrency More... | |
DtParallelExecutionContainer is implementation of DtExecutionContainer which executes methods on all contained objects in parallel on multiple threads.
Note that objects of this class are not themselves threadsafe, so you can't add items to, or remove items from the collection in different threads.
| typedef std::vector<Texec *> DtParallelExecutionContainer< Texec >::PecContainerType |
| typedef PecContainerType::iterator DtParallelExecutionContainer< Texec >::PecIteratorType |
|
inline |
Default to parallel execution.
|
inlinevirtual |
|
inlinevirtual |
Add a reference to the list.
Implements DtExecutionContainer< Texec >.
|
inlinevirtual |
Iterators over the collection.
Referenced by DtParallelExecutionContainer< DtObjectPublisher >::remove().
|
inlineprotectedvirtual |
executed before entering a parallel section
|
inlinevirtual |
Clear the list.
Implements DtExecutionContainer< Texec >.
|
inlinevirtual |
Returns the number of items in the container.
|
inlinevirtual |
Delete all referenced objects and then clear the list.
Implements DtExecutionContainer< Texec >.
|
inlinevirtual |
Returns true if the container is empty.
|
inlinevirtual |
Referenced by DtParallelExecutionContainer< DtObjectPublisher >::remove().
|
inlineprotectedvirtual |
executed after leaving a parallel section
|
inlinevirtual |
worker methods
Execute method on all contained objects.
Implements DtExecutionContainer< Texec >.
Referenced by DtPublisherContainer< DtObjectPublisher >::forceUpdate(), and DtPublisherContainer< DtObjectPublisher >::tick().
|
inlineprotectedvirtual |
Execute method on all contained objects in parallel using multiple threads.
|
inlineprotectedvirtual |
For test and debug, a convenience to execute methods serially.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Remove a reference from the list.
Implements DtExecutionContainer< Texec >.
|
inlinevirtual |
Set maximum number of threads created during executeMothod calls. Default is -1, which uses as many threads as possible.
|
inlinevirtual |
The 'parallel' property determines if the methods are executed in parallel or serial.
|
protected |
Contains pointers to published entities.
Referenced by DtParallelExecutionContainer< DtObjectPublisher >::add(), DtParallelExecutionContainer< DtObjectPublisher >::begin(), DtParallelExecutionContainer< DtObjectPublisher >::clear(), DtParallelExecutionContainer< DtObjectPublisher >::count(), DtParallelExecutionContainer< DtObjectPublisher >::empty(), DtParallelExecutionContainer< DtObjectPublisher >::end(), and DtParallelExecutionContainer< DtObjectPublisher >::remove().
|
private |
default is -1 for maximum concurrency
Referenced by DtParallelExecutionContainer< DtObjectPublisher >::maxNumberThreads(), and DtParallelExecutionContainer< DtObjectPublisher >::setMaxNumberThreads().
|
private |
true if using parallel execution, false for serial
Referenced by DtParallelExecutionContainer< DtObjectPublisher >::isParallel(), and DtParallelExecutionContainer< DtObjectPublisher >::setParallel().