OSFI-C++  3.10.1
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 
85  OSFI_DEPRECATED("Use the constructor with 8 arguments instead.")
86  Parameter(string aName, string aMin, string aMax);
87 
92 
96  void print() const;
97 
103  OSFI_DEPRECATED("Ambiguously-named function to be removed, use getRawValue instead.")
104  string getValue();
105 
110  string getRawValue() const;
111 
116  int getIntValue() const;
117 
122  double getDoubleValue() const;
123 
128  bool getBooleanValue() const;
129 
134  string getStringValue() const;
135 
140  osfi::confm::TimeValue getTimeValue() const;
141 
148  string getFileValue() const;
149 
154  vector<string> getVectorString() const;
155 
162  vector<string> getVectorFile() const;
163 
168  vector<double> getVectorDouble() const;
169 
174  vector<int> getVectorInt() const;
175 
180  vector<bool> getVectorBoolean() const;
181 
186  vector<osfi::confm::TimeValue> getVectorTime() const;
187 
192  DynamicArray<double> getMatrixDouble() const;
193 
198  DynamicArray<int> getMatrixInt() const;
199 
204  DynamicArray<string> getMatrixString() const;
205 
212  DynamicArray<string> getMatrixFile() const;
213 
218  DynamicArray<bool> getMatrixBoolean() const;
219 
224  DynamicArray<osfi::confm::TimeValue> getMatrixTime() const;
225 
237  DynamicArray<bool> fileExist() const;
238 
244  OSFI_DEPRECATED("Changing values is deprecated and might not work with ARRAY parameters")
245  void setValue(string aValue);
246 
250  int getNdims() const;
251 
256  const vector<int>& getDims() const;
257 
262  OSFI_DEPRECATED("Ambiguous function, instead use getLocalName or getPath")
263  string getName();
264 
268  string getLocalName() const;
269 
273  string getPath() const;
274 
278  string getDescription() const;
279 
283  string getUnits() const;
284 
288  string getMax() const;
289 
293  string getMin() const;
294 
298  string getType() const;
299 
305  OSFI_DEPRECATED("Superseded by getElementType and isArray")
306  int getParamType();
307 
309  ElementType getElementType() const;
310 
314  static const string delimitier;
315 
319  static const string stringDelimitier;
320 
323  bool isArray() const;
324 
326  const ArrayNode& getRootNode() const;
330  const ArrayNode& getNode(const vector<int>& indexs) const;
332  vector<bool> getVectorBoolean(const vector<int>& indexs) const;
334  vector<string> getVectorString(const vector<int>& indexs) const;
336  vector<string> getVectorFile(const vector<int>& indexs) const;
338  vector<double> getVectorDouble(const vector<int>& indexs) const;
340  vector<int> getVectorInt(const vector<int>& indexs) const;
342  vector<osfi::confm::TimeValue> getVectorTime(const vector<int>& indexs) const;
344  int getDims(const vector<int>& indexs) const;
346  bool isLeaf(const vector<int>& indexs) const;
347 
348 private:
354  bool FileExists(const string& strFilename) const;
355 
356  string name;
357  string description;
358  ElementType elType;
359  string value_;
360  string units;
361  string min;
362  string max;
363  vector<int> dims;
364  ArrayNode root_;
365  bool isArrayParam = false;
366 };
367 
368 #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 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