CARMA C++
carma::control::RemoteObjHandleBase Class Referenceabstract

Common base class for managing connections to DOs. More...

#include <carma/control/RemoteObjHandleT.h>

Inheritance diagram for carma::control::RemoteObjHandleBase:
carma::control::RemoteObjHandleT< T > carma::control::AlarmHandle carma::control::AntennaHandle carma::control::CalibratorHandle carma::control::ClockHandle carma::control::CorrelatorHandle carma::control::CryoHandle carma::control::DownconverterHandle carma::control::DriveHandle carma::control::FaultHandle carma::control::FocusHandle carma::control::LineLengthHandle carma::control::LoberotatorHandle carma::control::LOrefHandle carma::control::OpticalTelHandle carma::control::PipelineHandle carma::control::ProjectDatabaseManagerHandle carma::control::RxSelectorHandle carma::control::SignalPathMapperHandle carma::control::VlbiHandle

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...
 

Protected Member Functions

bool getDefaultLogIfNotReachable () const
 
bool getDefaultLogSentCommands () const
 
void invalidateObjRef ()
 
void invalidateObjRefIfNeededForCaught ()
 
void logException (const ::std::string &callString, const ::std::string &exString) const
 
void logSentCommand (const ::std::string &callString, const double mjd) const
 
void logSentCommand (const ::std::string &callString, const double mjd, const ::std::string &subDoName) const
 
void logSentCommandIfNeeded (const ::std::string &callString, const double mjd) const
 
void logSentCommandIfNeeded (const ::std::string &callString, const double mjd, const ::std::string &subDoName) const
 
void markObjRefValid ()
 
void processException (const ::std::string &callString, const ::CORBA::Exception &corbaException)
 
virtual bool resolveObjRef ()=0
 
void throwBadRemoteObjAccess () const
 
void throwIfObjRefIsNotValid () const
 

Detailed Description

Common base class for managing connections to DOs.

Definition at line 39 of file RemoteObjHandleT.h.

Constructor & Destructor Documentation

carma::control::RemoteObjHandleBase::RemoteObjHandleBase ( const ::std::string &  doName,
monitor::MonitorPointBool mpReachable,
const monitor::MonitorSubsystem subsystem,
monitor::MonitorSystem system,
bool  defaultLogIfNotReachable,
bool  defaultLogSentCommands 
)

Constructor.

Parameters
doNamename of the Direct Object that is the object of affection of this handle
mpReachablea 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.
subsystemThe 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).
systemA 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.
defaultLogIfNotReachableControls logging if the DO is not reachable.
defaultLogSentCommandscontrols logging of commands
virtual carma::control::RemoteObjHandleBase::~RemoteObjHandleBase ( )
virtual

Destructor.

Member Function Documentation

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.


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