ifw-sup  3.0.0-pre3
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sup::syssup::common::Subsys Struct Reference

#include <subsys.hpp>

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

Public Types

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

UpdateHandler m_signal
 notification signal. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sup::syssup::common::Factory< Subsys, const std::string, Config &, DataContext & >
static std::unique_ptr< SubsysCreate (const std::string &s, T &&... args)
 create subsystem object instance More...
 
- Public Attributes inherited from 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 sup::syssup::common::Subsys::UpdateHandler = boost::signals2::signal<void()>

Constructor & Destructor Documentation

◆ Subsys()

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

Subsys abstract class constructor.

◆ ~Subsys()

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

Default destructor.

Member Function Documentation

◆ CheckSubsysFailure()

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

Check if subsys is in failure state.

Exceptions
anexception if an error ocurrs.

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

◆ GetDataConnection()

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

Get actual connection as enumeration.

Returns

◆ GetDataConnectionStr()

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

Get actual connection as string.

Returns

◆ GetDataState()

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

Get actual state as a enumeration.

Returns

◆ GetDataStateStr()

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

Get actual state as string.

Returns

◆ GetDataSubstate()

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

Get actual subtate as a enumeration.

Returns

◆ GetDataSubstateStr()

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

Get actual subtate as string.

Returns

◆ GetPrefix()

void 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 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 sup::syssup::common::ISubsys.

◆ IsDisabling()

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

Check if subsys is disablig.

Returns
true if subsys is disabling, false otherwise

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

◆ IsNotReady()

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

Check if subsys is Standby/NotReady.

Returns
true is subsys is Standby/NotReady, false otherwise

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

◆ IsOperational()

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

Check if subsys is Operational.

Returns
true is subsys is Operational, false otherwise

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

◆ IsReady()

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

Check if subsys is Standby/Ready.

Returns
true is subsys is Standby/Ready, false otherwise

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

◆ SetDataConnection()

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

Set actual connection state.

Parameters
connection

◆ SetDataState()

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

Set actual subsystem state.

Parameters
statestate as string
Warning
strings are case sensitive

◆ SetDataSubstate()

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

Set actual subsystem substate.

Parameters
subtatesubtate as string
Warning
strings are case sensitive

◆ SetIgnore()

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

SetIgnore.

Parameters
flag

◆ StopIgn()

void 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 sup::syssup::common::ISubsys.

◆ Subscribe()

void 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 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 sup::syssup::common::ISubsys.

◆ SubsysEnable()

void 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 sup::syssup::common::ISubsys.

◆ SubsysInit()

void 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 sup::syssup::common::ISubsys.

◆ SubsysReset()

void 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 sup::syssup::common::ISubsys.

◆ UpdateDb()

void 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 sup::syssup::common::Subsys::m_signal
protected

notification signal.


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