CARMA C++
|
Common base class for managing connections to DOs. More...
#include <carma/control/RemoteObjHandleT.h>
Public Member Functions | |
bool | attemptToReconnectIfNeeded () |
Try reconnect to the DO if needed. More... | |
::std::string | doName () const |
get the DO name More... | |
void | forceFullReconnect () |
Force a full re-lookup of the DO by name. More... | |
bool | isObjReachable () |
If state is 'not reachable' and monitor system is current, tries to reconnect. More... | |
bool | isObjReachable (bool logIfNotReachable) |
RemoteObjHandleBase (const ::std::string &doName, monitor::MonitorPointBool *mpReachable, const monitor::MonitorSubsystem *subsystem, monitor::MonitorSystem *system, bool defaultLogIfNotReachable, bool defaultLogSentCommands) | |
Constructor. More... | |
virtual | ~RemoteObjHandleBase () |
Destructor. More... | |
Common base class for managing connections to DOs.
Definition at line 39 of file RemoteObjHandleT.h.
carma::control::RemoteObjHandleBase::RemoteObjHandleBase | ( | const ::std::string & | doName, |
monitor::MonitorPointBool * | mpReachable, | ||
const monitor::MonitorSubsystem * | subsystem, | ||
monitor::MonitorSystem * | system, | ||
bool | defaultLogIfNotReachable, | ||
bool | defaultLogSentCommands | ||
) |
Constructor.
doName | name of the Direct Object that is the object of affection of this handle |
mpReachable | a monitor point for reachability of this DO Must be part of a Control.SubarrayX.Reachable monitor point subsystem that is routinely written by the control system. This MP is both read and write. |
subsystem | The monitor subsystem, often running on a remote machine, that is used to determine whether to try and remake the connect on the next IO attempt. Usually, if the monitor subsystem returns false from its isCurrent() method, no attempt is made to remake the connection (covers the use case of a disconnected machine, like an antenna during a move). |
system | A pointer to a monitor system which is used to do a readNewest() to update both the isCurrent state of the subsystem and the reachable MP. |
defaultLogIfNotReachable | Controls logging if the DO is not reachable. |
defaultLogSentCommands | controls logging of commands |
|
virtual |
Destructor.
bool carma::control::RemoteObjHandleBase::attemptToReconnectIfNeeded | ( | ) |
Try reconnect to the DO if needed.
The minimum work necessary to reestablish a broken connection will be done. Hence nothing will be done if the connection did not have a problem the last time it was used. Returns true if a connection is established (or was previously established) and false if it could not connect. The subsystem monitor system is not checked.
std::string carma::control::RemoteObjHandleBase::doName | ( | ) | const |
get the DO name
Definition at line 219 of file RemoteObjHandleT.h.
void carma::control::RemoteObjHandleBase::forceFullReconnect | ( | ) |
Force a full re-lookup of the DO by name.
bool carma::control::RemoteObjHandleBase::isObjReachable | ( | ) |
If state is 'not reachable' and monitor system is current, tries to reconnect.