cisst-saw
Loading...
Searching...
No Matches
mtsEventReceiverWrite Class Reference

#include <mtsEventReceiver.h>

Inheritance diagram for mtsEventReceiverWrite:
mtsEventReceiverBase

Public Member Functions

 mtsEventReceiverWrite ()
 ~mtsEventReceiverWrite ()
mtsCommandWriteBaseGetCommand ()
void SetHandlerCommand (mtsCommandWriteBase *commandHandler)
template<class __classType, class __argumentType>
mtsCommandWriteBaseSetHandler (void(__classType::*method)(const __argumentType &), __classType *classInstantiation, mtsEventQueueingPolicy queueingPolicy=MTS_INTERFACE_EVENT_POLICY)
virtual bool PrepareToWait (mtsGenericObject &obj)
bool IsArgValid () const
virtual bool Wait ()
virtual bool WaitWithTimeout (double timeoutInSec)
virtual void ClearWait ()
bool RemoveHandler (void)
void ToStream (std::ostream &outputStream) const
virtual bool PrepareToWait ()
Public Member Functions inherited from mtsEventReceiverBase
 mtsEventReceiverBase ()
virtual ~mtsEventReceiverBase ()
void SetName (const std::string &name)
virtual std::string GetName () const
virtual void SetRequired (const std::string &name, mtsInterfaceRequired *req)
virtual void SetThreadSignal (osaThreadSignal *signal)
virtual void Detach ()

Protected Member Functions

void EventHandler (const mtsGenericObject &arg)
Protected Member Functions inherited from mtsEventReceiverBase
bool CheckRequired () const
void CheckEventSignal ()
bool WaitCommon ()

Protected Attributes

mtsCommandWriteBaseCommand
mtsCommandWriteBaseUserHandler
mtsGenericObjectArgPtr
Protected Attributes inherited from mtsEventReceiverBase
std::string Name
mtsInterfaceRequiredRequired
osaThreadSignalEventSignal
bool OwnEventSignal
WaitStates WaitState
osaMutex WaitMutex

Additional Inherited Members

Protected Types inherited from mtsEventReceiverBase
enum  WaitStates { EVENT_RECEIVER_IDLE , EVENT_RECEIVER_PREPARING , EVENT_RECEIVER_WAITING , EVENT_RECEIVER_SIGNALED }

Constructor & Destructor Documentation

◆ mtsEventReceiverWrite()

mtsEventReceiverWrite::mtsEventReceiverWrite ( )

◆ ~mtsEventReceiverWrite()

mtsEventReceiverWrite::~mtsEventReceiverWrite ( )

Member Function Documentation

◆ ClearWait()

virtual void mtsEventReceiverWrite::ClearWait ( )
virtual

Clear the WaitState (set to EVENT_RECEIVER_IDLE)

Reimplemented from mtsEventReceiverBase.

◆ EventHandler()

void mtsEventReceiverWrite::EventHandler ( const mtsGenericObject & arg)
protected

◆ GetCommand()

mtsCommandWriteBase * mtsEventReceiverWrite::GetCommand ( )

Called from mtsInterfaceRequired::BindCommandsAndEvents

◆ IsArgValid()

bool mtsEventReceiverWrite::IsArgValid ( ) const
inline

◆ PrepareToWait() [1/2]

virtual bool mtsEventReceiverBase::PrepareToWait ( )
virtual

Indicate that the waiting thread is preparing to wait on an event, but that there may be some time before Wait or WaitWithTimeout will be called. Calling this command ensures that if the event if raised after the call to PrepareToWait, but before the call to Wait or WaitWithTimeout, that the Wait or WaitWithTimeout methods will return rather than wait indefinitely. It is not required to call this method, but it is recommended if there is a possibility of an indefinite (or infinite) wait if only a single event is expected and if it can occur before Wait or WaitWithTimeout is called. See the description of WaitStates above.

Returns
true if successful, false if failed.

Reimplemented from mtsEventReceiverBase.

◆ PrepareToWait() [2/2]

virtual bool mtsEventReceiverWrite::PrepareToWait ( mtsGenericObject & obj)
virtual

◆ RemoveHandler()

bool mtsEventReceiverWrite::RemoveHandler ( void )

◆ SetHandler()

template<class __classType, class __argumentType>
mtsCommandWriteBase * mtsEventReceiverWrite::SetHandler ( void(__classType::* method )(const __argumentType &),
__classType * classInstantiation,
mtsEventQueueingPolicy queueingPolicy = MTS_INTERFACE_EVENT_POLICY )
inline

◆ SetHandlerCommand()

void mtsEventReceiverWrite::SetHandlerCommand ( mtsCommandWriteBase * commandHandler)

◆ ToStream()

void mtsEventReceiverWrite::ToStream ( std::ostream & outputStream) const
virtual

Human readable output to stream.

Implements mtsEventReceiverBase.

◆ Wait()

virtual bool mtsEventReceiverWrite::Wait ( )
virtual

Wait for event to be issued. If successful, object specified in PrepareToWait is valid.

Returns
true if successful, false if failed (including case where wait succeeded but return value obj is invalid)

Reimplemented from mtsEventReceiverBase.

◆ WaitWithTimeout()

virtual bool mtsEventReceiverWrite::WaitWithTimeout ( double timeoutInSec)
virtual

Wait for event to be issued, up to specified timeout.

Returns
true if successful, false if failed or timeout occurred.

Reimplemented from mtsEventReceiverBase.

Member Data Documentation

◆ ArgPtr

mtsGenericObject* mtsEventReceiverWrite::ArgPtr
protected

◆ Command

mtsCommandWriteBase* mtsEventReceiverWrite::Command
protected

◆ UserHandler

mtsCommandWriteBase* mtsEventReceiverWrite::UserHandler
protected

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