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

#include <config.hpp>

Inheritance diagram for ifw::ccf::common::Config:
ifw::ccf::Base ifw::ccf::control::Config

Public Member Functions

 Config ()
 
 ~Config ()
 
bool ParseOptions (int argc, char *argv[])
 Parse command line options.
 
void SetLogProperties (const std::string &filename)
 Set the log properties file.
 
void LoadConfig (const std::string &filename="", bool reset=false)
 Load the configuration file.
 
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.
 
elt::configng::CiiConfigInstanceNode & GetNode (const std::vector< std::string > &names)
 Get the reference to a specific node in the CII Cfg Service namespace.
 
bool HasNode (const std::vector< std::string > &names, elt::configng::CiiConfigInstanceNode &node)
 Probe if a given node is defined. If yes, return the reference to the node.
 
template<class TYPE >
bool HasPar (const std::vector< std::string > &names, TYPE &value)
 Probe if a given key is defined. Set the value variable if found and return true.
 
bool HasPar (const std::vector< std::string > &names)
 Probe if a given parameter is defined. Return true if found.
 
template<class TYPE >
TYPE Get (const std::vector< std::string > &names)
 Get a parameter value from the configuration.
 
template<class TYPE >
void Set (const std::vector< std::string > &names, TYPE &value)
 Set the value of a parameter in the CII Cfg Service namespace.
 
uint32_t GetMaxFrameSize (const std::string &device="")
 Return the maximum frame size in bytes with the associated camera/configuration.
 
virtual uint32_t GetMaxFrameSizeUser (const std::string &device="")
 
const DeviceInfoGetDeviceInfo (const std::string &device="") const
 Return reference to Device Info structure.
 
void GetDeviceProperties (std::map< std::string, DeviceProperty > &device_properties, const std::string &device="") const
 Get device properties.
 
template<class TYPE >
bool HasDeviceProperty (const std::string &name, TYPE &value, const std::string &device="")
 
const bpo::variables_map & GetOptions () const
 Return map with command line options.
 
std::string GetDeviceName (const std::string &device="") const
 Return name of a specific device. If "" is given the first (maybe only) device defined,.
 
bool HasDeviceProperty (const std::string &name, DeviceProperty &property, const std::string &device="")
 Check if a certain Device Property is defined in the configuration.
 
template<class TYPE >
void SetDeviceProperty (const std::string &property, TYPE value, const std::string &device="")
 
- 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 ConfigInstance ()
 Return reference to unique instance of the configuration class.
 
static ifw::core::utils::bat::Config & BatCfg ()
 Return reference to internal BAT configuration object.
 
static const elt::configng::CiiConfigInstanceNamespace & CiiCfg ()
 Return reference to internal CII Configuration namespace object.
 
- 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 Configs_instance = nullptr
 
static ifw::core::utils::bat::Config s_bat_cfg
 
static std::vector< std::string > s_devices
 
static std::map< std::string, DeviceInfos_device_info
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ Config()

ifw::ccf::common::Config::Config ( )

◆ ~Config()

ifw::ccf::common::Config::~Config ( )

Member Function Documentation

◆ BatCfg()

ifw::core::utils::bat::Config & ifw::ccf::common::Config::BatCfg ( )
static

Return reference to internal BAT configuration object.

◆ CiiCfg()

const elt::configng::CiiConfigInstanceNamespace & ifw::ccf::common::Config::CiiCfg ( )
static

Return reference to internal CII Configuration namespace object.

◆ Get()

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

Get a parameter value from the configuration.

◆ GetDeviceInfo()

const DeviceInfo & ifw::ccf::common::Config::GetDeviceInfo ( const std::string & device = "") const

Return reference to Device Info structure.

◆ GetDeviceName()

std::string ifw::ccf::common::Config::GetDeviceName ( const std::string & device = "") const

Return name of a specific device. If "" is given the first (maybe only) device defined,.

◆ GetDeviceProperties()

void ifw::ccf::common::Config::GetDeviceProperties ( std::map< std::string, DeviceProperty > & device_properties,
const std::string & device = "" ) const

Get device properties.

◆ GetMaxFrameSize()

uint32_t ifw::ccf::common::Config::GetMaxFrameSize ( const std::string & device = "")

Return the maximum frame size in bytes with the associated camera/configuration.

◆ GetMaxFrameSizeUser()

uint32_t ifw::ccf::common::Config::GetMaxFrameSizeUser ( const std::string & device = "")
virtual

Specific implementation of the algorithm to derive the maximum frame size. Need normally not be implemented by the user.

◆ GetNode()

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

Get the reference to a specific node in the CII Cfg Service namespace.

◆ GetOptions()

const bpo::variables_map & ifw::ccf::common::Config::GetOptions ( ) const

Return map with command line options.

◆ GetPars()

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

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

◆ HasDeviceProperty() [1/2]

bool ifw::ccf::common::Config::HasDeviceProperty ( const std::string & name,
DeviceProperty & property,
const std::string & device = "" )

Check if a certain Device Property is defined in the configuration.

◆ HasDeviceProperty() [2/2]

template<class TYPE >
bool ifw::ccf::common::Config::HasDeviceProperty ( const std::string & name,
TYPE & value,
const std::string & device = "" )
inline

Check if the given Device Property is defined in the configuration, return true if yes, and the value in the "value" parameter.

◆ HasNode()

bool ifw::ccf::common::Config::HasNode ( const std::vector< std::string > & names,
elt::configng::CiiConfigInstanceNode & node )

Probe if a given node is defined. If yes, return the reference to the node.

◆ HasPar() [1/2]

bool ifw::ccf::common::Config::HasPar ( const std::vector< std::string > & names)

Probe if a given parameter is defined. Return true if found.

◆ HasPar() [2/2]

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

Probe if a given key is defined. Set the value variable if found and return true.

◆ Instance()

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

Return reference to unique instance of the configuration class.

◆ LoadConfig()

void ifw::ccf::common::Config::LoadConfig ( const std::string & filename = "",
bool reset = false )

Load the configuration file.

◆ ParseOptions()

bool ifw::ccf::common::Config::ParseOptions ( int argc,
char * argv[] )

Parse command line options.

◆ Set()

template<class TYPE >
void ifw::ccf::common::Config::Set ( const std::vector< std::string > & names,
TYPE & value )
inline

Set the value of a parameter in the CII Cfg Service namespace.

◆ SetDeviceProperty()

template<class TYPE >
void ifw::ccf::common::Config::SetDeviceProperty ( const std::string & property,
TYPE value,
const std::string & device = "" )
inline

◆ SetLogProperties()

void ifw::ccf::common::Config::SetLogProperties ( const std::string & filename)

Set the log properties file.

Member Data Documentation

◆ s_bat_cfg

ifw::core::utils::bat::Config ifw::ccf::common::Config::s_bat_cfg
static

◆ s_device_info

std::map< std::string, DeviceInfo > ifw::ccf::common::Config::s_device_info
static

◆ s_devices

std::vector< std::string > ifw::ccf::common::Config::s_devices
static

◆ s_instance

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

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