16 #ifndef DABC_ConfigBase
17 #define DABC_ConfigBase
19 #ifndef DABC_XmlEngine
132 const char* sub1 = 0,
133 const char* sub2 = 0,
134 const char* sub3 = 0);
138 const char* sub1 = 0,
139 const char* sub2 = 0,
140 const char* sub3 = 0);
143 const std::string &dflt,
145 const char* sub2 = 0,
146 const char* sub3 = 0);
151 const char* sub2 = 0,
152 const char* sub3 = 0);
154 std::string
GetEnv(
const char* name);
197 std::string
SshArgs(
unsigned id = 0,
const char* skind =
"run",
const char* topcfgfile = 0,
const char* topworkdir = 0);
200 std::string
ResolveEnv(
const std::string &arg,
int id = -1);
Base class to read configuration from xml file.
std::string envDABCNUMNODES
XMLNodePointer_t Variables()
void AddCmdVariable(const char *name, const char *value)
Add variable from command line.
std::string GetAttrValue(XMLNodePointer_t node, const char *name)
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
int GetIntAttr(XMLNodePointer_t node, const char *attr, int defvalue=0)
XMLNodePointer_t fCmdVariables
std::string NodeName(unsigned id)
returns nodename of specified context
XMLNodePointer_t fVariables
bool NodeMaskMatch(XMLNodePointer_t node, XMLNodePointer_t mask)
std::string envDABCUSERDIR
XMLNodePointer_t FindItemMatch(XMLNodePointer_t &lastmatch, XMLNodePointer_t node, const char *sub1=0, const char *sub2=0, const char *sub3=0)
XMLNodePointer_t RootNode()
std::string GetEnv(const char *name)
XMLNodePointer_t FindContext(unsigned id)
int NodePort(unsigned id)
returns communication port of specified context
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,...
static bool IsWildcard(const char *str)
std::string FindN(XMLNodePointer_t node, XMLNodePointer_t &prev, const char *sub1, const char *sub2=0, const char *sub3=0)
std::string GetNodeValue(XMLNodePointer_t node)
XMLNodePointer_t FindChild(XMLNodePointer_t node, const char *name)
std::string envDABCNODEID
XMLNodePointer_t FindMatch(XMLNodePointer_t lastmatch, XMLNodePointer_t node, const char *sub1=0, const char *sub2=0, const char *sub3=0)
const char * GetAttr(XMLNodePointer_t node, const char *attr, const char *defvalue=0)
ConfigBase(const char *fname=0)
std::string envDABCWORKDIR
std::string ContextName(unsigned id)
returns name of specified context
bool NodeActive(unsigned id)
returns configured (initial) state of the node
static bool IsContextNode(XMLNodePointer_t node)
Identifies, if node can be identified as valid context - no any wildcards in names.
unsigned NumNodes()
returns number of nodes in xml file
static bool IsNodeName(XMLNodePointer_t node, const char *name)
std::string ResolveEnv(const std::string &arg, int id=-1)
Replaces entries like ${name} be variable value.
Interface class between xml configuration and dabc objects.
const char * xmlDABCNUMNODES
const char * xmlThrdStopTime
const char * xmlNoDebugPrefix
const char * xmlValueAttr
const char * xmlVersionAttr
const char * xmlTimeoutAttr
const char * xmlMasterProcess
const char * xmlUseacknAttr
const char * xmlDeviceAttr
const char * xmlSshTimeout
const char * xmlThreadsLayout
const char * xmlAppDfltName
const char * xmlApplication
const char * xmlOptionalAttr
const char * xmlNumReconnAttr
const char * xmlDebuglevel
const char * xmlReconnectAttr
const char * xmlDABCUSERDIR
const char * xmlVariablesNode
const char * xmlThreadAttr
const char * xmlTrueValue
const char * xmlSocketHost
const char * xmlPublisher
const char * xmlUseControl
const char * xmlFalseValue
const char * xmlClassAttr
const char * xmlDABCWORKDIR
const char * xmlDABCNODEID
const char * xmlSysloglevel
const char * xmlNormalMainThrd