yarp-devices
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
roboticslab::StateObserverBase Class Referenceabstract

Base class for a state observer. More...

#include <StateObserver.hpp>

Inheritance diagram for roboticslab::StateObserverBase:
roboticslab::TypedStateObserver< double > roboticslab::TypedStateObserver< encoder_t > roboticslab::StateObserver roboticslab::TypedStateObserver< T, NonFundamentalType > roboticslab::TypedStateObserver< T, typename std::enable_if_t< std::is_arithmetic_v< T > > > roboticslab::TypedStateObserver< std::uint8_t[]>

Classes

class  Private
 

Public Member Functions

 StateObserverBase (double timeout)
 Constructor, configure with timeout in seconds.
 
virtual ~StateObserverBase ()=0
 Virtual destructor.
 
 StateObserverBase (const StateObserverBase &)=delete
 Deleted copy constructor.
 
StateObserverBaseoperator= (const StateObserverBase &)=delete
 Deleted copy assignment operator.
 
double getTimeout () const
 Retrieve configured timeout (in seconds).
 
bool await (void *raw=nullptr)
 Causes the current thread to wait until notify is invoked or the timeout elapses.
 
bool notify (const void *raw=nullptr, std::size_t len=0)
 Wake up a thread that waits on this object's monitor.
 

Protected Member Functions

void * getRemoteStorage ()
 Retrieve modifiable handle to notified data storage.
 
const void * getRemoteStorage () const
 Retrieve non-modifiable handle to notified data storage.
 
virtual void setRemoteStorage (const void *ptr, std::size_t len)
 Set data storage to notify observers with.
 

Private Attributes

double timeout
 
Privateimpl
 

Detailed Description

This monitor class provides a synchronized timeout mechanism for clients to wait for a specific event to happen. A call to await blocks the caller until notify is invoked by another thread or the timeout has elapsed.


The documentation for this class was generated from the following files: