RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rtctk::rtcSupervisor::RtcSupervisor Class Reference

#include <rtcSupervisor.hpp>

Inheritance diagram for rtctk::rtcSupervisor::RtcSupervisor:
rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf

Public Types

using ComponentType = Super
 

Public Member Functions

 RtcSupervisor (const std::string &comp_name, ServiceContainer &services)
 
virtual ~RtcSupervisor ()
 
void ActivityStarting (StopToken st) override
 
void ActivityInitialising (StopToken st) override
 
void ActivityEnabling (StopToken st) override
 
void ActivityDisabling (StopToken st) override
 
void ActivityUpdating (StopToken st, const JsonPayload &args) override
 
bool GuardUpdatingAllowed (const JsonPayload &args) override
 
void ActionClearAlerts () override
 
void ActivityRecovering (StopToken st) override
 Activity executed in its own thread that performs the error recovery.
 
std::string ActionGetStatus () override
 Action is used for system status inspection and is executed in the state machine thread.
 
JsonPayload ActionGetAvailableModes () override
 Action is used for mode inspection and executed in the state machine thread.
 
JsonPayload ActionGetActiveModes () override
 Action is used for mode inspection and executed in the state machine thread.
 
JsonPayload ActionGetDeferredModes () override
 Action is used for mode inspection and executed in the state machine thread.
 
void ActionSetDeferredModes (const JsonPayload &args) override
 Action is executed in the state machine thread and it performs deferred mode setting.
 
void ActivitySettingModes (StopToken st, const JsonPayload &args) override
 Activity executed in its own thread that performs the mode setting.
 
bool GuardSettingModesAllowed (const JsonPayload &args) override
 Determines if set mode is possible at this time with the provided argument.
 
void ActivityWritingBack (StopToken st, const JsonPayload &args) override
 Activity executed in its own thread that performs the writeback.
 
bool GuardWritingBackAllowed (const JsonPayload &args) override
 Determines if writeback is possible at this time with the provided argument.
 

Protected Member Functions

std::vector< std::unique_ptr< RtcObjectIf > > MakeRtcObjects ()
 Constructs RtcObjects, called during Initialisation.
 
std::vector< elt::mal::Uri > GetPubSubUris ()
 Gets Pub/Sub URIs of superivsord compoonents.
 
void MonitorCycle () noexcept
 Performs one cycle of async monitoring of the components.
 
void OnStateEventReceived (const taiclock::TaiClock::time_point, const std::string &name, const std::string &state) noexcept
 Called on State Event subscription.
 
void SetStatus (const std::string &status)
 Sets and publishes overall system status.
 
std::string GetStatus ()
 Returns the overall system status.
 
void LoadStaticConfig ()
 Retrievs static configuration from the Runtime Configuration Repository.
 
void LoadDynamicConfig ()
 Retrievs static configuration from the Runtime Configuration Repository.
 

Protected Attributes

log4cplus::Logger & m_logger
 
const std::string m_name
 
PersistentRepoIfm_psr
 
RuntimeRepoIfm_rtr
 
OldbIfm_oldb
 
ComponentMetricsIfm_metrics
 
AlertServiceIfm_alerts
 
ServiceDiscoverym_service_discovery
 
StatusPublisher m_status_publisher
 
PopulateConfig m_popcfg
 
AlertSource m_heartbeat_alert
 
AlertSource m_command_alert
 
AlertSource m_oldb_alert
 
std::vector< std::unique_ptr< RtcObjectIf > > m_objects
 
std::unique_ptr< RtcObjectControllerm_object_controller
 
DataPointPath m_dp_path_init_alone
 
DataPointPath m_dp_path_enable_alone
 
DataPointPath m_dp_path_disable_alone
 
DataPointPath m_dp_path_update_alone
 
DataPointPath m_dp_path_status
 
bool m_init_alone
 
bool m_enable_alone
 
bool m_disable_alone
 
bool m_update_alone
 
std::mutex m_status_mutex
 
std::string m_status
 
std::map< std::string, std::string > m_deferred_modes
 
std::unique_ptr< StatusEstimatorm_status_estimator
 
std::unique_ptr< RtcMonitorm_monitor_thread
 
std::unique_ptr< StateSubscriberm_state_subscriber
 
std::unique_ptr< AlertAggregatorm_alert_aggregator
 

Member Typedef Documentation

◆ ComponentType

Constructor & Destructor Documentation

◆ RtcSupervisor()

rtctk::rtcSupervisor::RtcSupervisor::RtcSupervisor ( const std::string & comp_name,
ServiceContainer & services )

◆ ~RtcSupervisor()

rtctk::rtcSupervisor::RtcSupervisor::~RtcSupervisor ( )
virtual

Member Function Documentation

◆ ActionClearAlerts()

void rtctk::rtcSupervisor::RtcSupervisor::ActionClearAlerts ( )
override

◆ ActionGetActiveModes()

JsonPayload rtctk::rtcSupervisor::RtcSupervisor::ActionGetActiveModes ( )
overridevirtual

Action is used for mode inspection and executed in the state machine thread.

Thread Safety
thread-safe – Method is invoked from unspecified thread and must be thread safe.
Exception Safety
basic – Method may throw an exception. The exception message will be returned to the requestor.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ ActionGetAvailableModes()

JsonPayload rtctk::rtcSupervisor::RtcSupervisor::ActionGetAvailableModes ( )
overridevirtual

Action is used for mode inspection and executed in the state machine thread.

Thread Safety
thread-safe – Method is invoked from unspecified thread and must be thread safe.
Exception Safety
basic – Method may throw an exception. The exception message will be returned to the requestor.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ ActionGetDeferredModes()

JsonPayload rtctk::rtcSupervisor::RtcSupervisor::ActionGetDeferredModes ( )
overridevirtual

Action is used for mode inspection and executed in the state machine thread.

Thread Safety
thread-safe – Method is invoked from unspecified thread and must be thread safe.
Exception Safety
basic – Method may throw an exception. The exception message will be returned to the requestor.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ ActionGetStatus()

std::string rtctk::rtcSupervisor::RtcSupervisor::ActionGetStatus ( )
overridevirtual

Action is used for system status inspection and is executed in the state machine thread.

Thread Safety
thread-safe – Method is invoked from unspecified thread and must be thread safe.
Exception Safety
basic – Method may throw an exception. The exception message will be returned to the requestor.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ ActionSetDeferredModes()

void rtctk::rtcSupervisor::RtcSupervisor::ActionSetDeferredModes ( const JsonPayload & arg)
overridevirtual

Action is executed in the state machine thread and it performs deferred mode setting.

Parameters
argProvides arguments for the mode setting to be performed.
Thread Safety
thread-safe – Method is invoked from unspecified thread and must be thread safe.
Exception Safety
basic – Method may throw an exception. The exception message will be returned to the requestor.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ ActivityDisabling()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityDisabling ( StopToken st)
override

◆ ActivityEnabling()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityEnabling ( StopToken st)
override

◆ ActivityInitialising()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityInitialising ( StopToken st)
override

◆ ActivityRecovering()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityRecovering ( StopToken st)
overridevirtual

Activity executed in its own thread that performs the error recovery.

Parameters
stIndicates when activity is requested to stop.
Thread Safety
thread-safe – Method is invoked from unspecified thread and must be thread safe.
Exception Safety
basic – Method may throw an exception. The exception message will be returned to the requestor.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ ActivitySettingModes()

void rtctk::rtcSupervisor::RtcSupervisor::ActivitySettingModes ( StopToken st,
const JsonPayload & arg )
overridevirtual

Activity executed in its own thread that performs the mode setting.

Parameters
stIndicates when activity is requested to stop.
argProvides arguments for the mode setting to be performed.
Thread Safety
thread-safe – Method is invoked from an unspecified thread and must be thread safe.
Exception Safety
basic – Method may throw an exception. The exception message will be returned to the requestor.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ ActivityStarting()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityStarting ( StopToken st)
override

◆ ActivityUpdating()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityUpdating ( StopToken st,
const JsonPayload & args )
override

◆ ActivityWritingBack()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityWritingBack ( StopToken st,
const JsonPayload & arg )
overridevirtual

Activity executed in its own thread that performs the writeback.

Parameters
stIndicates when activity is requested to stop.
argProvides arguments for the mode setting to be performed.
Thread Safety
thread-safe – Method is invoked from unspecified thread and must be thread safe.
Exception Safety
basic – Method may throw an exception. The exception message will be returned to the requestor.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ GetPubSubUris()

std::vector< elt::mal::Uri > rtctk::rtcSupervisor::RtcSupervisor::GetPubSubUris ( )
protected

Gets Pub/Sub URIs of superivsord compoonents.

◆ GetStatus()

std::string rtctk::rtcSupervisor::RtcSupervisor::GetStatus ( )
protected

Returns the overall system status.

◆ GuardSettingModesAllowed()

bool rtctk::rtcSupervisor::RtcSupervisor::GuardSettingModesAllowed ( const JsonPayload & arg)
overridevirtual

Determines if set mode is possible at this time with the provided argument.

Parameters
argProvided argument.
Returns
true if allowed.
false if disallowed. This results in the command being rejected.
Exception Safety
basic – Method may throw, which will result in SetModes request being rejected.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ GuardUpdatingAllowed()

bool rtctk::rtcSupervisor::RtcSupervisor::GuardUpdatingAllowed ( const JsonPayload & args)
override

◆ GuardWritingBackAllowed()

bool rtctk::rtcSupervisor::RtcSupervisor::GuardWritingBackAllowed ( const JsonPayload & arg)
overridevirtual

Determines if writeback is possible at this time with the provided argument.

Parameters
argProvided argument.
Returns
true if allowed.
false if disallowed. This results in the command being rejected.
Exception Safety
basic – Method may throw, which will result in WriteBack request being rejected.

Reimplemented from rtctk::rtcSupervisor::Supervisory< Super >::BizLogicIf.

◆ LoadDynamicConfig()

void rtctk::rtcSupervisor::RtcSupervisor::LoadDynamicConfig ( )
protected

Retrievs static configuration from the Runtime Configuration Repository.

◆ LoadStaticConfig()

void rtctk::rtcSupervisor::RtcSupervisor::LoadStaticConfig ( )
protected

Retrievs static configuration from the Runtime Configuration Repository.

◆ MakeRtcObjects()

std::vector< std::unique_ptr< RtcObjectIf > > rtctk::rtcSupervisor::RtcSupervisor::MakeRtcObjects ( )
protected

Constructs RtcObjects, called during Initialisation.

◆ MonitorCycle()

void rtctk::rtcSupervisor::RtcSupervisor::MonitorCycle ( )
protectednoexcept

Performs one cycle of async monitoring of the components.

Perform one cycle of object monitoring.

This method is periodically called from the RtcMonitor class.

Traverse the list of objects sending a request and setting an error flag if there is an error communicating

◆ OnStateEventReceived()

void rtctk::rtcSupervisor::RtcSupervisor::OnStateEventReceived ( const taiclock::TaiClock::time_point timestamp,
const std::string & name,
const std::string & state )
protectednoexcept

Called on State Event subscription.

This method is offloaded to the io_context in the RtcMonitor class.

◆ SetStatus()

void rtctk::rtcSupervisor::RtcSupervisor::SetStatus ( const std::string & status)
protected

Sets and publishes overall system status.

Member Data Documentation

◆ m_alert_aggregator

std::unique_ptr<AlertAggregator> rtctk::rtcSupervisor::RtcSupervisor::m_alert_aggregator
protected

◆ m_alerts

AlertServiceIf& rtctk::rtcSupervisor::RtcSupervisor::m_alerts
protected

◆ m_command_alert

AlertSource rtctk::rtcSupervisor::RtcSupervisor::m_command_alert
protected

◆ m_deferred_modes

std::map<std::string, std::string> rtctk::rtcSupervisor::RtcSupervisor::m_deferred_modes
protected

◆ m_disable_alone

bool rtctk::rtcSupervisor::RtcSupervisor::m_disable_alone
protected

◆ m_dp_path_disable_alone

DataPointPath rtctk::rtcSupervisor::RtcSupervisor::m_dp_path_disable_alone
protected

◆ m_dp_path_enable_alone

DataPointPath rtctk::rtcSupervisor::RtcSupervisor::m_dp_path_enable_alone
protected

◆ m_dp_path_init_alone

DataPointPath rtctk::rtcSupervisor::RtcSupervisor::m_dp_path_init_alone
protected

◆ m_dp_path_status

DataPointPath rtctk::rtcSupervisor::RtcSupervisor::m_dp_path_status
protected

◆ m_dp_path_update_alone

DataPointPath rtctk::rtcSupervisor::RtcSupervisor::m_dp_path_update_alone
protected

◆ m_enable_alone

bool rtctk::rtcSupervisor::RtcSupervisor::m_enable_alone
protected

◆ m_heartbeat_alert

AlertSource rtctk::rtcSupervisor::RtcSupervisor::m_heartbeat_alert
protected

◆ m_init_alone

bool rtctk::rtcSupervisor::RtcSupervisor::m_init_alone
protected

◆ m_logger

log4cplus::Logger& rtctk::rtcSupervisor::RtcSupervisor::m_logger
protected

◆ m_metrics

ComponentMetricsIf& rtctk::rtcSupervisor::RtcSupervisor::m_metrics
protected

◆ m_monitor_thread

std::unique_ptr<RtcMonitor> rtctk::rtcSupervisor::RtcSupervisor::m_monitor_thread
protected

◆ m_name

const std::string rtctk::rtcSupervisor::RtcSupervisor::m_name
protected

◆ m_object_controller

std::unique_ptr<RtcObjectController> rtctk::rtcSupervisor::RtcSupervisor::m_object_controller
protected

◆ m_objects

std::vector<std::unique_ptr<RtcObjectIf> > rtctk::rtcSupervisor::RtcSupervisor::m_objects
protected

◆ m_oldb

OldbIf& rtctk::rtcSupervisor::RtcSupervisor::m_oldb
protected

◆ m_oldb_alert

AlertSource rtctk::rtcSupervisor::RtcSupervisor::m_oldb_alert
protected

◆ m_popcfg

PopulateConfig rtctk::rtcSupervisor::RtcSupervisor::m_popcfg
protected

◆ m_psr

PersistentRepoIf& rtctk::rtcSupervisor::RtcSupervisor::m_psr
protected

◆ m_rtr

RuntimeRepoIf& rtctk::rtcSupervisor::RtcSupervisor::m_rtr
protected

◆ m_service_discovery

ServiceDiscovery& rtctk::rtcSupervisor::RtcSupervisor::m_service_discovery
protected

◆ m_state_subscriber

std::unique_ptr<StateSubscriber> rtctk::rtcSupervisor::RtcSupervisor::m_state_subscriber
protected

◆ m_status

std::string rtctk::rtcSupervisor::RtcSupervisor::m_status
protected

◆ m_status_estimator

std::unique_ptr<StatusEstimator> rtctk::rtcSupervisor::RtcSupervisor::m_status_estimator
protected

◆ m_status_mutex

std::mutex rtctk::rtcSupervisor::RtcSupervisor::m_status_mutex
protected

◆ m_status_publisher

StatusPublisher rtctk::rtcSupervisor::RtcSupervisor::m_status_publisher
protected

◆ m_update_alone

bool rtctk::rtcSupervisor::RtcSupervisor::m_update_alone
protected

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