AceSmartSoft API Documentation
|
#include <smartCondVar.hh>
Public Member Functions | |
SmartCVwithMemory () | |
constructor More... | |
~SmartCVwithMemory () | |
destructor More... | |
SmartCVwithMemory (const SmartCVwithMemory &) | |
copy constructor More... | |
SmartCVwithMemory & | operator= (const SmartCVwithMemory &) |
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) |
void | reset () |
Condition variable with memory
The condition variable is used to avoid active waiting. It memorizes whether the condition variable has been signalled since the last wait. It is used within the queryPattern to memorize whether an answer has been received for the pending request.
Using this condition variable makes sure that no signal and therefore no answer is missed. One otherwise would eventually block infinitely on a condition variable waiting for the next signal which will never be given since each request has exactly one response.
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. The user can enforce non-blocking mode to abort blocking waits to for example 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.
Signalling this condition variable sets the signalled flag. The wait() member function returns immediately with SMART_OK in case the signalled flag is set and consumes it. If it has not been signalled so far, it checks the blocking flags. It returns immediately with SMART_CANCELLED in case of at least one flag enforces non-blocking mode. Otherwise, it waits for either a signal or for being cancelled.
SmartACE::SmartCVwithMemory::SmartCVwithMemory | ( | ) |
constructor
SmartACE::SmartCVwithMemory::~SmartCVwithMemory | ( | ) |
destructor
SmartACE::SmartCVwithMemory::SmartCVwithMemory | ( | const SmartCVwithMemory & | ) |
copy constructor
void SmartACE::SmartCVwithMemory::blockingComponent | ( | const bool | ) |
void SmartACE::SmartCVwithMemory::blockingPattern | ( | const bool | ) |
void SmartACE::SmartCVwithMemory::blockingUser | ( | const bool | ) |
SmartCVwithMemory& SmartACE::SmartCVwithMemory::operator= | ( | const SmartCVwithMemory & | ) |
copy assignment
void SmartACE::SmartCVwithMemory::reset | ( | ) |
void SmartACE::SmartCVwithMemory::signal | ( | ) |
Smart::StatusCode SmartACE::SmartCVwithMemory::wait | ( | const SmartTimeValue & | timeout = SmartTimeValue::zero | ) |