DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | Friends
dabc::Configuration Class Reference

Full-functional class to reading configuration from xml files. More...

#include <dabc/Configuration.h>

Inheritance diagram for dabc::Configuration:
dabc::ConfigBase

Public Member Functions

std::string Affinity ()
 Return default affinity of any newly created thread. More...
 
std::string ConetextAppClass ()
 
 Configuration (const char *fname=0)
 
double GetHaltTime ()
 Returns time, required to halt DABC process. More...
 
double GetRunTime ()
 Returns configured time to run DABC process. More...
 
double GetThrdStopTime ()
 Returns time, required for normal thread stopping. More...
 
std::string GetUserPar (const char *name, const char *dflt=0)
 
int GetUserParInt (const char *name, int dflt=0)
 
std::string InitFuncName ()
 
bool LoadLibs ()
 
std::string MasterName ()
 Defines master DABC process, to which application will be connected Master means all control and monitoring functions will be delegated to master. More...
 
std::string MgrHost () const
 
const char * MgrName () const
 
int MgrNodeId () const
 
int MgrNumNodes () const
 
int MgrPort () const
 
bool NextCreationNode (XMLNodePointer_t &prev, const char *nodename, bool check_name_for_multicast)
 Method is used to find xml nodes like Module, MemoryPool, Connection in the xml file which should be used for autocreation. More...
 
bool NormalMainThread ()
 
std::string RunFuncName ()
 
bool SelectContext (unsigned nodeid, unsigned numnodes)
 
int ShowCpuInfo ()
 
std::string ThreadsLayout ()
 
int UseControl ()
 Defines if control used in dabc node. More...
 
bool UseSlowTime ()
 
int WithPublisher ()
 Returns true when publisher should be created. More...
 
virtual ~Configuration ()
 
- Public Member Functions inherited from dabc::ConfigBase
void AddCmdVariable (const char *name, const char *value)
 Add variable from command line. More...
 
 ConfigBase (const char *fname=0)
 
std::string ContextName (unsigned id)
 returns name of specified context More...
 
int GetVersion () const
 
bool IsOk () const
 
bool NodeActive (unsigned id)
 returns configured (initial) state of the node More...
 
std::string NodeName (unsigned id)
 returns nodename of specified context More...
 
int NodePort (unsigned id)
 returns communication port of specified context More...
 
unsigned NumNodes ()
 returns number of nodes in xml file More...
 
std::string ResolveEnv (const std::string &arg, int id=-1)
 Replaces entries like ${name} be variable value. More...
 
std::string SshArgs (unsigned id=0, const char *skind="run", const char *topcfgfile=0, const char *topworkdir=0)
 method used by run.sh script to produce command line More...
 
 ~ConfigBase ()
 

Static Public Member Functions

static std::string GetLocalHost ()
 

Protected Attributes

std::string fMgrHost
 
std::string fMgrName
 
int fMgrNodeId
 
int fMgrNumNodes
 
int fMgrPort
 
XMLNodePointer_t fSelected
 
- Protected Attributes inherited from dabc::ConfigBase
std::string envContext
 
std::string envDABCNODEID
 
std::string envDABCNUMNODES
 
std::string envDABCSYS
 
std::string envDABCUSERDIR
 
std::string envDABCWORKDIR
 
std::string envHost
 
XMLNodePointer_t fCmdVariables
 
XMLDocPointer_t fDoc
 
XMLNodePointer_t fVariables
 
int fVersion
 

Static Protected Attributes

static std::string fLocalHost = ""
 

Friends

class ConfigIO
 

Additional Inherited Members

- Protected Types inherited from dabc::ConfigBase
enum  ESshArgsKinds {
  kindTest , kindCopy , kindStart , kindRun ,
  kindStop , kindKill , kindGetlog , kindDellog
}
 
- Protected Member Functions inherited from dabc::ConfigBase
std::string Find1 (XMLNodePointer_t node, const std::string &dflt, const char *sub1, const char *sub2=0, const char *sub3=0)
 Search first entry for item sub1/sub2/sub3 in specified node First tries full path, than found sub1 and path sub2/sub3. More...
 
XMLNodePointer_t FindChild (XMLNodePointer_t node, const char *name)
 
XMLNodePointer_t FindContext (unsigned id)
 
XMLNodePointer_t FindItemMatch (XMLNodePointer_t &lastmatch, XMLNodePointer_t node, const char *sub1=0, const char *sub2=0, const char *sub3=0)
 
XMLNodePointer_t FindMatch (XMLNodePointer_t lastmatch, XMLNodePointer_t node, const char *sub1=0, const char *sub2=0, const char *sub3=0)
 
std::string FindN (XMLNodePointer_t node, XMLNodePointer_t &prev, const char *sub1, const char *sub2=0, const char *sub3=0)
 
const char * GetAttr (XMLNodePointer_t node, const char *attr, const char *defvalue=0)
 
std::string GetAttrValue (XMLNodePointer_t node, const char *name)
 
std::string GetEnv (const char *name)
 
int GetIntAttr (XMLNodePointer_t node, const char *attr, int defvalue=0)
 
std::string GetNodeValue (XMLNodePointer_t node)
 
bool NodeMaskMatch (XMLNodePointer_t node, XMLNodePointer_t mask)
 
XMLNodePointer_t RootNode ()
 
XMLNodePointer_t Variables ()
 
- Static Protected Member Functions inherited from dabc::ConfigBase
static bool IsContextNode (XMLNodePointer_t node)
 Identifies, if node can be identified as valid context - no any wildcards in names. More...
 
static bool IsNodeName (XMLNodePointer_t node, const char *name)
 
static bool IsWildcard (const char *str)
 

Detailed Description

Full-functional class to reading configuration from xml files.

Definition at line 34 of file Configuration.h.

Constructor & Destructor Documentation

◆ Configuration()

dabc::Configuration::Configuration ( const char *  fname = 0)

Definition at line 27 of file Configuration.cxx.

◆ ~Configuration()

dabc::Configuration::~Configuration ( )
virtual

Definition at line 38 of file Configuration.cxx.

Member Function Documentation

◆ SelectContext()

bool dabc::Configuration::SelectContext ( unsigned  nodeid,
unsigned  numnodes 
)

Definition at line 42 of file Configuration.cxx.

◆ MgrHost()

std::string dabc::Configuration::MgrHost ( ) const
inline

Definition at line 54 of file Configuration.h.

◆ MgrPort()

int dabc::Configuration::MgrPort ( ) const
inline

Definition at line 55 of file Configuration.h.

◆ MgrName()

const char* dabc::Configuration::MgrName ( ) const
inline

Definition at line 56 of file Configuration.h.

◆ MgrNodeId()

int dabc::Configuration::MgrNodeId ( ) const
inline

Definition at line 57 of file Configuration.h.

◆ MgrNumNodes()

int dabc::Configuration::MgrNumNodes ( ) const
inline

Definition at line 58 of file Configuration.h.

◆ InitFuncName()

std::string dabc::Configuration::InitFuncName ( )

Definition at line 121 of file Configuration.cxx.

◆ RunFuncName()

std::string dabc::Configuration::RunFuncName ( )

Definition at line 128 of file Configuration.cxx.

◆ ShowCpuInfo()

int dabc::Configuration::ShowCpuInfo ( )

Definition at line 135 of file Configuration.cxx.

◆ UseSlowTime()

bool dabc::Configuration::UseSlowTime ( )

Definition at line 144 of file Configuration.cxx.

◆ UseControl()

int dabc::Configuration::UseControl ( )

Defines if control used in dabc node.

Returns
-1 - when control="false" specified, no control created 0 - control parameter undefined, control will be used when NumNodes() > 1 +1 - when control="true" specified

Definition at line 153 of file Configuration.cxx.

◆ MasterName()

std::string dabc::Configuration::MasterName ( )

Defines master DABC process, to which application will be connected Master means all control and monitoring functions will be delegated to master.

Typically master provide http-server, which allows to control also all clients

Definition at line 172 of file Configuration.cxx.

◆ GetRunTime()

double dabc::Configuration::GetRunTime ( )

Returns configured time to run DABC process.

Definition at line 179 of file Configuration.cxx.

◆ GetHaltTime()

double dabc::Configuration::GetHaltTime ( )

Returns time, required to halt DABC process.

Definition at line 188 of file Configuration.cxx.

◆ GetThrdStopTime()

double dabc::Configuration::GetThrdStopTime ( )

Returns time, required for normal thread stopping.

Definition at line 197 of file Configuration.cxx.

◆ NormalMainThread()

bool dabc::Configuration::NormalMainThread ( )

Definition at line 206 of file Configuration.cxx.

◆ ThreadsLayout()

std::string dabc::Configuration::ThreadsLayout ( )

Definition at line 219 of file Configuration.cxx.

◆ Affinity()

std::string dabc::Configuration::Affinity ( )

Return default affinity of any newly created thread.

Definition at line 212 of file Configuration.cxx.

◆ WithPublisher()

int dabc::Configuration::WithPublisher ( )

Returns true when publisher should be created.

Returns
-1 - when publisher="false" specified 0 - when publisher not specified +1 - when publisher="true" specified

Definition at line 162 of file Configuration.cxx.

◆ NextCreationNode()

bool dabc::Configuration::NextCreationNode ( XMLNodePointer_t prev,
const char *  nodename,
bool  check_name_for_multicast 
)

Method is used to find xml nodes like Module, MemoryPool, Connection in the xml file which should be used for autocreation.

Definition at line 278 of file Configuration.cxx.

◆ GetUserPar()

std::string dabc::Configuration::GetUserPar ( const char *  name,
const char *  dflt = 0 
)

Definition at line 227 of file Configuration.cxx.

◆ GetUserParInt()

int dabc::Configuration::GetUserParInt ( const char *  name,
int  dflt = 0 
)

Definition at line 233 of file Configuration.cxx.

◆ ConetextAppClass()

std::string dabc::Configuration::ConetextAppClass ( )

Definition at line 241 of file Configuration.cxx.

◆ LoadLibs()

bool dabc::Configuration::LoadLibs ( )

Definition at line 261 of file Configuration.cxx.

◆ GetLocalHost()

static std::string dabc::Configuration::GetLocalHost ( )
inlinestatic

Definition at line 108 of file Configuration.h.

Friends And Related Function Documentation

◆ ConfigIO

friend class ConfigIO
friend

Definition at line 35 of file Configuration.h.

Field Documentation

◆ fSelected

XMLNodePointer_t dabc::Configuration::fSelected
protected

Definition at line 38 of file Configuration.h.

◆ fMgrHost

std::string dabc::Configuration::fMgrHost
protected

Definition at line 40 of file Configuration.h.

◆ fMgrPort

int dabc::Configuration::fMgrPort
protected

Definition at line 41 of file Configuration.h.

◆ fMgrName

std::string dabc::Configuration::fMgrName
protected

Definition at line 42 of file Configuration.h.

◆ fMgrNodeId

int dabc::Configuration::fMgrNodeId
protected

Definition at line 43 of file Configuration.h.

◆ fMgrNumNodes

int dabc::Configuration::fMgrNumNodes
protected

Definition at line 44 of file Configuration.h.

◆ fLocalHost

std::string dabc::Configuration::fLocalHost = ""
staticprotected

Definition at line 46 of file Configuration.h.


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