ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
fcf::devmgr::common::Config Class Reference

#include <config.hpp>

Inheritance diagram for fcf::devmgr::common::Config:
fcf::devmgr::common::IConfig

Public Member Functions

 Config ()
 
virtual ~Config ()
 
bool ParseOptions (int argc, char *argv[])
 
void LoadConfig (const std::string &filename="")
 
const std::string GetServerId () const
 
const std::string GetMsgReplierEndpoint () const
 
const std::string GetDbEndpoint () const
 
const std::string GetPubEndpoint () const
 
const timeval GetDbTimeout () const
 
const std::string GetSmScxmlFilename () const
 
const std::string GetConfigFilename () const
 
const std::string GetProcName () const
 
const std::string GetLogLevel () const
 
const int GetNumDevices ()
 GetNumDevices. More...
 
const std::string GetFitsPrefix () const
 Get FITS prefix. More...
 
const std::string GetDeviceName (const int &device_index)
 GetDeviceName. More...
 
const std::string GetDeviceFile (const std::string &name)
 GetDeviceFile. More...
 
const std::string GetDeviceType (const std::string &name)
 GetDeviceType. More...
 
virtual dit::did::Did & GetDid ()
 
virtual void GetConfigList (std::vector< std::string > &cfg_list)
 Get configuration list. More...
 
const unsigned int GetCmdTout ()
 GetCmdTout. More...
 
void SetCmdTout (const unsigned int cmd_tout)
 SetCmdTout. More...
 
 Config (const Config &)=delete
 
Configoperator= (const Config &)=delete
 Disable copy constructor. More...
 

Detailed Description

This class provide access to the command line options and the configuration parameters stored in the configuration file.

Constructor & Destructor Documentation

fcf::devmgr::common::Config::Config ( )

Default constructor.

Initialize application configuration attributes by

  • first use the default constant values defined in the header
  • override the constant values with environment variables (if defined)
fcf::devmgr::common::Config::~Config ( )
virtual

Default destructor.

fcf::devmgr::common::Config::Config ( const Config )
delete

Member Function Documentation

const unsigned int fcf::devmgr::common::Config::GetCmdTout ( )
virtual

GetCmdTout.

Returns

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetConfigFilename ( ) const
virtual
Returns
The application configuration filename.

Implements fcf::devmgr::common::IConfig.

void fcf::devmgr::common::Config::GetConfigList ( std::vector< std::string > &  cfg_list)
virtual

Get configuration list.

Parameters
cfg_listList of all configuration parameters.

This method returs the complete of configuration parameters handled by this class. This method is used to dump the list into the DB.

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetDbEndpoint ( ) const
virtual
Returns
The IP address and port used to connect to the runtime DB.

Implements fcf::devmgr::common::IConfig.

const timeval fcf::devmgr::common::Config::GetDbTimeout ( ) const
virtual
Returns
The timeout used when communicating to the runtime DB.

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetDeviceFile ( const std::string &  name)
virtual

GetDeviceFile.

Parameters
name
Returns

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetDeviceName ( const int &  device_index)
virtual

GetDeviceName.

Parameters
device_index
Returns

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetDeviceType ( const std::string &  name)
virtual

GetDeviceType.

Parameters
name
Returns

Implements fcf::devmgr::common::IConfig.

dit::did::Did & fcf::devmgr::common::Config::GetDid ( )
virtual
Returns
A reference to the Did interface object.

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetFitsPrefix ( ) const
virtual

Get FITS prefix.

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetLogLevel ( ) const
virtual
Returns
The configured log level.

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetMsgReplierEndpoint ( ) const
virtual
Returns
The network endpoint to send request to this application. The format is "\<protocol\>://\<ipaddr\>:\<port\>" where <protocol> is 'tcp' For example: "tcp://127.0.0.1:5577"

Implements fcf::devmgr::common::IConfig.

const int fcf::devmgr::common::Config::GetNumDevices ( )
virtual

GetNumDevices.

Returns

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetProcName ( ) const
virtual
Returns
The application process name.

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetPubEndpoint ( ) const
virtual
Returns
The network endpoint to publish internally within the application. The format is the CII URI For example: "zpb.rr://127.0.0.1:12081/StdCmds"

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetServerId ( ) const
virtual
Returns
return the server identifier

Implements fcf::devmgr::common::IConfig.

const std::string fcf::devmgr::common::Config::GetSmScxmlFilename ( ) const
virtual
Returns
The SCXML State Machine model filename used by the application.

Implements fcf::devmgr::common::IConfig.

void fcf::devmgr::common::Config::LoadConfig ( const std::string &  filename = "")
virtual

This method load from a configuration file the application configuration overriding the initialization done in the constructor and the command line options.

Parameters
[in]filenameApplication configuration filename.

Implements fcf::devmgr::common::IConfig.

Config& fcf::devmgr::common::Config::operator= ( const Config )
delete

Disable copy constructor.

bool fcf::devmgr::common::Config::ParseOptions ( int  argc,
char *  argv[] 
)
virtual

This method parses the command line parameters overriding the initialization done in the constructor.

Parameters
[in]argcNumber of command line options.
[in]argvPointer to the array of command line options.
Returns
false if the help option has been invoked, true otherwise.

Implements fcf::devmgr::common::IConfig.

void fcf::devmgr::common::Config::SetCmdTout ( const unsigned int  cmd_tout)

SetCmdTout.

Parameters
cmd_toutnew command timeout

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