OSFI-C++  3.10.0
OpenSF Integration Library
ArrayNode Class Reference

#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 ArrayNodegetChild (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::TimeValuegetVectorTime () const
 

Detailed Description

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.

Member Function Documentation

◆ getChild()

const ArrayNode& ArrayNode::getChild ( int  i) const
Returns
a reference to the ith direct child
Exceptions
std::out_of_rangefor an invalid index

◆ getDegree()

int ArrayNode::getDegree ( ) const
Returns
number of direct children (for an inner node) or elements (for a leaf node)

◆ getDimsEnvelope()

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.

Returns
Size of the rectangular multi-dimensional array that can contain this subtree.

◆ getVectorBoolean()

std::vector<bool> ArrayNode::getVectorBoolean ( ) const

If this node is a leaf, gets the value of its elements parsed as booleans.

◆ getVectorDouble()

std::vector<double> ArrayNode::getVectorDouble ( ) const

If this node is a leaf, gets the value of its elements parsed as double values.

◆ getVectorFile()

std::vector<std::string> ArrayNode::getVectorFile ( ) const

If this node is a leaf, gets the value of its elements parsed as file names.

◆ getVectorInt()

std::vector<int> ArrayNode::getVectorInt ( ) const

If this node is a leaf, gets the value of its elements parsed as integer values.

◆ getVectorString()

std::vector<std::string> ArrayNode::getVectorString ( ) const

If this node is a leaf, gets the value of its elements parsed as strings.

◆ getVectorTime()

std::vector<osfi::confm::TimeValue> ArrayNode::getVectorTime ( ) const

If this node is a leaf, gets the value of its elements parsed as booleans.

◆ isLeaf()

bool ArrayNode::isLeaf ( ) const

Returns true if this node has no children, and thus it directly contains elements.


The documentation for this class was generated from the following file: