rad 6.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rad::ActionsApp Class Reference

#include <actionsApp.hpp>

Inheritance diagram for rad::ActionsApp:
rad::ConfigurableActionGroup rad::ActionGroup

Public Member Functions

 ActionsApp (Application &appl, ConfigurableActionMgr &action_mgr, DataContext &data)
 
virtual ~ActionsApp ()
 
void Initialize () override
 
void Configure (const std::vector< std::string > &keys) override
 
virtual void ExitNoReply (scxml4cpp::Context *c)
 
virtual void Redeploy (scxml4cpp::Context *c)
 
virtual void GetConfig (scxml4cpp::Context *c)
 
virtual void SetConfig (scxml4cpp::Context *c)
 
virtual void LoadConfig (scxml4cpp::Context *c)
 
virtual void SaveConfig (scxml4cpp::Context *c)
 
virtual void TrsHealth (scxml4cpp::Context *c)
 
virtual void GetTrsHealth (scxml4cpp::Context *c)
 
void EnableTrsHealth (const bool enable)
 
virtual void GetStateMachine (scxml4cpp::Context *c)
 
virtual void SaveStateMachine (scxml4cpp::Context *c)
 
 ActionsApp (const ActionsApp &)=delete
 
ActionsAppoperator= (const ActionsApp &)=delete
 Disable copy constructor.
 
- Public Member Functions inherited from rad::ConfigurableActionGroup
 ConfigurableActionGroup (const std::string &id)
 
virtual ~ConfigurableActionGroup ()
 
 ConfigurableActionGroup (const ConfigurableActionGroup &)=delete
 
ConfigurableActionGroupoperator= (const ConfigurableActionGroup &)=delete
 Disable copy constructor.
 
- Public Member Functions inherited from rad::ActionGroup
 ActionGroup (const std::string &id)
 
virtual ~ActionGroup ()
 
const std::string & GetId () const
 
void SetId (const std::string &id)
 
 ActionGroup (const ActionGroup &)=delete
 
ActionGroupoperator= (const ActionGroup &)=delete
 Disable copy constructor.
 

Detailed Description

This class contains the implementation of the actions dealing with:

Constructor & Destructor Documentation

◆ ActionsApp() [1/2]

rad::ActionsApp::ActionsApp ( Application & appl,
ConfigurableActionMgr & action_mgr,
DataContext & data )

Constructor.

Parameters
applReference to the Application used to inject internal events.
action_mgrReference to the ActionMgr used to trigger the re-initialize notification to all ActionGroup and Activity objects when processing the Init request.
dataData shared within the application among actions and activities.

◆ ~ActionsApp()

rad::ActionsApp::~ActionsApp ( )
virtual

◆ ActionsApp() [2/2]

rad::ActionsApp::ActionsApp ( const ActionsApp & )
delete

Member Function Documentation

◆ Configure()

void rad::ActionsApp::Configure ( const std::vector< std::string > & keys)
overridevirtual

Method invoked when SetConfig or LoadConfig command is received to re-configure this class attributes.

Parameters
keysModified parameters.

Implements rad::ConfigurableActionGroup.

◆ EnableTrsHealth()

void rad::ActionsApp::EnableTrsHealth ( const bool enable)

This method allows to enable/disable the periodic TRS Health check. If enabled, then RAD will forward TRS health events to the SM (as "TrsEvents.HealthBad", "TrsEvents.HealthGood").

It also writes the enable/disable flag to the OLDB, along with an explanation. If needed, it also updates the TRS state in the DataContext, which is a combination of enabled/disabled and actual status.

Parameters
enableTrue to enable the TRS Health, false to disable.

◆ ExitNoReply()

void rad::ActionsApp::ExitNoReply ( scxml4cpp::Context * c)
virtual

Implementation of the ExitNoReply action. This action:

  • stops the event loop forcing the application to quit.
Parameters
[in]cContext containing the last event received by the State Machine.

◆ GetConfig()

void rad::ActionsApp::GetConfig ( scxml4cpp::Context * c)
virtual

Implementation of the GetConfig action. This action:

  • retrieves the value(s) of the given configuration parameter(s) identified via the key(s).
  • replies back to the originator of the GetConfig request with the retrieved values. If no key is provided, the complete application configuration is returned.
Parameters
[in]cContext containing the last event received by the State Machine.

◆ GetStateMachine()

void rad::ActionsApp::GetStateMachine ( scxml4cpp::Context * c)
virtual

Implementation of the GetStateMachine action. This action returns the State Machine model in text format.

Parameters
[in]cContext containing the last event received by the State Machine.

◆ GetTrsHealth()

void rad::ActionsApp::GetTrsHealth ( scxml4cpp::Context * c)
virtual

Implementation of the GetTrsHealth action. This action returns the health of the TRS.

Parameters
[in]cContext containing the last event received by the State Machine.

◆ Initialize()

void rad::ActionsApp::Initialize ( )
overridevirtual

Method invoked when Init command is received to re-initialize this class attributes.

Implements rad::ConfigurableActionGroup.

◆ LoadConfig()

void rad::ActionsApp::LoadConfig ( scxml4cpp::Context * c)
virtual

Implementation of the LoadConfig action. This action:

  • load the given configuration file
  • updates the OLDB
  • replies to the originator of the LoadConfig request.

The reloading of the configuration should be allowed only in NotOperational::NotReady and will therefore require the re-initialization of application via the stdif::Init command which in turn will trigger the Initialize() notification for all Actions and Activities. In the Initialize(), Actions and Activities should assume that all parameters may have changed.

If the LoadConfig fails, the new configuration is not merged with the new configuration.

Parameters
[in]cContext containing the last event received by the State Machine.

◆ operator=()

ActionsApp & rad::ActionsApp::operator= ( const ActionsApp & )
delete

Disable copy constructor.

◆ Redeploy()

void rad::ActionsApp::Redeploy ( scxml4cpp::Context * c)
virtual

Implementation of the Redeploy action. This action:

  • query the changes in the deployment
  • updates the config in the OLDB
  • trigger the re-configuration notification to the others ActionGroup and Activities.
Parameters
[in]cContext containing the last event received by the State Machine.

◆ SaveConfig()

void rad::ActionsApp::SaveConfig ( scxml4cpp::Context * c)
virtual

Implementation of the SaveConfig action. This action saves to file the currently loaded configution parameters.

Parameters
[in]cContext containing the last event received by the State Machine.

◆ SaveStateMachine()

void rad::ActionsApp::SaveStateMachine ( scxml4cpp::Context * c)
virtual

Implementation of the SaveStateMachine action. This action saves the State Machine model in text format to file.

Parameters
[in]cContext containing the last event received by the State Machine.

◆ SetConfig()

void rad::ActionsApp::SetConfig ( scxml4cpp::Context * c)
virtual

Implementation of the SetConfig action. This action:

  • validates the new configuration parameter(s)
  • merges the new configuration parameter(s) with the application configuration
  • notifies Actions and Activities of the new configuration
  • replies back to the originator of the SetConfig request.

If the validation step fails, command is aborted and the configuration is not changed.

Parameters
[in]cContext containing the last event received by the State Machine.

◆ TrsHealth()

void rad::ActionsApp::TrsHealth ( scxml4cpp::Context * c)
virtual

Implementation of the TrsHealth action. This action logs a warning indicating that the Time Reference Signal is not healthy or not available if the TrsBad event is received. Instead, if the TrsOk event is received after a TrsBad, it logs an INFO indicating that TRS is back to normal. TRS health status is also published to the OLDB.

Parameters
[in]cContext containing the last event received by the State Machine.

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