gatb.core-API-0.0.0
|
Interface that defines a group of threads. More...
#include <IThread.hpp>
Public Member Functions | |
virtual | ~IThreadGroup () |
virtual void | add (void *(*mainloop)(void *), void *data)=0 |
virtual void | start ()=0 |
virtual ISynchronizer * | getSynchro ()=0 |
virtual size_t | size () const =0 |
virtual IThread * | operator[] (size_t idx)=0 |
virtual void | addException (system::Exception e)=0 |
virtual bool | hasExceptions () const =0 |
virtual Exception | getException () const =0 |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
virtual void | use ()=0 |
virtual void | forget ()=0 |
Interface that defines a group of threads.
This interface allows to manage a group of threads; it may be used to access a shared object by different threads.
This class is not intended to be used by end users; instead, the ThreadObject class can be used.
|
inlinevirtual |
Destructor
|
pure virtual |
Add a thread to the group. A thread is created and the provided mainloop is launched as the main function of this thread.
[in] | mainloop | : mainloop of the added thread. |
[in] | data | : data to be given to the main loop |
Implemented in ThreadGroup.
|
pure virtual |
This method is used to gather exceptions occurring during the execution of the threads of the group. By doing this, we can launch an ExceptionComposite when all the threads of the group are finished.
[in] | e | : exception thrown by one of the thread. |
Implemented in ThreadGroup.
|
pure virtual |
Get an exception that holds all the information of exceptions that have occurred during the execution of the threads of the group.
Implemented in ThreadGroup.
|
pure virtual |
Get the synchronizer associated to this threads group.
Implemented in ThreadGroup.
|
pure virtual |
Tells whether or not exceptions have been added to the thread group.
Implemented in ThreadGroup.
|
pure virtual |
Get the ith thread of the group.
[in] | idx | : index of the thread in the group |
Implemented in ThreadGroup.
|
pure virtual |
|
pure virtual |
Start all the threads of the group at the same time. Implementations should ensure this by some synchronization mechanism.
Implemented in ThreadGroup.