OSFI-C++  3.9.2
OpenSF Integration Library
Parameter Class Referencefinal

#include <Parameter.h>

Public Types

using ElementType = osfi::confm::ElementType
 

Public Member Functions

 Parameter (string aName, string aDescription, string aType, ArrayNode root, string aUnits, string aMin, string aMax, vector< int > dims)
 
 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 aMin, string aMax)
 
 Parameter ()
 
void print () const
 
virtual string getValue ()
 
string getRawValue () const
 
int getIntValue () const
 
double getDoubleValue () const
 
bool getBooleanValue () const
 
string getStringValue () const
 
osfi::confm::TimeValue getTimeValue () const
 
vector< string > getVectorString () const
 
vector< string > getVectorFile () const
 
vector< double > getVectorDouble () const
 
vector< int > getVectorInt () const
 
vector< bool > getVectorBoolean () const
 
vector< osfi::confm::TimeValuegetVectorTime () const
 
DynamicArray< double > getMatrixDouble () const
 
DynamicArray< int > getMatrixInt () const
 
DynamicArray< string > getMatrixString () const
 
DynamicArray< string > getMatrixFile () const
 
DynamicArray< bool > fileExist () const
 
DynamicArray< bool > getMatrixBoolean () const
 
DynamicArray< osfi::confm::TimeValuegetMatrixTime () const
 
string getFileValue () const
 
void setValue (string aValue)
 
int getNdims () const
 
const vector< int > & getDims () const
 
string getName ()
 
string getLocalName () const
 
string getPath () const
 
string getDescription () const
 
string getUnits () const
 
string getMax () const
 
string getMin () const
 
string getType () const
 
int getParamType ()
 
ElementType getElementType () const
 
virtual bool isArray () const
 
const ArrayNodegetRootNode () const
 
const ArrayNodegetNode (const vector< int > &indexs) const
 
vector< bool > getVectorBoolean (const vector< int > &indexs) const
 
vector< string > getVectorString (const vector< int > &indexs) const
 
vector< string > getVectorFile (const vector< int > &indexs) const
 
vector< double > getVectorDouble (const vector< int > &indexs) const
 
vector< int > getVectorInt (const vector< int > &indexs) const
 
vector< osfi::confm::TimeValuegetVectorTime (const vector< int > &indexs) const
 
int getDims (const vector< int > &indexs) const
 
bool isLeaf (const vector< int > &indexs) const
 

Static Public Attributes

static const string delimitier
 
static const string stringDelimitier
 

Protected Member Functions

string getFileFormattedValue (string file) const
 
bool FileExists (const string &strFilename) const
 

Protected Attributes

string name
 
string description
 
ElementType elType
 
string value_
 
string units
 
string min
 
string max
 
vector< int > dims
 
ArrayNode root_
 
bool isArrayParam = false
 

Detailed Description

This class encapsulates every element of information from the configuration file.

A parameter is a self-describing element that couples a name and a value, describing its contents and adding sintactic and semantic constraints.

Member Typedef Documentation

◆ ElementType

Parameter types described in the E2E-ICD Issue 1 Rev 2.2 section 2.2.6.2. Note that only element types are included; ARRAY and MATRIX types are detected and their element type is parsed.

Constructor & Destructor Documentation

◆ Parameter() [1/5]

Parameter::Parameter ( string  aName,
string  aDescription,
string  aType,
ArrayNode  root,
string  aUnits,
string  aMin,
string  aMax,
vector< int >  dims 
)

Constructor for ARRAY-type parameters.

◆ Parameter() [2/5]

Parameter::Parameter ( string  aName,
string  aDescription,
string  aType,
string  aValue 
)

Minimal constructor.

Parameters
aNameName.
aDescriptionDescription.
aTypeType. One of the names from ElementType
aValueValue.

◆ Parameter() [3/5]

Parameter::Parameter ( string  aName,
string  aDescription,
string  aType,
string  aValue,
string  aUnits,
string  aMin,
string  aMax,
vector< int >  dims 
)

Complete constructor.

Parameters
aNameName.
aDescriptionDescription.
aTypeType. One of the names from ElementType
aValueValue.
aUnitsUnits. Blank or "-" for unitless parameters.
aMinMinimum valid value.
aMaxMaximum valid value.
dimsDimensions sizes, can be empty for a scalar

◆ Parameter() [4/5]

Parameter::Parameter ( string  aName,
string  aMin,
string  aMax 
)

"Range" Constructor. Creates a parameter instance defining only its name and values range.

Parameters
aNameName.
aMinMinimum valid value.
aMaxMaximum value value.

◆ Parameter() [5/5]

Parameter::Parameter ( )

Void constructor.

Member Function Documentation

◆ fileExist()

DynamicArray<bool> Parameter::fileExist ( ) const

Check the existence of the files specified within a FILE parameter

Returns
A matrix with a boolean for each file TRUE -> file found, FALSE ->file not found A file is considered found when it is correctly located and ready to be read.

◆ FileExists()

bool Parameter::FileExists ( const string &  strFilename) const
protected

Checks if a file is found within the file system

Parameters
strFilename
Returns

◆ getBooleanValue()

bool Parameter::getBooleanValue ( ) const

Gets the value of the parameter as a boolean type.

Returns
TRUE if value = "TRUE", FALSE either way

◆ getDescription()

string Parameter::getDescription ( ) const

Gets a brief description of the parameters.

Returns
string with the description.

◆ getDims()

const vector<int>& Parameter::getDims ( ) const

Gets a vector with the size of the dimensions.

Returns
Vector with dimension sizes, may be empty for a scalar.

◆ getDoubleValue()

double Parameter::getDoubleValue ( ) const

Gets the value of the parameter as a double type.

Returns
Value as double

◆ getElementType()

ElementType Parameter::getElementType ( ) const

Returns the data type of the elements in this parameter

◆ getFileFormattedValue()

string Parameter::getFileFormattedValue ( string  file) const
protected

Gets the value of the parameter as an array of characters.

Checks the file validity

Parameters
fileString where file path name is stored
Returns
Parameter value as array of characters.

◆ getFileValue()

string Parameter::getFileValue ( ) const

Gets the value of the parameter as an array of characters.

Checks the file validity

Returns
Parameter value as array of characters.

◆ getIntValue()

int Parameter::getIntValue ( ) const

Gets the value of the parameter as an integer type.

Returns
Parameter value as integer

◆ getLocalName()

string Parameter::getLocalName ( ) const

Gets the local name of the parameter.

Returns
string with the parameter name.

◆ getMatrixBoolean()

DynamicArray<bool> Parameter::getMatrixBoolean ( ) const

Gets the value of the parameter as a dynamic matrix of boolean values.

Returns
Value as matrix of booleans.

◆ getMatrixDouble()

DynamicArray<double> Parameter::getMatrixDouble ( ) const

Gets the value of the parameter as a dynamic matrix of double values.

Returns
Value as matrix of doubles.

◆ getMatrixFile()

DynamicArray<string> Parameter::getMatrixFile ( ) const

Gets the value of the parameter as a dynamic matrix of file name values.

Returns
Value as matrix of file names.

◆ getMatrixInt()

DynamicArray<int> Parameter::getMatrixInt ( ) const

Gets the value of the parameter as a dynamic matrix of integer values.

Returns
Value as matrix of integers.

◆ getMatrixString()

DynamicArray<string> Parameter::getMatrixString ( ) const

Gets the value of the parameter as a dynamic matrix of string values.

Returns
Value as matrix of strings.

◆ getMatrixTime()

DynamicArray<osfi::confm::TimeValue> Parameter::getMatrixTime ( ) const

Gets the value of the parameter as a dynamic matrix of time code values.

Returns
Value as matrix of time codes.

◆ getMax()

string Parameter::getMax ( ) const

Gets the maximum value of the parameters.

Returns
string with the maximum value.

◆ getMin()

string Parameter::getMin ( ) const

Gets the minimum value of the parameters.

Returns
string with the minimum value.

◆ getName()

string Parameter::getName ( )

Gets the name of the parameter.

Returns
string with the parameter name.
Deprecated:
Ambiguous function, instead use getLocalName or getPath

◆ getNdims()

int Parameter::getNdims ( ) const

Gets the number of dimensions.

Returns
Dimensions number, may be 0 for a scalar.

◆ getNode()

const ArrayNode& Parameter::getNode ( const vector< int > &  indexs) const
Returns
the node at the given indices, akin to repeatedly applying ArrayNode::getChild()
Exceptions
std::out_of_rangefor invalid indices, or if too many indices are given.

◆ getParamType()

int Parameter::getParamType ( )

Gets the type of the parameter.

Returns
Integer with the type of the parameter.
Deprecated:
Use getElementType instead for the data type, and use isArray to know whether this is an ARRAY and thus the user should call getNode/getVectorX(indices) to access the data.

◆ getPath()

string Parameter::getPath ( ) const

Gets the full path of the parameter.

Returns
string with the parameter path.

◆ getRawValue()

string Parameter::getRawValue ( ) const

Returns the unparsed parameter value as a string.

◆ getRootNode()

const ArrayNode& Parameter::getRootNode ( ) const

If this parameter is of type ARRAY, returns the root node.

◆ getStringValue()

string Parameter::getStringValue ( ) const

Gets the value of the parameter as a string type.

Returns
Parameter value as a string.

◆ getTimeValue()

osfi::confm::TimeValue Parameter::getTimeValue ( ) const

Gets the value of the parameter as time code.

Returns
Parameter value as a time code.

◆ getType()

string Parameter::getType ( ) const

Gets the type of the parameter.

Returns
String with the type of the parameter.

◆ getUnits()

string Parameter::getUnits ( ) const

Gets the units of the parameters.

Returns
string with the minimum value.

◆ getValue()

virtual string Parameter::getValue ( )
virtual

Gets the parameter value as a string.

Returns
Parameter value.
Deprecated:
Use getRawValue instead.

◆ getVectorBoolean() [1/2]

vector<bool> Parameter::getVectorBoolean ( ) const

Gets the value of the parameter as a vector of booleans.

Returns
Parameter value as a vector of booleans.

◆ getVectorBoolean() [2/2]

vector<bool> Parameter::getVectorBoolean ( const vector< int > &  indexs) const

Equivalent to calling ArrayNode::getVectorBoolean() on the result of getNode()

◆ getVectorDouble() [1/2]

vector<double> Parameter::getVectorDouble ( ) const

Gets the value of the parameter as a vector of double values.

Returns
Value as vector of doubles.

◆ getVectorDouble() [2/2]

vector<double> Parameter::getVectorDouble ( const vector< int > &  indexs) const

Equivalent to calling ArrayNode::getVectorDouble() on the result of getNode()

◆ getVectorFile() [1/2]

vector<string> Parameter::getVectorFile ( ) const

Gets the value of the parameter as a vector of file names.

Returns
Parameter value as a vector of file names.

◆ getVectorFile() [2/2]

vector<string> Parameter::getVectorFile ( const vector< int > &  indexs) const

Equivalent to calling ArrayNode::getVectorFile() on the result of getNode()

◆ getVectorInt() [1/2]

vector<int> Parameter::getVectorInt ( ) const

Gets the value of the parameter as a vector of integer values.

Returns
Value as vector of integers.

◆ getVectorInt() [2/2]

vector<int> Parameter::getVectorInt ( const vector< int > &  indexs) const

Equivalent to calling ArrayNode::getVectorInt() on the result of getNode()

◆ getVectorString() [1/2]

vector<string> Parameter::getVectorString ( ) const

Gets the value of the parameter as a vector of strings.

Returns
Parameter value as a vector of strings.

◆ getVectorString() [2/2]

vector<string> Parameter::getVectorString ( const vector< int > &  indexs) const

Equivalent to calling ArrayNode::getVectorString() on the result of getNode()

◆ getVectorTime() [1/2]

vector<osfi::confm::TimeValue> Parameter::getVectorTime ( ) const

Gets the value of the parameter as a vector of time codes.

Returns
Parameter value as a vector of time codes.

◆ getVectorTime() [2/2]

vector<osfi::confm::TimeValue> Parameter::getVectorTime ( const vector< int > &  indexs) const

Equivalent to calling ArrayNode::getVectorTime() on the result of getNode()

◆ isArray()

virtual bool Parameter::isArray ( ) const
virtual

Returns true if this parameter is of type ARRAY, and thus user code should call getNode and/or the getX(indices) family of functions to access the data.

◆ print()

void Parameter::print ( ) const

Prints out to standard output a textual description of the parameter.

◆ setValue()

void Parameter::setValue ( string  aValue)

Sets the parameter value as a string.

Parameters
aValueParameter value.

Member Data Documentation

◆ delimitier

const string Parameter::delimitier
static

Character for delimiting parameter values and dimensions.

◆ description

string Parameter::description
protected

Brief description of the parameter, detailing its purpose and giving hints of its contents.

◆ dims

vector<int> Parameter::dims
protected

Size of every dimension.

Examples:

  • [1] represents an scalar type.
  • [2 2] 2x2 matrix;
  • [2 2 2] cube of 2 units per arist.

◆ elType

ElementType Parameter::elType
protected

Data type of the elements of this parameter.

◆ max

string Parameter::max
protected

Maximum value.

◆ min

string Parameter::min
protected

Minimum value.

◆ name

string Parameter::name
protected

Name of the parameter.

Will not accept non-alphanumeric characters.

◆ root_

ArrayNode Parameter::root_
protected

Data contents, if this parameter is of type ARRAY.

◆ stringDelimitier

const string Parameter::stringDelimitier
static

Character for delimiting string and file parameter values.

◆ units

string Parameter::units
protected

Units of measurement of the parameter value.

Unitless parameters can specify blank units or "-" units.

◆ value_

string Parameter::value_
protected

Parameter's value.


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