AceSmartSoft API Documentation
|
#include <smartCondVar.hh>
Public Member Functions | |
SmartCVwithoutMemory () | |
constructor More... | |
~SmartCVwithoutMemory () | |
destructor More... | |
SmartCVwithoutMemory (const SmartCVwithoutMemory &) | |
copy constructor More... | |
SmartCVwithoutMemory & | operator= (const SmartCVwithoutMemory &) |
copy assignment More... | |
void | blockingUser (const bool) |
void | blockingPattern (const bool) |
void | blockingComponent (const bool) |
void | signal () |
Smart::StatusCode | wait (const SmartTimeValue &timeout=SmartTimeValue::zero) |
Condition variable without memory
The condition variable is used to avoid active waiting. The condition variable has no memory and does not know whether it has been signalled before or not. It is therefore used for example within the pushNewestClient to wait for the next arriving update.
Condition variable discriminates between blockingPattern and blockingUser. Both can enforce non-blocking. The pattern uses the non-blocking mode to abort blocking waits when getting disconnected for example. This is used to avoid blocking calls for new updates if for example an unsubscribe is executed in parallel to a blocking call to "getUpdateWait" in the pushNewestClient. Please look there for further details. The user can enforce non-blocking mode to abort blocking waits for example to continue with processing without awaiting the answer.
One could also implement a counting blocking indicator with acquire/release member functions. It is however less error prone from the user view not to be forced to have a matching number of acquire/release calls and we therefore implemented separate flags for the pattern internal use and the user.
The wait() member function first checks the blocking flags. It returns immediately with SMART_CANCELLED if at least one flag enforces non-blocking mode. Otherwise it waits for either a signal or for being cancelled. If the condition variable is signalled, it returns with SMART_OK.
SmartACE::SmartCVwithoutMemory::SmartCVwithoutMemory | ( | ) |
constructor
SmartACE::SmartCVwithoutMemory::~SmartCVwithoutMemory | ( | ) |
destructor
SmartACE::SmartCVwithoutMemory::SmartCVwithoutMemory | ( | const SmartCVwithoutMemory & | ) |
copy constructor
void SmartACE::SmartCVwithoutMemory::blockingComponent | ( | const bool | ) |
void SmartACE::SmartCVwithoutMemory::blockingPattern | ( | const bool | ) |
void SmartACE::SmartCVwithoutMemory::blockingUser | ( | const bool | ) |
SmartCVwithoutMemory& SmartACE::SmartCVwithoutMemory::operator= | ( | const SmartCVwithoutMemory & | ) |
copy assignment
void SmartACE::SmartCVwithoutMemory::signal | ( | ) |
Smart::StatusCode SmartACE::SmartCVwithoutMemory::wait | ( | const SmartTimeValue & | timeout = SmartTimeValue::zero | ) |