RTC Toolkit  2.0.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
rtctk::rtcSupervisor::RtcSupervisor Class Reference

#include <rtcSupervisor.hpp>

Inheritance diagram for rtctk::rtcSupervisor::RtcSupervisor:
rtctk::componentFramework::Runnable< 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 ActivityRecovering (StopToken st) override
 
void ActivityInitialising (StopToken st) override
 
void ActivityEnabling (StopToken st) override
 
void ActivityDisabling (StopToken st) override
 
void ActivityGoingRunning (StopToken st) override
 
void ActivityGoingIdle (StopToken st) override
 
void ActivityRunning (StopToken st) override
 
void ActivityUpdating (StopToken st, Payload args) override
 
bool GuardUpdatingAllowed (Payload args) override
 
void InError (bool flag, const std::string why)
 

Protected Member Functions

std::mutex & GlobalMutex ()
 Ensure exclusion from monitor thread or other threads which may be sending commands Use with std::scoped_lock scoped_lock(BoostGlobalMutex);. More...
 
void MonitorCycle ()
 Perform one cycle of async monitoring of the components. More...
 
void OnStateEventReceived (const double timestamp, const std::string &name, const std::string &state)
 Called on State Event subscription. More...
 
void PublishGState ()
 
void PopulateRuntimeRepo ()
 Populates the Runtime Configuration Repository. More...
 
void LoadStaticConfig ()
 Config loaded from rtr. More...
 
void LoadDynamicConfig ()
 

Protected Attributes

std::mutex m_global_mutex
 
const std::string name
 identity More...
 
ServiceContainerservices
 access to services More...
 
RuntimeRepoIfrtr
 
ServiceDiscoverysvc
 
OldbIfoldb
 
RtcObjectConfig m_object_config
 The Object Config constructed from list of deployed objects. More...
 
std::shared_ptr< StateSubscriberm_state_subscriber
 
std::string m_disp_state
 currently evaluated global state etc More...
 
std::string m_gstate
 
std::string m_gsubstate
 
bool m_gerror
 
std::string m_gwho_is_in_error
 
RtcMonitor m_mon
 the monitor thread More...
 
bool m_init_alone
 
bool m_enable_alone
 
bool m_update_alone
 
bool m_disable_alone
 

Friends

class RtcMonitor
 

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

◆ ActivityDisabling()

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

◆ ActivityEnabling()

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

◆ ActivityGoingIdle()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityGoingIdle ( StopToken  st)
overridevirtual
Todo:
Guide the state (TBC)

Reimplemented from rtctk::componentFramework::Runnable< Super >::BizLogicIf.

◆ ActivityGoingRunning()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityGoingRunning ( StopToken  st)
overridevirtual
Todo:
Guide the state (TBC)

Reimplemented from rtctk::componentFramework::Runnable< Super >::BizLogicIf.

◆ ActivityInitialising()

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

◆ ActivityRecovering()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityRecovering ( StopToken  st)
overridevirtual
Todo:
Do something with Recovering, I guess traverse the list of objects identifying those in error and trying to recover them

Reimplemented from rtctk::componentFramework::Runnable< Super >::BizLogicIf.

◆ ActivityRunning()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityRunning ( StopToken  st)
overridevirtual
Todo:
Nothing to do (TBC)

Reimplemented from rtctk::componentFramework::Runnable< Super >::BizLogicIf.

◆ ActivityStarting()

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

◆ ActivityUpdating()

void rtctk::rtcSupervisor::RtcSupervisor::ActivityUpdating ( StopToken  st,
Payload  args 
)
override
Todo:
Nothing to do (TBC)

◆ GlobalMutex()

std::mutex & rtctk::rtcSupervisor::RtcSupervisor::GlobalMutex ( )
protected

Ensure exclusion from monitor thread or other threads which may be sending commands Use with std::scoped_lock scoped_lock(BoostGlobalMutex);.

◆ GuardUpdatingAllowed()

bool rtctk::rtcSupervisor::RtcSupervisor::GuardUpdatingAllowed ( Payload  args)
override
Todo:
Nothing to do (TBC)

◆ InError()

void rtctk::rtcSupervisor::RtcSupervisor::InError ( bool  flag,
const std::string  why 
)

◆ LoadDynamicConfig()

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

◆ LoadStaticConfig()

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

Config loaded from rtr.

◆ MonitorCycle()

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

Perform one cycle of async monitoring of the components.

Perform one cycle of object monitoring.

Lock using the global mutex 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 double  timestamp,
const std::string &  name,
const std::string &  state 
)
protected

Called on State Event subscription.

◆ PopulateRuntimeRepo()

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

Populates the Runtime Configuration Repository.

Loads the configuration datapoints for all SRTC components from the Persistent Configuration Repository into the Runtime Configuration Repository.

If the Persistent Configuration Repository is not available, i.e. the service discovery cannot provide a URI for it, then this initialisation step is skipped. One can also disable this step by setting the following boolean configuration parameter in the Persistent Configuration Repository to true: /common/disable_populate_runtime_repo

◆ PublishGState()

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

Friends And Related Function Documentation

◆ RtcMonitor

friend class RtcMonitor
friend

Member Data Documentation

◆ m_disable_alone

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

◆ m_disp_state

std::string rtctk::rtcSupervisor::RtcSupervisor::m_disp_state
protected

currently evaluated global state etc

◆ m_enable_alone

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

◆ m_gerror

bool rtctk::rtcSupervisor::RtcSupervisor::m_gerror
protected

◆ m_global_mutex

std::mutex rtctk::rtcSupervisor::RtcSupervisor::m_global_mutex
protected

◆ m_gstate

std::string rtctk::rtcSupervisor::RtcSupervisor::m_gstate
protected

◆ m_gsubstate

std::string rtctk::rtcSupervisor::RtcSupervisor::m_gsubstate
protected

◆ m_gwho_is_in_error

std::string rtctk::rtcSupervisor::RtcSupervisor::m_gwho_is_in_error
protected

◆ m_init_alone

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

◆ m_mon

RtcMonitor rtctk::rtcSupervisor::RtcSupervisor::m_mon
protected

the monitor thread

◆ m_object_config

RtcObjectConfig rtctk::rtcSupervisor::RtcSupervisor::m_object_config
protected

The Object Config constructed from list of deployed objects.

◆ m_state_subscriber

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

◆ m_update_alone

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

◆ name

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

identity

◆ oldb

OldbIf& rtctk::rtcSupervisor::RtcSupervisor::oldb
protected

◆ rtr

RuntimeRepoIf& rtctk::rtcSupervisor::RtcSupervisor::rtr
protected

◆ services

ServiceContainer& rtctk::rtcSupervisor::RtcSupervisor::services
protected

access to services

◆ svc

ServiceDiscovery& rtctk::rtcSupervisor::RtcSupervisor::svc
protected

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