Fawkes API
Fawkes Development Version
|
#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 41 of file syncpoint_manager.h.
fawkes::SyncPointManager::SyncPointManager | ( | MultiLogger * | logger | ) |
Constructor.
logger | the logger to use for logging messages |
Definition at line 51 of file syncpoint_manager.cpp.
References mutex_.
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 73 of file syncpoint_manager.cpp.
References mutex_.
Referenced by Emitter::Emitter(), fawkes::FawkesTimingThread::init(), fawkes::FawkesMainThread::once(), and fawkes::SyncPointAspect::~SyncPointAspect().
std::set< RefPtr< SyncPoint >, SyncPointSetLessThan > fawkes::SyncPointManager::get_syncpoints | ( | ) |
Get the current list of all SyncPoints managed by this SyncPointManager.
Definition at line 120 of file syncpoint_manager.cpp.
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 91 of file syncpoint_manager.cpp.
Referenced by fawkes::FawkesTimingThread::finalize().
|
protected |
Mutex used for all SyncPointManager calls.
Definition at line 56 of file syncpoint_manager.h.
Referenced by get_syncpoint(), fawkes::SyncPointSetLessThan::operator()(), and SyncPointManager().
|
protected |
Set of all existing SyncPoints.
Definition at line 54 of file syncpoint_manager.h.
Referenced by fawkes::SyncPointSetLessThan::operator()().