DABC (Data Acquisition Backbone Core)
2.9.9
|
Base class to read configuration from xml file. More...
#include <dabc/ConfigBase.h>
Public Member Functions | |
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 () | |
Protected Types | |
enum | ESshArgsKinds { kindTest , kindCopy , kindStart , kindRun , kindStop , kindKill , kindGetlog , kindDellog } |
Protected Member Functions | |
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 | |
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) |
Protected Attributes | |
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 |
Friends | |
class | ConfigIO |
Base class to read configuration from xml file.
Use also in dabc_xml executable to extract basic information from xml files. For instance, number of nodes or context port number
Definition at line 104 of file ConfigBase.h.
|
protected |
Enumerator | |
---|---|
kindTest | |
kindCopy | |
kindStart | |
kindRun | |
kindStop | |
kindKill | |
kindGetlog | |
kindDellog |
Definition at line 109 of file ConfigBase.h.
dabc::ConfigBase::ConfigBase | ( | const char * | fname = 0 | ) |
Definition at line 94 of file ConfigBase.cxx.
dabc::ConfigBase::~ConfigBase | ( | ) |
Definition at line 121 of file ConfigBase.cxx.
|
protected |
Definition at line 398 of file ConfigBase.cxx.
|
protected |
Definition at line 131 of file ConfigBase.cxx.
|
protected |
Definition at line 218 of file ConfigBase.cxx.
|
protected |
Definition at line 192 of file ConfigBase.cxx.
|
protected |
Definition at line 253 of file ConfigBase.cxx.
|
protected |
Search first entry for item sub1/sub2/sub3 in specified node First tries full path, than found sub1 and path sub2/sub3.
Definition at line 304 of file ConfigBase.cxx.
|
protected |
Definition at line 322 of file ConfigBase.cxx.
|
protected |
Definition at line 523 of file ConfigBase.cxx.
|
staticprotected |
Definition at line 160 of file ConfigBase.cxx.
|
protected |
Definition at line 169 of file ConfigBase.cxx.
|
protected |
Definition at line 175 of file ConfigBase.cxx.
|
protected |
Definition at line 284 of file ConfigBase.cxx.
|
protected |
Definition at line 292 of file ConfigBase.cxx.
|
protected |
Definition at line 181 of file ConfigBase.cxx.
|
protected |
Definition at line 421 of file ConfigBase.cxx.
|
staticprotected |
Definition at line 391 of file ConfigBase.cxx.
|
staticprotected |
Identifies, if node can be identified as valid context - no any wildcards in names.
Definition at line 404 of file ConfigBase.cxx.
|
inline |
Definition at line 177 of file ConfigBase.h.
|
inline |
Definition at line 179 of file ConfigBase.h.
unsigned dabc::ConfigBase::NumNodes | ( | ) |
returns number of nodes in xml file
Definition at line 334 of file ConfigBase.cxx.
std::string dabc::ConfigBase::NodeName | ( | unsigned | id | ) |
returns nodename of specified context
Definition at line 349 of file ConfigBase.cxx.
int dabc::ConfigBase::NodePort | ( | unsigned | id | ) |
returns communication port of specified context
Definition at line 358 of file ConfigBase.cxx.
bool dabc::ConfigBase::NodeActive | ( | unsigned | id | ) |
returns configured (initial) state of the node
Definition at line 371 of file ConfigBase.cxx.
std::string dabc::ConfigBase::ContextName | ( | unsigned | id | ) |
returns name of specified context
Definition at line 379 of file ConfigBase.cxx.
std::string dabc::ConfigBase::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
Definition at line 529 of file ConfigBase.cxx.
std::string dabc::ConfigBase::ResolveEnv | ( | const std::string & | arg, |
int | id = -1 |
||
) |
Replaces entries like ${name} be variable value.
Definition at line 440 of file ConfigBase.cxx.
void dabc::ConfigBase::AddCmdVariable | ( | const char * | name, |
const char * | value | ||
) |
Add variable from command line.
Definition at line 151 of file ConfigBase.cxx.
|
friend |
Definition at line 106 of file ConfigBase.h.
|
protected |
Definition at line 111 of file ConfigBase.h.
|
protected |
Definition at line 112 of file ConfigBase.h.
|
protected |
Definition at line 113 of file ConfigBase.h.
|
protected |
Definition at line 114 of file ConfigBase.h.
|
protected |
Definition at line 117 of file ConfigBase.h.
|
protected |
Definition at line 118 of file ConfigBase.h.
|
protected |
Definition at line 119 of file ConfigBase.h.
|
protected |
Definition at line 120 of file ConfigBase.h.
|
protected |
Definition at line 121 of file ConfigBase.h.
|
protected |
Definition at line 122 of file ConfigBase.h.
|
protected |
Definition at line 123 of file ConfigBase.h.