VAPoR
0.1
|
Nodes with state in Xml tree representation. More...
#include <ParamsBase.h>
Public Types | |
typedef int | ParamsBaseType |
Public Member Functions | |
ParamsBase (XmlNode *parent, const string &name) | |
ParamsBase (const string &name) | |
Default constructor. More... | |
ParamsBase (const ParamsBase &pbase) | |
Copy constructor. More... | |
virtual | ~ParamsBase () |
virtual ParamsBase * | deepCopy (ParamNode *newRoot=0) |
void | SetParent (XmlNode *parent) |
virtual bool | elementStartHandler (ExpatParseMgr *pm, int depth, string &tag, const char **attribs) |
virtual bool | elementEndHandler (ExpatParseMgr *pm, int depth, string &tag) |
ParamNode * | GetRootNode () |
virtual ParamNode * | buildNode () |
void | SetFlagDirty (const string &flag) |
const string & | GetName () |
ParamsBaseType | GetParamsBaseTypeId () |
virtual void | SetRootParamNode (ParamNode *pn) |
Public Member Functions inherited from VAPoR::ParsedXml | |
virtual | ~ParsedXml () |
virtual bool | elementStartHandler (ExpatParseMgr *, int, std::string &, const char **)=0 |
virtual bool | elementEndHandler (ExpatParseMgr *, int, std::string &)=0 |
virtual bool | charHandler (ExpatParseMgr *, const XML_Char *, int) |
Static Public Member Functions | |
static ParamsBaseType | GetTypeFromTag (const string &tag) |
static const string & | GetTagFromType (ParamsBaseType t) |
static ParamsBase * | CreateDefaultParamsBase (int pType) |
static ParamsBase * | CreateDefaultParamsBase (const string &tag) |
static int | RegisterParamsBaseClass (const string &tag, BaseCreateFcn fcn, bool isParams) |
static int | ReregisterParamsBaseClass (const string &tag, const string &newtag, bool isParams) |
static int | GetNumParamsClasses () |
static bool | IsParamsTag (const string &tag) |
Protected Member Functions | |
virtual ParamNode * | getCurrentParamNode () |
virtual void | setCurrentParamNode (ParamNode *pn) |
ParamNode * | GetCurrentNode () |
ParamNode * | Push (string &tag, ParamsBase *pBase=0) |
ParamNode * | Pop () |
void | Remove (const string &name) |
const map< string, string > & | GetAttributes () |
void | Clear () |
Protected Attributes | |
string | _paramsBaseName |
int | _parseDepth |
Static Protected Attributes | |
static vector< ParamsBase * > | dummyParamsBaseInstances |
static const string | _emptyString |
static map< string, int > | classIdFromTagMap |
static map< int, string > | tagFromClassIdMap |
static map< int, BaseCreateFcn > | createDefaultFcnMap |
static int | numParamsClasses |
static int | numEmbedClasses |
Static Protected Attributes inherited from VAPoR::ParsedXml | |
static const string | _stringType |
static const string | _longType |
static const string | _doubleType |
static const string | _typeAttr |
Additional Inherited Members | |
Public Attributes inherited from VAPoR::ParsedXml | |
ParsedXml * | previousClass |
Nodes with state in Xml tree representation.
This is abstract parent of Params and related classes with state kept in an xml node. Used with the ParamNode class to support user-defined Params classes as well as other classes such as the TransferFunction class.
Users can extend ParamsBase classes to include arbitrary child (sub) nodes, by support parsing of such nodes.
Definition at line 57 of file ParamsBase.h.
typedef int VAPoR::ParamsBase::ParamsBaseType |
Definition at line 66 of file ParamsBase.h.
VAPoR::ParamsBase::ParamsBase | ( | XmlNode * | parent, |
const string & | name | ||
) |
|
inline |
Default constructor.
Definition at line 68 of file ParamsBase.h.
VAPoR::ParamsBase::ParamsBase | ( | const ParamsBase & | pbase | ) |
Copy constructor.
|
virtual |
|
virtual |
Method to build an xml node from state. This only needs to be implemented if the state of the ParamsBase is not specified by the root ParamNode
node | ParamNode representing the current ParamsBase instance |
Reimplemented in VAPoR::MapperFunctionBase, VAPoR::IsoControl, and VAPoR::TransferFunction.
|
protected |
Remove (undefine) all parameters
This method deletes any and all paramters contained in the base class as well as deleting any tree branches.
|
inlinestatic |
Static method for constructing a default instance of a ParamsBase class based on the typeId.
[in] | pType | TypeId of the ParamsBase instance to be created. |
instance | newly created ParamsBase instance |
Definition at line 184 of file ParamsBase.h.
|
static |
Static method for constructing a default instance of a ParamsBase class based on the Tag.
[in] | tag | XML tag of the ParamsBase instance to be created. |
instance | newly created ParamsBase instance |
|
virtual |
Make a copy of a ParamBase that optionally uses specified clone of the ParamNode as its root node. If the root is null, the copy ignores any ParamNodes. The default implementation is sufficient for ParamsBase classes that are built from a ParamNode hierarchy.
[in] | newRoot | Root of cloned ParamsBase instance |
instance | Pointer to cloned instance |
Reimplemented in VAPoR::Params, VAPoR::IsoControl, VAPoR::TransferFunction, and VAPoR::MapperFunction.
|
virtual |
Xml end tag parsing method
This method is called to handle parsing of an XML file. The contents of the file will replace any current parameter settings. The method is virtual so that derived classes may receive notification when an object instance has finished reseting state from an XML file. Override the default method if the class is not based on a hierarchy of ParamNode objects representing the XML representation of the class
status | False indicates parse error |
|
virtual |
Xml start tag parsing method
This method is called to handle parsing of an XML file. The contents of the file will replace any current parameter settings. The method is virtual so that derived classes may receive notification when an object instance is reseting state from an XML file
Override this method if you are not using the ParamNode API to specify the state in terms of the xml representation of the class
status | False indicates parse error |
|
protected |
Return the attributes associated with the current branch
map | attribute mapping |
|
inlineprotected |
Return the current node in the parameter node tree
This method returns the current node in the parameter node tree.
node | Current ParamNode |
Definition at line 274 of file ParamsBase.h.
|
inlineprotectedvirtual |
Definition at line 250 of file ParamsBase.h.
|
inline |
Method for obtaining the name and/or tag associated with the instance
Definition at line 158 of file ParamsBase.h.
|
inlinestatic |
Static method to determine how many Params classes are registered
count | Number of registered Params classes |
Definition at line 227 of file ParamsBase.h.
|
inline |
Method for obtaining the type Id associated with a ParamsBase instance
int | ParamsBase TypeID for ParamsBase instance |
Definition at line 164 of file ParamsBase.h.
|
inline |
Return the top (root) of the parameter node tree
This method returns the top node in the parameter node tree
Definition at line 138 of file ParamsBase.h.
|
static |
Static method for converting a ParamsBase typeID to a Tag
string | Tag (Name) associated with ParamsBase TypeID |
|
static |
Static method for converting a Tag to a ParamsBase typeID
int | ParamsBase TypeID for Tag |
Referenced by VAPoR::VizWinMgr::getApplicableParams(), and VAPoR::VizWinMgr::getEventRouter().
|
inlinestatic |
Static method to determine if a ParamsBase class is a Params class
[in] | tag | XML tag associated with ParamsBase class |
status | True if the specified class is a Params class |
Definition at line 233 of file ParamsBase.h.
|
protected |
Move up one level in the paramter tree
This method move back up the tree hierarchy by one level. Moving up past the root of the tree is prohibited and will silenty fail with no ill effects.
node | Returns the new current node |
|
protected |
Move down a level in the parameter tree
The underlying storage model for parameter data is a hierarchical tree. By default the hierarchy is flat. This method can be used to add and navigate branches of the tree. Invoking this method makes the branch named by name
the current branch (node). If the branch name
does not exist it will be created with the name provided. Subsequent set and get methods will operate relative to the current branch. User-specific subtrees can be provided by extending this method
[in] | tag | The name of the branch |
[in] | pBase | optional ParamsBase object to be associated with ParamNode |
node | Returns the new current node |
|
static |
Static method for registering a ParamsBase class. This calls CreateDefaultInstance on the class.
[in] | tag | Tag of class to be registered |
[in] | fcn | Method that creates default instance of ParamsBase class |
[in] | isParams | set true if the ParamsBase class is derived from Params |
classID | Returns the ParamsBaseClassId, or 0 on failure |
|
protected |
Delete the named branch.
This method deletes the named child, and all decendents, of the current destroying it's contents in the process. The named node must be a child of the current node. If the named node does not exist the result is a no-op.
[in] | name | The name of the branch |
|
static |
Static method for registering a tag for an already registered ParamsBaseClass. This is needed for backwards compatibility when a tag is changed. The class must first be registered with the new tag.
[in] | tag | Tag of class to be registered |
[in] | newtag | Previously registered tag (new name of class) |
[in] | isParams | set true if the ParamsBase class is derived from Params |
classID | Returns the ParamsBaseClassId, or 0 on failure |
|
inlineprotectedvirtual |
Definition at line 252 of file ParamsBase.h.
void VAPoR::ParamsBase::SetFlagDirty | ( | const string & | flag | ) |
Method for manual setting of node flags
void VAPoR::ParamsBase::SetParent | ( | XmlNode * | parent | ) |
Set the parent node of the XmlNode tree.
Sets a new parent node for the XmlNode tree parameter data base. The parent node, parent
, must have been previously initialized by passing it as an argument to the class constructor ParamBase(). This method permits wholesale changing of the entire parameter database.
[in] | parent | Parent XmlNode. |
|
inlinevirtual |
Specify the Root ParamNode of a ParamsBase instance
[in] | pn | ParamNode of new root |
Definition at line 222 of file ParamsBase.h.
Referenced by VAPoR::MapperFunction::deepCopy(), VAPoR::TransferFunction::deepCopy(), and VAPoR::IsoControl::deepCopy().
|
staticprotected |
Definition at line 249 of file ParamsBase.h.
|
protected |
Definition at line 260 of file ParamsBase.h.
|
protected |
Definition at line 261 of file ParamsBase.h.
|
staticprotected |
Definition at line 256 of file ParamsBase.h.
|
staticprotected |
Definition at line 258 of file ParamsBase.h.
|
staticprotected |
Definition at line 248 of file ParamsBase.h.
|
staticprotected |
Definition at line 263 of file ParamsBase.h.
|
staticprotected |
Definition at line 262 of file ParamsBase.h.
|
staticprotected |
Definition at line 257 of file ParamsBase.h.