8.8.4.6.1. ParamBase - Reference#

class ParamBase#

<

Subclassed by ito::Param

Public Types

enum Flag#

< Flag section, new for itom > 4.1. Before it was part of the Type enumeration.

Values:

enumerator NoAutosave#
enumerator Readonly#
enumerator In#
enumerator Out#
enumerator NotAvailable#

Public Functions

ParamBase()#

default constructor, creates “empty” ParamBase

ParamBase(const ByteArray &name)#

constructor with name only

creates a new

ParamBase with name “name”, string is copied

Parameters:

name[in] name of new ParamBase

Returns:

new ParamBase name “name”

ParamBase(const ByteArray &name, const uint32 typeAndFlags)#

constructor with name and type

creates a new

Param with name and type, string is copied

Parameters:
  • name[in] name of new ParamBase

  • type[in] type of new ParamBase for possible types see Type

Returns:

new Param with name and type

ParamBase(const ByteArray &name, const uint32 typeAndFlags, const char *val)#

constructor with name and type, char val and optional info

creates a new

ParamBase with name, type, string value. Strings are copied

Parameters:
  • name[in] name of new ParamBase

  • type[in] type of new ParamBase for possible types see Type

  • val[in] character pointer to string pointer

  • info[in] character pointer to string pointer holding information about this ParamBase

Returns:

new ParamBase with name, type, string value

ParamBase(const ByteArray &name, const uint32 typeAndFlags, const float64 val)#

constructor with name and type, float64 val

creates a new

ParamBase with name, type and val. Strings are copied.

Parameters:
  • name[in] name of new ParamBase

  • type[in] type of new ParamBase for possible types see Type

  • val[in] actual value

Returns:

new ParamBase with name, type and val

ParamBase(const ByteArray &name, const uint32 typeAndFlags, const int32 val)#

constructor with name and type and int val

creates a new

ParamBase with name, type and val

Parameters:
  • name[in] name of new ParamBase

  • type[in] type of new ParamBase for possible types see Type

  • val[in] actual value

Returns:

new ParamBase with name, type andval.

ParamBase(const ByteArray &name, const uint32 typeAndFlags, const complex128 val)#

constructor with name and type, complex128 val

creates a new

ParamBase with name, type and val. Strings are copied.

Parameters:
  • name[in] name of new ParamBase

  • type[in] type of new ParamBase for possible types see Type

  • val[in] actual value

Returns:

new ParamBase with name, type and val

ParamBase(const ByteArray &name, const uint32 typeAndFlags, const uint32 size, const ByteArray *values)#

Destructor.

constructor with name and type, and a list of strings

creates a new

ParamBase with name, type and val. Strings are copied.

Parameters:
  • name[in] name of new ParamBase

  • type[in] type of new ParamBase for possible types see Type

  • val[in] actual value

Returns:

new ParamBase with name, type and val

virtual ~ParamBase()#

copy constructor

destructor

clear (frees) the name and in case a string value.

ParamBase(const ParamBase &other)#

copy constructor for rvalues

copy constructor

creates

ParamBase according to passed Param, strings are copied

Parameters:

copyConstr[in] ParamBase to copy from

Returns:

new ParamBase with copied values

const ParamBase operator[](const int index) const#

< braces operator for element-wise access in arrays

assignment operator (sets values of lhs to values of rhs Param, strings are copied)

braces operator

returns the value of the index num from the array

Parameters:

num[in] array index for which the value should be returned

Returns:

new tParam with values of ParamBase[num] in the array

ParamBase &operator=(const ParamBase &rhs)#

rvalue assignment operator

assignment operator

sets values of lhs to values of rhs

ParamBase, strings are copied

Parameters:

rhs[in] ParamBase to copy from

Returns:

new ParamBase with copied values

inline ParamBase &operator=(ParamBase &&other) noexcept#

just copies the value from the right-hand-side tParam (rhs) to this tParam.

bool isNumeric(void) const#

returns true if Param is of type char, int, double or complex

bool isNumericArray(void) const#

returns true if Param is of type char array, int array, double array or complex array

bool isValid(void) const#

returns whether Param contains a valid type (true) or is an empty parameter (false, type == 0). The default tParam-constructor is always an invalid tParam.

uint16 getType() const#

returns parameter type

uint32 getFlags() const#

returns parameter flags

void setFlags(const uint32 flags)#

sets parameter flags for possible flags see tParamType

const char *getName(void) const#

returns parameter name (returned string is no copy, do not delete it)

ito::ByteArray getNameWithIndexSuffix(int index) const#

return the name, where an integer index is appended with bracket squares, e.g. myArray becomes myArray[2].

bool getAutosave() const#

returns content of autosave flag - this flag determines whether the parameter value gets automagically saved to xml file when an instance of a plugin class is deleted (closed)

void setAutosave(const bool autosave)#

sets content of autosave flag - this flag determines whether the parameter value gets automagically saved to xml file when an instance of a plugin class is deleted (closed)

int getLen() const#

returns length of array parameters.

template<typename _Tp>
inline ito::RetVal setVal(_Tp val)#

setVal set parameter value - templated version

Parameters:

val[in] value to set to

Returns:

RetVal with operation status sets the parameter value to the passed value, if the parameter type is inadequate it is set to the maximum value of template type

template<typename _Tp>
inline ito::RetVal setVal(_Tp val, int len)#

setVal set parameter value - templated version for arrays

Parameters:
  • val[in] value to set to

  • len[in] length of array

Returns:

RetVal with operation status sets the parameter value to the passed value, if the length is below 1 or a Null pointer is passed an error is returned

template<typename _Tp>
inline _Tp getVal() const#

getVal read parameter value - templated version

returns the actual parameter value casted to the template parameter type. If the tParam has a non numeric type the largest value for the template type is passed.

Returns:

parameter value (numeric, casted)

template<typename _Tp>
inline _Tp getVal(int &len) const#

getVal read parameter value - templated version for arrays

returns the actual parameter value casted to the template parameter type. In ‘len’ is returned what is supposed to be the length of the array. As only array references are used within tParam the actual size may differ.

Parameters:

len[out] length of array