26 #include <vapor/XmlNode.h>
27 #include <vapor/ParamNode.h>
28 #include <vapor/ExpatParseMgr.h>
30 #include <vapor/common.h>
33 using namespace VetsUtil;
64 XmlNode *parent,
const string &name
69 _currentParamNode = _rootParamNode = 0;
71 _paramsBaseName = name;
99 void SetParent(
XmlNode *parent);
115 virtual bool elementStartHandler(
116 ExpatParseMgr* pm,
int depth,
string& tag,
const char ** attribs
131 virtual bool elementEndHandler(
ExpatParseMgr* pm,
int depth,
string& tag);
153 void SetFlagDirty(
const string& flag);
158 const string&
GetName() {
return _paramsBaseName;}
170 static ParamsBaseType GetTypeFromTag(
const string&tag);
176 static const string& GetTagFromType(ParamsBaseType t);
185 ParamsBase *p = (createDefaultFcnMap[pType])();
194 static ParamsBase* CreateDefaultParamsBase(
const string&tag);
207 static int RegisterParamsBaseClass(
const string& tag, BaseCreateFcn fcn,
bool isParams);
217 static int ReregisterParamsBaseClass(
const string& tag,
const string& newtag,
bool isParams);
233 static bool IsParamsTag(
const string&tag) {
return (GetTypeFromTag(tag) > 0);}
234 #ifndef DOXYGEN_SKIP_THIS
235 static ParamsBase* CreateDummyParamsBase(std::string tag);
237 static void addDummyParamsBaseInstance(
ParamsBase*
const & pb ) {dummyParamsBaseInstances.push_back(pb);}
239 static void clearDummyParamsBaseInstances();
243 ParamNode *_currentParamNode;
244 ParamNode *_rootParamNode;
320 void Remove(
const string &name);
326 const map <string, string> &GetAttributes();
336 #ifndef DOXYGEN_SKIP_THIS
340 class DummyParamsBase :
public ParamsBase {
342 DummyParamsBase(XmlNode *parent,
const string &name) :
343 ParamsBase(parent, name) {}
344 virtual ~DummyParamsBase(){}
346 #endif //DOXYGEN_SKIP_THIS
348 #endif //ParamsBase_H
static vector< ParamsBase * > dummyParamsBaseInstances
ParamNode * GetCurrentNode()
virtual void SetRootParamNode(ParamNode *pn)
static const string _emptyString
static map< int, string > tagFromClassIdMap
ParamNode * GetRootNode()
virtual void setCurrentParamNode(ParamNode *pn)
ParamsBaseType GetParamsBaseTypeId()
Nodes with state in Xml tree representation.
static ParamsBase * CreateDefaultParamsBase(int pType)
static int numEmbedClasses
static int GetNumParamsClasses()
virtual ParamNode * getCurrentParamNode()
ParamsBase(const string &name)
Default constructor.
static map< int, BaseCreateFcn > createDefaultFcnMap
static int numParamsClasses
static map< string, int > classIdFromTagMap
static bool IsParamsTag(const string &tag)