OSFI-C++  3.10.0
OpenSF Integration Library
ArrayNode.h
1 /*
2  * openSF Integration Libraries (OSFI)
3  * Deimos Space, S.L.U.
4  *
5  * This file is part of OSFI. OSFI is free software; you can redistribute it
6  * and/or modify it under the terms of the 'ESA Software Community Licence Permissive' as
7  * published by the European Space Agency; either version 2.4 of the License,
8  * or (at your option) any later version. You should have received a
9  * copy of the 'ESA Software Community Licence Permissive - v2.4' along with this program
10  * or one can be found at <http://eop-cfi.esa.int/index.php/docs-and-mission-data/licensing-documents>.
11  *
12  * ArrayNode.h
13  *
14  * Created on: Apr 21, 2016
15  * Author: nucc
16  */
17 
18 #ifndef OSFI_SRC_COMMON_CONFM_ARRAYNODE_H_
19 #define OSFI_SRC_COMMON_CONFM_ARRAYNODE_H_
20 
21 #include "ConFM/base.h"
22 
27 class ArrayNode {
29  std::vector<std::string> elements_;
31  std::vector<ArrayNode> children_;
32 
38  void computeDimensionalEnvelope(std::vector<int>& cur, unsigned int startIdx) const;
39 
40 public:
42  ArrayNode() = default;
44  ArrayNode(std::vector<std::string> elements, std::vector<ArrayNode> children);
46  const std::vector<std::string>& getElements() const;
48  const std::vector<ArrayNode>& getChildren() const;
49 
51  int getDegree() const;
52 
58  std::vector<int> getDimsEnvelope() const;
59 
63  const ArrayNode& getChild(int i) const;
64 
66  bool isLeaf() const;
67 
69  std::vector<std::string> getVectorString() const;
70 
72  std::vector<std::string> getVectorFile() const;
73 
75  std::vector<double> getVectorDouble() const;
76 
78  std::vector<int> getVectorInt() const;
79 
81  std::vector<bool> getVectorBoolean() const;
82 
84  std::vector<osfi::confm::TimeValue> getVectorTime() const;
85 };
86 
87 #endif /* OSFI_SRC_COMMON_CONFM_ARRAYNODE_H_ */
OSFI-C++ header common to many classes in the ConFM module.
Definition: ArrayNode.h:27
int getDegree() const
const ArrayNode & getChild(int i) const
std::vector< int > getDimsEnvelope() const
std::vector< bool > getVectorBoolean() const
ArrayNode()=default
Default constructor, creates a leaf node with no children.
bool isLeaf() const
const std::vector< std::string > & getElements() const
Direct access to the unparsed data elements, only meaningful for leaf nodes.
std::vector< osfi::confm::TimeValue > getVectorTime() const
std::vector< int > getVectorInt() const
const std::vector< ArrayNode > & getChildren() const
Direct access to the child nodes, only meaningful for non-leaf nodes.
std::vector< std::string > getVectorString() const
std::vector< double > getVectorDouble() const
std::vector< std::string > getVectorFile() const
ArrayNode(std::vector< std::string > elements, std::vector< ArrayNode > children)
Data constructor, only one of elements and children may be non-empty.