RTC Toolkit  0.1.0-alpha
Public Member Functions | List of all members
rtctk::rtcSupervisor::RtcObject Class Reference

#include <rtcObject.hpp>

Inheritance diagram for rtctk::rtcSupervisor::RtcObject:
MockRtcObject

Public Member Functions

 RtcObject (const std::string &name, const std::string &rr_uri, const std::string &ps_uri)
 
virtual ~RtcObject ()
 
virtual void BelievedState (const std::string &s)
 Set the believed state as a string and evaluate as enumeration. More...
 
virtual std::string BelievedState ()
 Set the believed state as a string and evaluate as enumeration. More...
 
virtual std::string BelievedSubstate ()
 
void EvaluatedState (RtcState &state, RtcSubState &subState)
 Return the state evaluated as enumeration. More...
 
virtual std::string Name ()
 
virtual void BelievedError (bool i)
 Setter and Getter for BelievedError. More...
 
virtual bool BelievedError ()
 
virtual std::string RunCmd (RtcCommand cmd, bool shortTmo)
 Run command with optional arg. More...
 
virtual std::string RunAsync (RtcCommand cmd)
 Run command async. More...
 
virtual std::string WaitAsync ()
 Wait for previously async run command. More...
 
virtual bool GetAsyncCommandOK ()
 Get indication that async command was OK, no exception or funny return values. More...
 
virtual void BuildObject ()
 Called from ctor, public for mocking purposes. More...
 

Constructor & Destructor Documentation

◆ RtcObject()

rtctk::rtcSupervisor::RtcObject::RtcObject ( const std::string &  name,
const std::string &  rr_uri,
const std::string &  ps_uri 
)
Parameters
nameName of the object e.g. VisAcq
rr_uriURI of request response end point
ps_uriURI of publish reply end point for state Event publication
Returns
none

To allow easy unit tests we allow reation of an rtcObject without trying to resolve it

Generate the handles by which we can send commands to the object this might throw if the resolition fails

◆ ~RtcObject()

rtctk::rtcSupervisor::RtcObject::~RtcObject ( )
virtual

Member Function Documentation

◆ BelievedError() [1/2]

virtual bool rtctk::rtcSupervisor::RtcObject::BelievedError ( )
inlinevirtual

◆ BelievedError() [2/2]

virtual void rtctk::rtcSupervisor::RtcObject::BelievedError ( bool  i)
inlinevirtual

Setter and Getter for BelievedError.

◆ BelievedState() [1/2]

std::string rtctk::rtcSupervisor::RtcObject::BelievedState ( )
virtual

Set the believed state as a string and evaluate as enumeration.

Returns
String as stored by BelievedState

◆ BelievedState() [2/2]

void rtctk::rtcSupervisor::RtcObject::BelievedState ( const std::string &  s)
virtual

Set the believed state as a string and evaluate as enumeration.

Parameters
sState as string from Event

◆ BelievedSubstate()

std::string rtctk::rtcSupervisor::RtcObject::BelievedSubstate ( )
virtual

◆ BuildObject()

void rtctk::rtcSupervisor::RtcObject::BuildObject ( )
virtual

Called from ctor, public for mocking purposes.

Try and establish the MAL connection to the object and build the handles

This will be called initially but also if communication fails with the component

Check if we had problems communicating with this component

Try and decode whatever type of exception we got and re-throw it as something which is recognised by the rest of the system

◆ EvaluatedState()

void rtctk::rtcSupervisor::RtcObject::EvaluatedState ( RtcState state,
RtcSubState substate 
)

Return the state evaluated as enumeration.

Returns
State and Substate evaluated as enumeration

Return the state which has been evaluated by the object

◆ GetAsyncCommandOK()

bool rtctk::rtcSupervisor::RtcObject::GetAsyncCommandOK ( )
virtual

Get indication that async command was OK, no exception or funny return values.

◆ Name()

virtual std::string rtctk::rtcSupervisor::RtcObject::Name ( )
inlinevirtual
Returns
Name of object

◆ RunAsync()

std::string rtctk::rtcSupervisor::RtcObject::RunAsync ( RtcCommand  cmd)
virtual

Run command async.

Check if we had problems communicating with this component

Try and decode whatever type of exception we got and re-throw it as something which is recognised by the rest of the system

◆ RunCmd()

std::string rtctk::rtcSupervisor::RtcObject::RunCmd ( RtcCommand  cmd,
bool  shortTmo 
)
virtual

Run command with optional arg.

Check if we had problems communicating with this component and if so throw an error

Assume success initially

Some components do not indicate errors as exceptions but a non-OK reply we use a flag to indicate that commands should return an OK

Now just switch on the command and call the appropriate interface either using the interface stub with a timeout or not depending on the timed flag

Try and decode whatever type of exception we got and re-throw it as something which is recognised by the rest of the system

◆ WaitAsync()

std::string rtctk::rtcSupervisor::RtcObject::WaitAsync ( )
virtual

Wait for previously async run command.

Try and decode whatever type of exception we got and re-throw it as something which is recognised by the rest of the system


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