Fawkes API Fawkes Development Version
|
This class gives access to SyncPoints. More...
#include <>>
Public Member Functions | |
SyncPointManager (MultiLogger *logger) | |
Constructor. More... | |
RefPtr< SyncPoint > | get_syncpoint (const std::string &component, const std::string &identifier) |
Get a SyncPoint. More... | |
void | release_syncpoint (const std::string &component, RefPtr< SyncPoint > syncpoint) |
Release a SyncPoint. More... | |
std::set< RefPtr< SyncPoint >, SyncPointSetLessThan > | get_syncpoints () |
Get the current list of all SyncPoints managed by this SyncPointManager. More... | |
Protected Attributes | |
std::set< RefPtr< SyncPoint >, SyncPointSetLessThan > | syncpoints_ |
Set of all existing SyncPoints. More... | |
Mutex * | mutex_ |
Mutex used for all SyncPointManager calls. More... | |
This class gives access to SyncPoints.
SyncPoints should never be created directly but always by using this class.
All threads with the SyncPointManager Aspect share the same SyncPointManager. SyncPointManager provides basic methods to get and release shared SyncPoints
Definition at line 37 of file syncpoint_manager.h.
fawkes::SyncPointManager::SyncPointManager | ( | MultiLogger * | logger | ) |
Constructor.
logger | the logger to use for logging messages |
Definition at line 46 of file syncpoint_manager.cpp.
|
virtual |
Definition at line 50 of file syncpoint_manager.cpp.
RefPtr< SyncPoint > fawkes::SyncPointManager::get_syncpoint | ( | const std::string & | component, |
const std::string & | identifier | ||
) |
Get a SyncPoint.
This allows accessing the SyncPoint's wait() and emit() methods. This function creates a SyncPoint with the given identifier if it does not exist yet and constructs its predecessor.
component | The name of the component calling the method |
identifier | The identifier of the requested SyncPoint |
SyncPointInvalidComponentException | thrown if component name is invalid |
SyncPointAlreadyOpenedException | thrown if SyncPoint is already opened by the component |
Definition at line 68 of file syncpoint_manager.cpp.
References mutex_.
Referenced by Emitter::Emitter(), fawkes::FawkesTimingThread::init(), fawkes::SyncPointAspect::init_SyncPointAspect(), and fawkes::FawkesMainThread::once().
std::set< RefPtr< SyncPoint >, SyncPointSetLessThan > fawkes::SyncPointManager::get_syncpoints | ( | ) |
Get the current list of all SyncPoints managed by this SyncPointManager.
Definition at line 115 of file syncpoint_manager.cpp.
References mutex_, and syncpoints_.
void fawkes::SyncPointManager::release_syncpoint | ( | const std::string & | component, |
RefPtr< SyncPoint > | sync_point | ||
) |
Release a SyncPoint.
After releasing the SyncPoint, its wait() and emit() methods cannot be called anymore by the releasing component. This also releases the SyncPoint's predecessor if existent.
SyncPointReleasedDoesNotExistException | thrown if the SyncPoint doesn't exist, i.e. is not in the list of the manager's SyncPoints. |
SyncPointReleasedByNonWatcherException | The releasing component is not a watcher of the SyncPoint |
Definition at line 86 of file syncpoint_manager.cpp.
References mutex_.
Referenced by fawkes::FawkesTimingThread::finalize(), fawkes::SyncPointAspect::finalize_SyncPointAspect(), and Emitter::~Emitter().
|
protected |
Mutex used for all SyncPointManager calls.
Definition at line 52 of file syncpoint_manager.h.
Referenced by get_syncpoint(), get_syncpoints(), and release_syncpoint().
|
protected |
Set of all existing SyncPoints.
Definition at line 50 of file syncpoint_manager.h.
Referenced by get_syncpoints().