OSFI-C++  3.10.0
OpenSF Integration Library
Parameter.h
Go to the documentation of this file.
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 
17 #ifndef OSFI_CONFM_PARAMETER_H_
18 #define OSFI_CONFM_PARAMETER_H_
19 
20 #include "ConFM/base.h"
21 #include "ConFM/DynamicArray.h"
22 #include "ConFM/ArrayNode.h"
23 
24 using namespace std;
25 
32 class Parameter final
33 {
34 public:
38  using ElementType = osfi::confm::ElementType; // Alias kept for API compatibility
39 
51  Parameter(string aName, string aDescription, string aType,
52  ArrayNode root, string aUnits, string aMin, string aMax, vector<int> dims);
53 
61  Parameter(string aName, string aDescription, string aType, string aValue);
62 
74  Parameter(string aName, string aDescription, string aType, string aValue,
75  string aUnits, string aMin, string aMax, vector<int> dims);
76 
84  Parameter(string aName, string aMin, string aMax);
85 
90 
94  void print() const;
95 
101  OSFI_DEPRECATED("Ambiguously-named function to be removed, use getRawValue instead.")
102  string getValue();
103 
108  string getRawValue() const;
109 
114  int getIntValue() const;
115 
120  double getDoubleValue() const;
121 
126  bool getBooleanValue() const;
127 
132  string getStringValue() const;
133 
138  osfi::confm::TimeValue getTimeValue() const;
139 
146  string getFileValue() const;
147 
152  vector<string> getVectorString() const;
153 
160  vector<string> getVectorFile() const;
161 
166  vector<double> getVectorDouble() const;
167 
172  vector<int> getVectorInt() const;
173 
178  vector<bool> getVectorBoolean() const;
179 
184  vector<osfi::confm::TimeValue> getVectorTime() const;
185 
190  DynamicArray<double> getMatrixDouble() const;
191 
196  DynamicArray<int> getMatrixInt() const;
197 
202  DynamicArray<string> getMatrixString() const;
203 
210  DynamicArray<string> getMatrixFile() const;
211 
216  DynamicArray<bool> getMatrixBoolean() const;
217 
222  DynamicArray<osfi::confm::TimeValue> getMatrixTime() const;
223 
235  DynamicArray<bool> fileExist() const;
236 
241  void setValue(string aValue);
242 
246  int getNdims() const;
247 
252  const vector<int>& getDims() const;
253 
258  OSFI_DEPRECATED("Ambiguous function, instead use getLocalName or getPath")
259  string getName();
260 
264  string getLocalName() const;
265 
269  string getPath() const;
270 
274  string getDescription() const;
275 
279  string getUnits() const;
280 
284  string getMax() const;
285 
289  string getMin() const;
290 
294  string getType() const;
295 
301  OSFI_DEPRECATED("Superseded by getElementType and isArray")
302  int getParamType();
303 
305  ElementType getElementType() const;
306 
310  static const string delimitier;
311 
315  static const string stringDelimitier;
316 
319  bool isArray() const;
320 
322  const ArrayNode& getRootNode() const;
326  const ArrayNode& getNode(const vector<int>& indexs) const;
328  vector<bool> getVectorBoolean(const vector<int>& indexs) const;
330  vector<string> getVectorString(const vector<int>& indexs) const;
332  vector<string> getVectorFile(const vector<int>& indexs) const;
334  vector<double> getVectorDouble(const vector<int>& indexs) const;
336  vector<int> getVectorInt(const vector<int>& indexs) const;
338  vector<osfi::confm::TimeValue> getVectorTime(const vector<int>& indexs) const;
340  int getDims(const vector<int>& indexs) const;
342  bool isLeaf(const vector<int>& indexs) const;
343 
344 private:
350  bool FileExists(const string& strFilename) const;
351 
352  string name;
353  string description;
354  ElementType elType;
355  string value_;
356  string units;
357  string min;
358  string max;
359  vector<int> dims;
360  ArrayNode root_;
361  bool isArrayParam = false;
362 };
363 
364 #endif // OSFI_CONFM_PARAMETER_H_
#define OSFI_DEPRECATED(reason)
Definition: CLP.h:25
OSFI-C++ header common to many classes in the ConFM module.
Definition: ArrayNode.h:27
Definition: DynamicArray.h:27
Definition: Parameter.h:33
Parameter(string aName, string aDescription, string aType, string aValue)
Parameter(string aName, string aMin, string aMax)
void print() const
Parameter(string aName, string aDescription, string aType, string aValue, string aUnits, string aMin, string aMax, vector< int > dims)
Parameter(string aName, string aDescription, string aType, ArrayNode root, string aUnits, string aMin, string aMax, vector< int > dims)
ElementType
Definition: base.h:39