ifw-ccf 5.0.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
ifw::ccf::common::Setup Class Reference

Global setup class for CCF applications. An Initialisation Setup, containing all the parameters shall be loaded before using the class. More...

#include <setup.hpp>

Inheritance diagram for ifw::ccf::common::Setup:
ifw::ccf::Base

Public Member Functions

 Setup ()
 
 ~Setup ()
 
elt::configng::CiiConfigInstanceNode & GetStagingNode (const std::vector< std::string > &names)
 Get the reference to a specific node in the Installed Setup.
 
elt::configng::CiiConfigInstanceNode & GetNode (const elt::configng::CiiConfigDocument *doc, const std::vector< std::string > &names)
 Get the reference to a specific node in the referenced CII Cfg Service doc object.
 
const std::string & GetRootNodeName () const
 Return the name of the setup document root node name.
 
template<class TYPE >
bool HasCurrentPar (const std::vector< std::string > &names, TYPE &value)
 Probe if a given parameter has been processed and accepted already.
 
template<class TYPE >
bool HasPar (const std::vector< std::string > &names, TYPE &value)
 
bool ParDefined (const std::string &name)
 Check if the given parameter is defined in the Reference Setup.
 
template<class TYPE >
bool HasStagingPar (const std::vector< std::string > &names, TYPE &value)
 
template<class TYPE >
bool HasStagingParKey (const std::string &name, TYPE &value)
 
void ResetStagingSetup ()
 Reset the internal Staging Setup.
 
template<class TYPE >
void AddStagingPar (const std::string &name, const TYPE value)
 
std::vector< std::string > GetSetupCmdStagingPars ()
 Return list of Staging Setup Pars, normally provided via a Setup Command.
 
void GetPars (std::map< std::string, std::string > &pars, const std::string &pattern="*")
 Return map with all parameters in the object. Staging pars take precedence.
 
template<class TYPE >
TYPE GetCurrentValue (const std::string &name)
 
template<class TYPE >
TYPE GetCurrentValue (const std::vector< std::string > &names)
 Get value from the Installed Setup.
 
template<class TYPE >
TYPE GetValue (const std::vector< std::string > &names)
 Get value from either the 1) Staging Setup, or 2) Installed Setup.
 
template<class TYPE >
TYPE GetValueKey (const std::string &name)
 Get value from either the 1) Staging Setup, or 2) Installed Setup from the SPF key.
 
void LoadStagingSetup (const std::string &filename)
 Load a Setup File into the Staging Setup object.
 
void AcceptStagingSetup ()
 Merge the parameters in the Staging Setup into the Installed Setup set of parameters.
 
std::string StagingSetupToString () const
 Return string representation of the Staging Setup loaded.
 
std::string SetupToString () const
 Return string representation of the Setup loaded.
 
std::vector< std::string > CheckNodeNames (const std::vector< std::string > &names) const
 
std::string CheckNodeName (const std::string &name) const
 
const elt::configng::CiiConfigDocument & GetRefSetup () const
 
- Public Member Functions inherited from ifw::ccf::Base
 Base ()
 
 ~Base ()
 
const std::string & GetClassName () const
 Return the allocated name of the class.
 

Static Public Member Functions

static SetupInstance ()
 Return reference to unique instance of the application class.
 
- Static Public Member Functions inherited from ifw::ccf::Base
static ifw::ccf::mptk::ManagerMptk ()
 Return reference to internal MPTK instance (singleton).
 

Static Public Attributes

static Setups_instance = nullptr
 Singleton instance.
 

Protected Member Functions

void StoreStagingPar (const std::string &name, const std::string &value)
 
- Protected Member Functions inherited from ifw::ccf::Base
void SetClassName (const std::string &class_name)
 Set the name of the class in question.
 

Detailed Description

Global setup class for CCF applications. An Initialisation Setup, containing all the parameters shall be loaded before using the class.

Constructor & Destructor Documentation

◆ Setup()

ifw::ccf::common::Setup::Setup ( )

◆ ~Setup()

ifw::ccf::common::Setup::~Setup ( )

Member Function Documentation

◆ AcceptStagingSetup()

void ifw::ccf::common::Setup::AcceptStagingSetup ( )

Merge the parameters in the Staging Setup into the Installed Setup set of parameters.

◆ AddStagingPar()

template<class TYPE >
void ifw::ccf::common::Setup::AddStagingPar ( const std::string & name,
const TYPE value )
inline

Add a Staging Setup Parameter in the object given on SPF format ("<key el 1>.<key el 2>. ...").

◆ CheckNodeName()

std::string ifw::ccf::common::Setup::CheckNodeName ( const std::string & name) const

◆ CheckNodeNames()

std::vector< std::string > ifw::ccf::common::Setup::CheckNodeNames ( const std::vector< std::string > & names) const

◆ GetCurrentValue() [1/2]

template<class TYPE >
TYPE ifw::ccf::common::Setup::GetCurrentValue ( const std::string & name)
inline

◆ GetCurrentValue() [2/2]

template<class TYPE >
TYPE ifw::ccf::common::Setup::GetCurrentValue ( const std::vector< std::string > & names)
inline

Get value from the Installed Setup.

◆ GetNode()

elt::configng::CiiConfigInstanceNode & ifw::ccf::common::Setup::GetNode ( const elt::configng::CiiConfigDocument * doc,
const std::vector< std::string > & names )

Get the reference to a specific node in the referenced CII Cfg Service doc object.

◆ GetPars()

void ifw::ccf::common::Setup::GetPars ( std::map< std::string, std::string > & pars,
const std::string & pattern = "*" )

Return map with all parameters in the object. Staging pars take precedence.

◆ GetRefSetup()

const elt::configng::CiiConfigDocument & ifw::ccf::common::Setup::GetRefSetup ( ) const

◆ GetRootNodeName()

const std::string & ifw::ccf::common::Setup::GetRootNodeName ( ) const

Return the name of the setup document root node name.

◆ GetSetupCmdStagingPars()

std::vector< std::string > ifw::ccf::common::Setup::GetSetupCmdStagingPars ( )

Return list of Staging Setup Pars, normally provided via a Setup Command.

◆ GetStagingNode()

elt::configng::CiiConfigInstanceNode & ifw::ccf::common::Setup::GetStagingNode ( const std::vector< std::string > & names)

Get the reference to a specific node in the Installed Setup.

Get the reference to a specific node in the Staging Setup.

◆ GetValue()

template<class TYPE >
TYPE ifw::ccf::common::Setup::GetValue ( const std::vector< std::string > & names)
inline

Get value from either the 1) Staging Setup, or 2) Installed Setup.

◆ GetValueKey()

template<class TYPE >
TYPE ifw::ccf::common::Setup::GetValueKey ( const std::string & name)
inline

Get value from either the 1) Staging Setup, or 2) Installed Setup from the SPF key.

◆ HasCurrentPar()

template<class TYPE >
bool ifw::ccf::common::Setup::HasCurrentPar ( const std::vector< std::string > & names,
TYPE & value )
inline

Probe if a given parameter has been processed and accepted already.

◆ HasPar()

template<class TYPE >
bool ifw::ccf::common::Setup::HasPar ( const std::vector< std::string > & names,
TYPE & value )
inline

Probe if a given parameter is defined in the set. Return true if yes and set the value to the value of the parameter.

◆ HasStagingPar()

template<class TYPE >
bool ifw::ccf::common::Setup::HasStagingPar ( const std::vector< std::string > & names,
TYPE & value )
inline

Probe if a given parameter is defined among the Setup Staging Parameters. Return true if yes and set the value to the value of the parameter.

◆ HasStagingParKey()

template<class TYPE >
bool ifw::ccf::common::Setup::HasStagingParKey ( const std::string & name,
TYPE & value )
inline

Probe if a given parameter is defined among the Setup Staging Parameters. Return true if yes and set the value to the value of the parameter.

◆ Instance()

Setup & ifw::ccf::common::Setup::Instance ( )
static

Return reference to unique instance of the application class.

◆ LoadStagingSetup()

void ifw::ccf::common::Setup::LoadStagingSetup ( const std::string & filename)

Load a Setup File into the Staging Setup object.

◆ ParDefined()

bool ifw::ccf::common::Setup::ParDefined ( const std::string & name)

Check if the given parameter is defined in the Reference Setup.

Returns
True if parameter is defined.

◆ ResetStagingSetup()

void ifw::ccf::common::Setup::ResetStagingSetup ( )

Reset the internal Staging Setup.

◆ SetupToString()

std::string ifw::ccf::common::Setup::SetupToString ( ) const

Return string representation of the Setup loaded.

◆ StagingSetupToString()

std::string ifw::ccf::common::Setup::StagingSetupToString ( ) const

Return string representation of the Staging Setup loaded.

◆ StoreStagingPar()

void ifw::ccf::common::Setup::StoreStagingPar ( const std::string & name,
const std::string & value )
protected

Member Data Documentation

◆ s_instance

Setup * ifw::ccf::common::Setup::s_instance = nullptr
static

Singleton instance.


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