OSFI-C++
3.10.0
OpenSF Integration Library
|
#include <ArrayNode.h>
Public Member Functions | |
ArrayNode ()=default | |
Default constructor, creates a leaf node with no children. | |
ArrayNode (std::vector< std::string > elements, std::vector< ArrayNode > children) | |
Data constructor, only one of elements and children may be non-empty. | |
const std::vector< std::string > & | getElements () const |
Direct access to the unparsed data elements, only meaningful for leaf nodes. | |
const std::vector< ArrayNode > & | getChildren () const |
Direct access to the child nodes, only meaningful for non-leaf nodes. | |
int | getDegree () const |
std::vector< int > | getDimsEnvelope () const |
const ArrayNode & | getChild (int i) const |
bool | isLeaf () const |
std::vector< std::string > | getVectorString () const |
std::vector< std::string > | getVectorFile () const |
std::vector< double > | getVectorDouble () const |
std::vector< int > | getVectorInt () const |
std::vector< bool > | getVectorBoolean () const |
std::vector< osfi::confm::TimeValue > | getVectorTime () const |
Class that represents a tree with data (leaf) nodes and internal nodes. The data is stored raw, and the getVectorX functions can be used to parse it.
const ArrayNode& ArrayNode::getChild | ( | int | i | ) | const |
std::out_of_range | for an invalid index |
int ArrayNode::getDegree | ( | ) | const |
std::vector<int> ArrayNode::getDimsEnvelope | ( | ) | const |
Compute the rectangular envelope for the dimensions of this array node, considering all nodes below it in the tree.
std::vector<bool> ArrayNode::getVectorBoolean | ( | ) | const |
If this node is a leaf, gets the value of its elements parsed as booleans.
std::vector<double> ArrayNode::getVectorDouble | ( | ) | const |
If this node is a leaf, gets the value of its elements parsed as double values.
std::vector<std::string> ArrayNode::getVectorFile | ( | ) | const |
If this node is a leaf, gets the value of its elements parsed as file names.
std::vector<int> ArrayNode::getVectorInt | ( | ) | const |
If this node is a leaf, gets the value of its elements parsed as integer values.
std::vector<std::string> ArrayNode::getVectorString | ( | ) | const |
If this node is a leaf, gets the value of its elements parsed as strings.
std::vector<osfi::confm::TimeValue> ArrayNode::getVectorTime | ( | ) | const |
If this node is a leaf, gets the value of its elements parsed as booleans.
bool ArrayNode::isLeaf | ( | ) | const |
Returns true if this node has no children, and thus it directly contains elements.