ConfigHandler - Runtime configuration from command line or config files

Classes

class  CommandSwitch::DefaultRead< T >
 read a single variable from the command line using stream operator More...
class  CommandSwitch::DefaultRead< std::string >
class  CommandSwitch::LoadConfigFile
 Load a parameter list from the specified config file. More...
class  CommandSwitch::SetValue< T >
 Set a variable to the pre-defined supplied value. More...
class  CommandSwitch::Increment< T >
 Increment a variable using the ++ prefix operator. More...
class  CommandSwitch::Decrement< T >
 Decrement a variable using the -- prefix operator. More...
class  CommandSwitch::AddVal< T >
 Increment a variable by the amount supplied on the command line. More...
class  CommandSwitch::Toggle
 Toggle the value of a boolean variable. More...
class  ConfigHandler
 Global singleton ParameterList to handle all configuration. More...
class  MessageHandler
 Global class which accepts messages from different threads and sends them to different receivers. More...
class  ConfigFunctor< readfunc, writefunc >
 Treat a functor as a ParameterNode, callable by config file. More...
class  Message
 Thread-safe streaming utility with settable threshold. More...
class  Parameter< T >
 Template implementation of VParamterNode, allows any variable to be set/read via stl iostreams. More...
class  ParameterList
 Concrete implementation of VParameterNode, contains map of sub-paramsClasses which would like to have sections managed by config files should inherit from ParameterList, then use the RegisterParameter function to assign string names to the variables which can be config'd. More...
class  phrase
 string with overloaded iostream operators to read whitespace and empty strings More...
class  VParameterNode
 Abstract class with iostream operators to store specialized templates in STL containers. More...

Namespaces

namespace  CommandSwitch
 

Defines commonly used functors for command switches.


Files

file  CommandSwitchFunctions.hh
 

Defines some commonly used functors for command switches.


file  ConfigFunctor.hh
 

Define the ConfigFunctor template class.


file  ConfigHandler.hh
 

Defines the ConfigHandler global configuration class.


file  Message.hh
 

Definition for Message class.


file  MessageHandler.hh
 

defines the global MessageHandler stream redirector


file  Parameter.hh
 

defines the Parameter template class


file  ParameterList.hh
 

Defines ParameterList class and associated functions.


file  phrase.hh
 

defines phrase utility class


file  VParameterNode.hh
 

Defines VParameterNode abstract base class.


Enumerations

enum  MESSAGE_LEVEL {
  DEBUG3 = 0, DEBUG2, DEBUG, INFO,
  WARNING, ERROR, CRITICAL, EXCEPTION,
  N_MESSAGE_LEVELS
}
 

enumerate the different severity of messages


Functions

std::ostream & operator<< (std::ostream &out, const MESSAGE_LEVEL &level)
 ostream overload for MESSAGE_LEVEL
std::istream & operator>> (std::istream &in, MESSAGE_LEVEL &level)
 istream overload for MESSAGE_LEVEL
MESSAGE_LEVELoperator++ (MESSAGE_LEVEL &level)
 increment operator for MESSAGE_LEVEL
MESSAGE_LEVELoperator-- (MESSAGE_LEVEL &level)
 decrement operator for MESSAGE_LEVEL
template<class Action >
int ConfigHandler::AddCommandSwitch (char shortname, const std::string &longname, const std::string &helptext, Action action, const std::string &parameter="")
 Add a command line switch.
virtual int ConfigHandler::CommandSwitch::Process (const char *arg)
 Process a command switch, optionally reading an argument.
template<class T >
bool ConfigHandler::LoadCreateParameterList (T *&par, std::string key="", bool registerme=false)
 Load a parameter list from an old config file.
template<class T >
bool ConfigHandler::LoadParameterList (T *par, std::string key="", bool registerme=false)
 Load a parameter list from an old config file with pointer value.

Function Documentation

template<class Action >
int ConfigHandler::AddCommandSwitch ( char  shortname,
const std::string &  longname,
const std::string &  helptext,
Action  action,
const std::string &  parameter = "" 
) [inline, inherited]

Add a command line switch.

Only one of shortname,longname are required use ' ' (space) and "" (empty string) to skip either parameter If the switch requires a parameter, it must be specified in the 4th slot

The Action class object supplied MUST be a functor which defines a int operator()(const char* ) method, even if it takes no argument

Returns 0 if no error occurred.

Parameters:
shortname allow user to call the switch with a single dash (-)
longname allow user to call switch with double dash name
helptext a short description of what this switch does
action functor which is called when switch is found on command line
parameter name of the argument parameter if the switch needs one

Definition at line 190 of file ConfigHandler.hh.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 20 Jun 2014 for daqman by  doxygen 1.6.1