ifw-sup 5.1.0
 
Loading...
Searching...
No Matches
ifw::sup::syssup::common::Subsys Struct Reference

#include <subsys.hpp>

Inheritance diagram for ifw::sup::syssup::common::Subsys:
ifw::sup::syssup::common::Factory< Subsys, const std::string, Config &, DataContext & > ifw::sup::syssup::common::ISubsys

Public Types

using UpdateHandler = boost::signals2::signal<void()>
 

Public Member Functions

 Subsys (Key)
 Subsys abstract class constructor.
 
virtual ~Subsys ()
 Default destructor.
 
virtual bool IsNotReady () const
 Check if subsys is Standby/NotReady.
 
virtual bool IsReady () const
 Check if subsys is Standby/Ready.
 
virtual bool IsOperational () const
 Check if subsys is Operational.
 
virtual void CheckSubsysFailure () const
 Check if subsys is in failure state.
 
virtual bool IsDisabling () const
 Check if subsys is disablig.
 
virtual void Ignore (rad::AnyEvent const &last_event)
 Executes a Ignore.
 
virtual void StopIgn (rad::AnyEvent const &last_event)
 Executes a StopIgn.
 
virtual void SubsysReset (rad::AnyEvent const &last_event)
 Executes a hardware reset command.
 
virtual void SubsysInit (rad::AnyEvent const &last_event)
 Executes a hardware init command.
 
virtual void SubsysEnable (rad::AnyEvent const &last_event)
 Executes a hardware enable command.
 
virtual void SubsysDisable (rad::AnyEvent const &last_event)
 Executes a hardware disable command.
 
void Subscribe (UpdateHandler::slot_type handler)
 Implements a notification for updates in the subsystem status.
 
void SetDataState (const std::string state)
 Set actual subsystem state.
 
std::string GetDataStateStr () const
 Get actual state as string.
 
State::StateEnum GetDataState () const
 Get actual state as a enumeration.
 
void SetDataSubstate (const std::string subtate)
 Set actual subsystem substate.
 
std::string GetDataSubstateStr () const
 Get actual subtate as string.
 
State::SubstateEnum GetDataSubstate () const
 Get actual subtate as a enumeration.
 
void SetDataConnection (const SubsysData::ConnectionEnum connection)
 Set actual connection state.
 
std::string GetDataConnectionStr () const
 Get actual connection as string.
 
SubsysData::ConnectionEnum GetDataConnection () const
 Get actual connection as enumeration.
 
- Public Member Functions inherited from ifw::sup::syssup::common::ISubsys
virtual std::optional< elt::mal::future< void > > Connect ()=0
 
virtual void Close ()=0
 
virtual void StartSubscription ()=0
 
virtual void StopSubscription ()=0
 
virtual elt::mal::future< std::string > Init ()=0
 Executes a Init command.
 
virtual elt::mal::future< std::string > Enable ()=0
 Executes a Enable command.
 
virtual elt::mal::future< std::string > Disable ()=0
 Executes a Disable command.
 
virtual elt::mal::future< std::string > Stop ()=0
 Executes a Stop command.
 
virtual elt::mal::future< std::string > GetState ()=0
 
virtual elt::mal::future< std::string > GetStatus ()=0
 
virtual elt::mal::future< std::string > GetVersion ()=0
 
virtual elt::mal::future< std::string > Reset ()=0
 Executes a Reset command.
 
virtual void Status (const std::string &payload, std::string &buffer)=0
 Obtain the status of the subsys.
 
virtual void Setup (const std::any &payload)=0
 Executes a run time configuration.
 
virtual void UpdateConfig ()=0
 Update subsystem configuration.
 
virtual std::string GetName () const =0
 Get subsys name.
 

Protected Member Functions

void UpdateDb (std::vector< std::string > attr_vector)
 Update subsys database.
 
void SetIgnore (bool flag)
 SetIgnore.
 
void GetPrefix (const std::vector< std::string > prefix_list, std::string &prefix)
 Get prefix for writing attributes to the DB.
 

Protected Attributes

UpdateHandler m_signal
 notification signal.
 

Additional Inherited Members

- Static Public Member Functions inherited from ifw::sup::syssup::common::Factory< Subsys, const std::string, Config &, DataContext & >
static std::unique_ptr< Subsys > Create (const std::string &s, T &&... args)
 create subsystem object instance
 
- Public Attributes inherited from ifw::sup::syssup::common::Factory< Subsys, const std::string, Config &, DataContext & >
friend Base
 

Detailed Description

Subsystem base class. This class represents the basic implementation of a subsystem class. Most of the subsystems share common properties and behavioural aspects. This class is implementing the common behaviour and defining the basic properties of all subsystems classes.

Member Typedef Documentation

◆ UpdateHandler

using ifw::sup::syssup::common::Subsys::UpdateHandler = boost::signals2::signal<void()>

Constructor & Destructor Documentation

◆ Subsys()

ifw::sup::syssup::common::Subsys::Subsys ( Key )

Subsys abstract class constructor.

◆ ~Subsys()

ifw::sup::syssup::common::Subsys::~Subsys ( )
virtual

Default destructor.

Member Function Documentation

◆ CheckSubsysFailure()

void ifw::sup::syssup::common::Subsys::CheckSubsysFailure ( ) const
virtual

Check if subsys is in failure state.

Exceptions
anexception if an error ocurrs.

Implements ifw::sup::syssup::common::ISubsys.

◆ GetDataConnection()

SubsysData::ConnectionEnum ifw::sup::syssup::common::Subsys::GetDataConnection ( ) const

Get actual connection as enumeration.

Returns

◆ GetDataConnectionStr()

std::string ifw::sup::syssup::common::Subsys::GetDataConnectionStr ( ) const

Get actual connection as string.

Returns

◆ GetDataState()

State::StateEnum ifw::sup::syssup::common::Subsys::GetDataState ( ) const

Get actual state as a enumeration.

Returns

◆ GetDataStateStr()

std::string ifw::sup::syssup::common::Subsys::GetDataStateStr ( ) const

Get actual state as string.

Returns

◆ GetDataSubstate()

State::SubstateEnum ifw::sup::syssup::common::Subsys::GetDataSubstate ( ) const

Get actual subtate as a enumeration.

Returns

◆ GetDataSubstateStr()

std::string ifw::sup::syssup::common::Subsys::GetDataSubstateStr ( ) const

Get actual subtate as string.

Returns

◆ GetPrefix()

void ifw::sup::syssup::common::Subsys::GetPrefix ( const std::vector< std::string > prefix_list,
std::string & prefix )
protected

Get prefix for writing attributes to the DB.

Parameters
prefix_listList of intermediate prefix values.
prefixString containing the formatted prefix.

◆ Ignore()

void ifw::sup::syssup::common::Subsys::Ignore ( rad::AnyEvent const & last_event)
virtual

Executes a Ignore.

Parameters
[in]last_eventcontains the payload of the Ignore message.
Exceptions
anexception if an error ocurrs.

Implements ifw::sup::syssup::common::ISubsys.

◆ IsDisabling()

bool ifw::sup::syssup::common::Subsys::IsDisabling ( ) const
virtual

Check if subsys is disablig.

Returns
true if subsys is disabling, false otherwise

Implements ifw::sup::syssup::common::ISubsys.

◆ IsNotReady()

bool ifw::sup::syssup::common::Subsys::IsNotReady ( ) const
virtual

Check if subsys is Standby/NotReady.

Returns
true is subsys is Standby/NotReady, false otherwise

Implements ifw::sup::syssup::common::ISubsys.

◆ IsOperational()

bool ifw::sup::syssup::common::Subsys::IsOperational ( ) const
virtual

Check if subsys is Operational.

Returns
true is subsys is Operational, false otherwise

Implements ifw::sup::syssup::common::ISubsys.

◆ IsReady()

bool ifw::sup::syssup::common::Subsys::IsReady ( ) const
virtual

Check if subsys is Standby/Ready.

Returns
true is subsys is Standby/Ready, false otherwise

Implements ifw::sup::syssup::common::ISubsys.

◆ SetDataConnection()

void ifw::sup::syssup::common::Subsys::SetDataConnection ( const SubsysData::ConnectionEnum connection)

Set actual connection state.

Parameters
connection

◆ SetDataState()

void ifw::sup::syssup::common::Subsys::SetDataState ( const std::string state)

Set actual subsystem state.

Parameters
statestate as string
Warning
strings are case sensitive

◆ SetDataSubstate()

void ifw::sup::syssup::common::Subsys::SetDataSubstate ( const std::string subtate)

Set actual subsystem substate.

Parameters
subtatesubtate as string
Warning
strings are case sensitive

◆ SetIgnore()

void ifw::sup::syssup::common::Subsys::SetIgnore ( bool flag)
protected

SetIgnore.

Parameters
flag

◆ StopIgn()

void ifw::sup::syssup::common::Subsys::StopIgn ( rad::AnyEvent const & last_event)
virtual

Executes a StopIgn.

Parameters
[in]last_eventcontains the payload of the StopIgn message.
Exceptions
anexception if an error ocurrs.

Implements ifw::sup::syssup::common::ISubsys.

◆ Subscribe()

void ifw::sup::syssup::common::Subsys::Subscribe ( UpdateHandler::slot_type handler)

Implements a notification for updates in the subsystem status.

Parameters
handlermethod/function to called by the update.

◆ SubsysDisable()

void ifw::sup::syssup::common::Subsys::SubsysDisable ( rad::AnyEvent const & last_event)
virtual

Executes a hardware disable command.

Parameters
[in]last_eventpayload of the hw disable message
Exceptions
anexception if an error ocurrs.

Implements ifw::sup::syssup::common::ISubsys.

◆ SubsysEnable()

void ifw::sup::syssup::common::Subsys::SubsysEnable ( rad::AnyEvent const & last_event)
virtual

Executes a hardware enable command.

Parameters
[in]last_eventpayload of the hw enable message
Exceptions
anexception if an error ocurrs.

Implements ifw::sup::syssup::common::ISubsys.

◆ SubsysInit()

void ifw::sup::syssup::common::Subsys::SubsysInit ( rad::AnyEvent const & last_event)
virtual

Executes a hardware init command.

Parameters
[in]last_eventpayload of the hw init message
Exceptions
anexception if an error ocurrs.

Implements ifw::sup::syssup::common::ISubsys.

◆ SubsysReset()

void ifw::sup::syssup::common::Subsys::SubsysReset ( rad::AnyEvent const & last_event)
virtual

Executes a hardware reset command.

Parameters
[in]last_eventpayload of the hw reset message
Exceptions
anexception if an error ocurrs.

Implements ifw::sup::syssup::common::ISubsys.

◆ UpdateDb()

void ifw::sup::syssup::common::Subsys::UpdateDb ( std::vector< std::string > attr_vector)
protected

Update subsys database.

Parameters
attr_vectorList of attributes with their values.

Member Data Documentation

◆ m_signal

UpdateHandler ifw::sup::syssup::common::Subsys::m_signal
protected

notification signal.


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