VAPoR
3.0.0
|
An Xml tree. More...
#include <ParamNode.h>
Public Member Functions | |
int | SetElementDouble (const string &tag, double value) |
int | SetElementDouble (const string &tag, const vector< double > &values) |
int | SetElementDouble (const vector< string > &tagpath, const vector< double > &values) |
virtual const vector< double > | GetElementDouble (const vector< string > &tagpath, const vector< double > &defaultVal=XmlNode::_emptyDoubleVec) |
virtual const vector< double > | GetElementDouble (const string &tag, const vector< double > &defaultVal=XmlNode::_emptyDoubleVec) |
int | SetElementLong (const string &tag, const vector< long > &values) |
int | SetElementLong (const string &tag, long value) |
int | SetElementLong (const vector< string > &tagpath, const vector< long > &values) |
virtual const vector< long > | GetElementLong (const vector< string > &tagpath, const vector< long > &defaultVal=XmlNode::_emptyLongVec) |
virtual const vector< long > | GetElementLong (const string &tag, const vector< long > &defaultVal=XmlNode::_emptyLongVec) |
int | SetElementString (const string &tag, const string &value) |
int | SetElementString (const vector< string > &tagpath, const string &value) |
int | SetElementStringVec (const string &tag, const vector< string > &values) |
int | SetElementStringVec (const vector< string > &tagpath, const vector< string > &values) |
virtual const string | GetElementString (const string &tag, const string &defaultVal=XmlNode::_emptyString) |
virtual const string | GetElementString (const vector< string > &tagpath, const string &defaultVal=XmlNode::_emptyString) |
virtual void | GetElementStringVec (const vector< string > &tagpath, vector< string > &vec, const vector< string > &defaultVal=_emptyStringVec) |
virtual void | GetElementStringVec (const string &tag, vector< string > &vec, const vector< string > &defaultVal=_emptyStringVec) |
int | AddNode (const string &tag, ParamNode *child) |
int | InsertNode (const string &tag, ParamNode *child, int index) |
int | AddNode (const vector< string > &tagpath, ParamNode *child) |
ParamNode * | GetChild (size_t index) const |
ParamNode * | GetNode (const vector< string > &tagpath) |
ParamNode * | GetNode (const string &tag) const |
int | ReplaceNode (const vector< string > &tagpath, ParamNode *newNode) |
int | ReplaceNode (const string &tag, ParamNode *newNode) |
int | DeleteNode (const string &tag) |
int | DeleteNode (const vector< string > &tagpath) |
int | DeleteChildren (const string &tag) |
int | DeleteChildren (const vector< string > &tagpath) |
void | SetParamsBase (ParamsBase *pBase) |
ParamsBase * | GetParamsBase () const |
Internal | |
Internal methods not intended for general use | |
ParamNode (const string &tag, const map< string, string > &attrs, size_t numChildrenHint=0) | |
ParamNode (const string &tag, size_t numChildrenHint=0) | |
virtual ParamNode * | Construct (const string &tag, const map< string, string > &attrs, size_t numChildrenHint=0) |
ParamNode (const ParamNode &pn) | |
ParamNode * | NodeCopy () |
ParamNode * | ShallowCopy () |
Copy only the ParamNode itself, not any of its children. More... | |
virtual ParamNode * | deepCopy () |
virtual | ~ParamNode () |
An Xml tree.
This class extends the XmlNode class. The XML hierarchy includes pointers to ParamsBase instances, enabling use of classes embedded in Params instances.
Definition at line 30 of file ParamNode.h.
VAPoR::ParamNode::ParamNode | ( | const string & | tag, |
const map< string, string > & | attrs, | ||
size_t | numChildrenHint = 0 |
||
) |
VAPoR::ParamNode::ParamNode | ( | const string & | tag, |
size_t | numChildrenHint = 0 |
||
) |
VAPoR::ParamNode::ParamNode | ( | const ParamNode & | pn | ) |
|
virtual |
int VAPoR::ParamNode::AddNode | ( | const string & | tag, |
ParamNode * | child | ||
) |
Add an existing node as a child of the current node. The new child node will be appended to the array of child nodes.
[in] | tag | is the tag that will identify the new node |
[in] | child | is the ParamNode object to be added as a child |
status | Return 0 upon success. A negative number is returned if a sibling already exists with the same name. |
int VAPoR::ParamNode::AddNode | ( | const vector< string > & | tagpath, |
ParamNode * | child | ||
) |
Add an existing node as a last child of a path of nodes starting at the current
The new child node will be appended to the array of child nodes of the final node.
[in] | tagpath | is vector of tags specifying path to the new node |
[in] | child | is the ParamNode object to be added as a child |
status | Return 0 upon success. A negative number is returned if a sibling already exists with the same name, or if one of the specified nodes in the path sequence does not already exist |
|
inlinevirtual |
Construct a new ParamNode node
[in] | tag | Name of ParamNode node |
[in] | attrs | A list of Xml attribute names and values for this node |
[in] | numChildrenHint | Reserve space for the indicated number of |
node | Newly constructed ParamNode |
Definition at line 64 of file ParamNode.h.
|
virtual |
Like copy constructor for the ParamNode class, but in addition to cloning the child nodes in xml hierarchy, also clones the ParamsBase instances that are referenced by child nodes
Creates a new ParamNode node from an existing one.
node | ParamNode copied from this |
Referenced by VAPoR::Command::CaptureEnd().
int VAPoR::ParamNode::DeleteChildren | ( | const string & | tag | ) |
Delete all children of the indicated node and all their descendants.
[in] | tag | Name of the node whose children will be deleted |
status | Return 0 if successful, -1 if child does not exist. |
int VAPoR::ParamNode::DeleteChildren | ( | const vector< string > & | tagpath | ) |
Delete all children of the indicated node and all their descendants. given a path to the child
[in] | tagpath | Path to the child node to delete |
status | Return 0 if successful, -1 if child does not exist. |
int VAPoR::ParamNode::DeleteNode | ( | const string & | tag | ) |
Delete the indicated child node and all its descendants.
[in] | tag | Name of the child node to delete |
status | Return 0 if successful, -1 if child does not exist. |
int VAPoR::ParamNode::DeleteNode | ( | const vector< string > & | tagpath | ) |
Delete the indicated child node and all its descendants, based on a path to the child
[in] | tagpath | Path to the child node to delete |
status | Return 0 if successful, -1 if child does not exist. |
|
inline |
Return the indicated child node.
Return the ith child of this node. The first child node is index=0, the last is index=GetNumChildren()-1. Return NULL if the child does not exist.
[in] | index | Index of the child. The first child is zero |
child | Returns the indicated child, or NULL if the child could does not exist |
Definition at line 413 of file ParamNode.h.
|
virtual |
Get an element's data of type double
Return the character data associated with the Xml element identified by a sequence tagpath
from this node. The data is interpreted and returned as a vector of doubles. If the element does not exist an empty vector is returned. If ErrOnMissing() is true an error is generated if the element is missing;
[in] | tagpath | sequence of tags leading to element |
[in] | defaultVal | (optional) default vector<double> to be assigned if specified element does not exist |
vector | Vector of doubles associated with the named element |
|
virtual |
Get an Xml element's data of type double
Return the character data associated with the Xml elemented named by tag
for this node. The data is interpreted and returned as a vector of doubles. If the element does not exist an empty vector is returned. If ErrOnMissing() is true an error is generated if the element is missing;
[in] | tag | Name of element |
[in] | defaultVal | (optional) default vector<double> to be assigned if specified element does not exist |
vector | Vector of doubles associated with the named element |
|
virtual |
Get an Xml element's data of type long
Return the character data associated with the XML element reached via a sequence tagpath
of nodes from this node. The data is interpreted and returned as a vector of longs. If the element does not exist an empty vector is returned. If ErrOnMissing() is true an error is generated if the element is missing;
[in] | tagpath | Sequence of tags to element |
[in] | defaultVal | (optional) vector<long> to be assigned if specified element does not exist. |
vector<long> | vector of longs associated with the named elemented |
|
virtual |
Get an Xml element's data of type long
Return the character data associated with the Xml element named by tag
for this node. The data is interpreted and returned as a vector of longs. If the element does not exist an empty vector is returned. If ErrOnMissing() is true an error is generated if the element is missing;
[in] | tag | Name of element |
[in] | defaultVal | (optional) Vector of longs that will be set if specified element does not exist |
vector | Vector of longs associated with the named elemented |
|
virtual |
Get an Xml element's data of type string
Return the character data associated with the Xml elemented named by tag
for this node. The data is interpreted and returned as a string. If the element does not exist an empty vector is returned. If ErrOnMissing() is true an error is generated if the element is missing;
[in] | tag | Name of element |
[in] | defaultVal | (optional) string to be assigned if specified element does not exist. |
string | The string associated with the named element |
|
virtual |
Get an element's data of type string
Return the character data associated with the Xml element identified by tagpath
for this node. The data is interpreted and returned as a string. If the element does not exist an empty vector is returned. If ErrOnMissing() is true an error is generated if the element is missing;
[in] | tagpath | sequence of tags leading to element |
[in] | defaultVal | (optional) string to be assigned if specified element does not exist. |
string | The string associated with the named element |
|
virtual |
Get an element's data of type string vector using a path to node
Builds the string vector data associated with the Xml element identified by a sequence of tags tagpath
from this node. The strings in the vector vec
must not contain white characters. If the element does not exist an empty vector is returned
[in] | tagpath | Sequence of tags |
[in] | defaultVal | (optional) vector<string> to be assigned if specified element does not exist. |
[out] | vec | Vector of strings associated with the named element |
|
virtual |
Get an element's data of type string vector at the current node
Build the string vector data associated with the Xml element identified by a tag at
this node. The strings in the vector vec
must not contain white characters. If the element does not exist an empty vector is returned
[in] | tag | Node tag |
[in] | defaultVal | (optional) vector<string> to be assigned if specified element does not exist. |
[out] | vec | Vector of strings associated with the named element |
ParamNode* VAPoR::ParamNode::GetNode | ( | const vector< string > & | tagpath | ) |
Return the indicated child node based on a sequence of tags
Return the indicated tagged child node. Return NULL if the child does not exist.
[in] | tagpath | Sequence of nodes to specified child |
child | Returns the indicated child, or NULL if the child could does not exist |
Referenced by VAPoR::IsolineParams::GetBox().
|
inline |
Return the indicated child node.
[in] | tag | Name of the child node to return |
child | Returns the indicated child, or NULL if the child could does not exist |
Definition at line 441 of file ParamNode.h.
|
inline |
Get the ParamsBase node for which this is the root
The ParamsBase node is NULL unless this node is associated with a registered ParamsBase object.
Pointer | to the ParamsBase node for which this is the root node |
Definition at line 510 of file ParamNode.h.
Referenced by VAPoR::IsolineParams::GetBox().
int VAPoR::ParamNode::InsertNode | ( | const string & | tag, |
ParamNode * | child, | ||
int | index | ||
) |
Insert an existing node as a child of the current node, at specified index
The new child node will be inserted into the array of child nodes.
[in] | tag | is the tag that will identify the new node |
[in] | child | is the ParamNode object to be added as a child |
[in] | index | is the child index that will be used by the new child |
status | Return 0 upon success. A negative number is returned if a sibling already exists with the same name, or if the proposed index is not valid |
ParamNode* VAPoR::ParamNode::NodeCopy | ( | ) |
Method that clones the ParamNode structure, using buildNode to construct the ParamNodes associated with registered ParamsBase instances in the ParamNode hierarchy
int VAPoR::ParamNode::ReplaceNode | ( | const vector< string > & | tagpath, |
ParamNode * | newNode | ||
) |
Replace the indicated child node based on a sequence of tags
[in] | tagpath | Sequence of nodes to specified child |
[in] | newNode | ParamNode to install |
status | Returns -1, if the child does not exist |
int VAPoR::ParamNode::ReplaceNode | ( | const string & | tag, |
ParamNode * | newNode | ||
) |
Replace the indicated child node.
If child has a paramsBase instance, it is deleted.
[in] | tag | Name of the child node to replace |
[in] | newNode | ParamNode to install |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementDouble | ( | const string & | tag, |
double | value | ||
) |
Set a single ParamNode parameter of type double
This method defines and sets a parameter of type double. The parameter data to be associated with tag
is the single double specified by value
[in] | tag | Name of the element to define/set |
[in] | value | double |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementDouble | ( | const string & | tag, |
const vector< double > & | values | ||
) |
Set an ParamNode parameter of type double
This method defines and sets a parameter of type double. The parameter data data to be associated with tag
is the array of double specified by values
[in] | tag | Name of the element to define/set |
[in] | values | Vector of doubles |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementDouble | ( | const vector< string > & | tagpath, |
const vector< double > & | values | ||
) |
Set an ParamNode parameter of type double This method defines and sets a parameter of type double. The parameter data data to be associated with tagpath
is the array of double specified by values
[in] | tagpath | Names of the nodes leading to the element to be set |
[in] | values | Vector of doubles |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementLong | ( | const string & | tag, |
const vector< long > & | values | ||
) |
int VAPoR::ParamNode::SetElementLong | ( | const string & | tag, |
long | value | ||
) |
Set a single ParamNode parameter of type long
This method defines and sets a parameter of type long. The paramter data data to be associated with tag
is the single long specified by value
[in] | tag | Name of the element to define/set |
[in] | value | long |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementLong | ( | const vector< string > & | tagpath, |
const vector< long > & | values | ||
) |
Set an ParamNode parameter of type long This method defines and sets a parameter of type long. The parameter data data to be associated with tagpath
is the array of longs specified by values
[in] | tagpath | Names of nodes leading to the value to be set |
[in] | values | Vector of longs |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementString | ( | const string & | tag, |
const string & | value | ||
) |
Set a single ParamNode parameter of type string
This method defines and sets a parameter of type string. The parameter data data to be associated with tag
is the single string specified by value
[in] | tag | Name of the element to define/set |
[in] | value | string |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementString | ( | const vector< string > & | tagpath, |
const string & | value | ||
) |
Set a single ParamNode parameter of type string This method defines and sets a parameter of type string. The parameter data data to be associated with tagpath
is the single string specified by value
[in] | tagpath | sequence of tags leading to specified element. |
[in] | value | string |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementStringVec | ( | const string & | tag, |
const vector< string > & | values | ||
) |
Set an ParamNode parameter of type string vector
This method defines and sets a parameter of type string vector. The parameter data to be associated with tag
is the array of strings specified by values
The strings in the vector values
must not contain white characters.
[in] | tag | Name(Tag) of the element to define/set |
[in] | values | Vector of strings |
status | Returns 0 if successful |
int VAPoR::ParamNode::SetElementStringVec | ( | const vector< string > & | tagpath, |
const vector< string > & | values | ||
) |
Set a ParamNode parameter of type string This method defines and sets a parameter of type string vector. The parameter data data to be associated with tagpath
is the array of strings specified by values
The strings in the vector values
must not contain white characters.
[in] | tagpath | Names of nodes leading to value to be set |
[in] | values | Vector of strings |
status | Returns 0 if successful |
|
inline |
Set a ParamsBase node for which this is the root
The ParamsBase node is NULL unless this node is associated with a registered ParamsBase object.
[in] | pBase | Pointer to the ParamsBase node for which this is the root node |
Definition at line 500 of file ParamNode.h.
ParamNode* VAPoR::ParamNode::ShallowCopy | ( | ) |
Copy only the ParamNode itself, not any of its children.