Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::WireConnectionBase Class Referenceabstract

Base class for WireConnection. More...

#include <WireMember.h>

Inheritance diagram for RobotRaconteur::WireConnectionBase:
RobotRaconteur::WireConnection< T >

Public Member Functions

virtual uint32_t GetEndpoint ()
 Returns the Robot Raconteur node Endpoint ID.
virtual TimeSpec GetLastValueReceivedTime ()
 Get the timestamp of the last received value.
virtual TimeSpec GetLastValueSentTime ()
 Get the timestamp of the last sent value.
virtual void Close ()
 Close the wire connection.
virtual void AsyncClose (boost::function< void(const boost::shared_ptr< RobotRaconteurException > &)> handler, int32_t timeout)
 Asynchronously close the wire connection.
virtual bool GetInValueValid ()
 Get if the InValue is valid.
virtual bool GetOutValueValid ()
 Get if the OutValue is valid.
bool WaitInValueValid (int32_t timeout=RR_TIMEOUT_INFINITE)
 Waits for InValue to be valid.
bool WaitOutValueValid (int32_t timeout=RR_TIMEOUT_INFINITE)
 Waits for OutValue to be valid.
virtual bool GetIgnoreInValue ()
 Get if wire connection is ignoring incoming values.
virtual void SetIgnoreInValue (bool ignore)
 Set whether wire connection should ignore incoming values.
MemberDefinition_Direction Direction ()
 The direction of the wire.
virtual int32_t GetInValueLifespan ()
 Get the lifespan of InValue.
virtual void SetInValueLifespan (int32_t millis)
 Set the lifespan of InValue.
virtual int32_t GetOutValueLifespan ()
 Get the lifespan of OutValue.
virtual void SetOutValueLifespan (int32_t millis)
 Set the lifespan of OutValue.

Detailed Description

Base class for WireConnection.

Base class for templated WireConnection

Member Function Documentation

◆ AsyncClose()

virtual void RobotRaconteur::WireConnectionBase::AsyncClose ( boost::function< void(const boost::shared_ptr< RobotRaconteurException > &)> handler,
int32_t timeout )
virtual

Asynchronously close the wire connection.

Same as Close() but returns asynchronously

Parameters
handlerA handler function to call on completion, possibly with an exception
timeoutTimeout in milliseconds, or RR_TIMEOUT_INFINITE for no timeout

Reimplemented in RobotRaconteur::WireConnection< T >.

◆ Close()

virtual void RobotRaconteur::WireConnectionBase::Close ( )
virtual

Close the wire connection.

Close the wire connection. Blocks until close complete. The peer wire connection is destroyed automatically.

Reimplemented in RobotRaconteur::WireConnection< T >.

◆ Direction()

MemberDefinition_Direction RobotRaconteur::WireConnectionBase::Direction ( )

The direction of the wire.

Wires may be declared readonly or writeonly in the service definition file. (If neither is specified, the wire is assumed to be full duplex.) readonly wire may only send out values from service to client. writeonly wires may only send out values from client to service.

Returns
MemberDefinition_Direction

◆ GetEndpoint()

virtual uint32_t RobotRaconteur::WireConnectionBase::GetEndpoint ( )
virtual

Returns the Robot Raconteur node Endpoint ID.

Returns the endpoint associated with the ClientContext or ServerEndpoint associated with the wire connection.

Returns
uint32_t The Robot Raconteur node Endpoint ID

◆ GetIgnoreInValue()

virtual bool RobotRaconteur::WireConnectionBase::GetIgnoreInValue ( )
virtual

Get if wire connection is ignoring incoming values.

If true, wire connection is ignoring incoming values and is not storing the value

Returns
true Wire connection is ignoring incoming values
false Wire connection is not ignoring incoming values

◆ GetInValueLifespan()

virtual int32_t RobotRaconteur::WireConnectionBase::GetInValueLifespan ( )
virtual

Get the lifespan of InValue.

InValue may optionally have a finite lifespan specified in milliseconds. Once the lifespan after reception has expired, the InValue is cleared, and becomes invalid. Attempts to access InValue will result in a ValueNotSetException.

Returns
int32_t The lifespan in milliseconds

◆ GetInValueValid()

virtual bool RobotRaconteur::WireConnectionBase::GetInValueValid ( )
virtual

Get if the InValue is valid.

The InValue is valid if a value has been received and the value has not expired

Returns
true The InValue is valid
false The OutValue is invalid

◆ GetLastValueReceivedTime()

virtual TimeSpec RobotRaconteur::WireConnectionBase::GetLastValueReceivedTime ( )
virtual

Get the timestamp of the last received value.

Returns the timestamp of the value in the senders clock

Returns
TimeSpec The timestamp of the last received value

◆ GetLastValueSentTime()

virtual TimeSpec RobotRaconteur::WireConnectionBase::GetLastValueSentTime ( )
virtual

Get the timestamp of the last sent value.

Returns the timestamp of the last sent value in the local clock

Returns
TimeSpec The timestamp of the last sent value

◆ GetOutValueLifespan()

virtual int32_t RobotRaconteur::WireConnectionBase::GetOutValueLifespan ( )
virtual

Get the lifespan of OutValue.

OutValue may optionally have a finite lifespan specified in milliseconds. Once the lifespan after sending has expired, the OutValue is cleared, and becomes invalid. Attempts to access OutValue will result in a ValueNotSetException.

Returns
int32_t The lifespan in milliseconds

◆ GetOutValueValid()

virtual bool RobotRaconteur::WireConnectionBase::GetOutValueValid ( )
virtual

Get if the OutValue is valid.

The OutValue is valid if a value has been set using SetOutValue()

Returns
true The OutValue is valid
false The OutValue is invalid

◆ SetIgnoreInValue()

virtual void RobotRaconteur::WireConnectionBase::SetIgnoreInValue ( bool ignore)
virtual

Set whether wire connection should ignore incoming values.

Wire connections may optionally desire to ignore incoming values. This is useful if the connection is only being used to send out values, and received values may create a potential memory . If ignore is true, incoming values will be discarded.

Parameters
ignoreIf true, incoming values are ignored. If false, the most recent value is stored.

◆ SetInValueLifespan()

virtual void RobotRaconteur::WireConnectionBase::SetInValueLifespan ( int32_t millis)
virtual

Set the lifespan of InValue.

InValue may optionally have a finite lifespan specified in milliseconds. Once the lifespan after reception has expired, the InValue is cleared and becomes invalid. Attempts to access InValue will result in ValueNotSetException.

InValue lifespans may be used to avoid using a stale value received by the wire. If the lifespan is not set, the wire will continue to return the last received value, even if the value is old.

Parameters
millisThe lifespan in millisecond, or RR_VALUE_LIFESPAN_INFINITE for infinite lifespan

◆ SetOutValueLifespan()

virtual void RobotRaconteur::WireConnectionBase::SetOutValueLifespan ( int32_t millis)
virtual

Set the lifespan of OutValue.

OutValue may optionally have a finite lifespan specified in milliseconds. Once the lifespan after sending has expired, the OutValue is cleared and becomes invalid. Attempts to access OutValue will result in ValueNotSetException.

OutValue lifespans may be used to avoid using a stale value sent by the wire. If the lifespan is not set, the wire will continue to return the last sent value, even if the value is old.

Parameters
millisThe lifespan in millisecond, or RR_VALUE_LIFESPAN_INFINITE for infinite lifespan

◆ WaitInValueValid()

bool RobotRaconteur::WireConnectionBase::WaitInValueValid ( int32_t timeout = RR_TIMEOUT_INFINITE)

Waits for InValue to be valid.

Blocks the current thread until InValue is valid, with an optional timeout. Returns true if InValue is valid, or false if timeout occurred.

Parameters
timeoutTimeout in milliseconds, or RR_TIMEOUT_INFINITE for no timeout
Returns
true The InValue is valid
false The InValue is invalid

◆ WaitOutValueValid()

bool RobotRaconteur::WireConnectionBase::WaitOutValueValid ( int32_t timeout = RR_TIMEOUT_INFINITE)

Waits for OutValue to be valid.

Blocks the current thread until OutValue is valid, with an optional timeout. Returns true if OutValue is valid, or false if timeout occurred.

Parameters
timeoutTimeout in milliseconds, or RR_TIMEOUT_INFINITE for no timeout
Returns
true The InValue is valid
false The InValue is invalid

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