ParamBase - ReferenceΒΆ

class ito::ParamBase

Public Functions

ParamBase()

default constructor, creates “empty” tParam

ParamBase(const ByteArray & name)

constructor with name only creates a new ParamBase with name “name”, string is copied

Return
new ParamBase name “name”
Parameters

ParamBase(const ByteArray & name, const uint32 type)

constructor with name and type creates a new Param with name and type, string is copied

Return
new Param with name and type
Parameters

ParamBase(const ByteArray & name, const uint32 type, 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

Return
new ParamBase with name, type, string value
Parameters
  • name -

    name of new ParamBase

  • type -

    type of new ParamBase for possible types see Type

  • val -

    character pointer to string pointer

  • info -

    character pointer to string pointer holding information about this ParamBase

ParamBase(const ByteArray & name, const uint32 type, const double val)

constructor with name and type, double val creates a new ParamBase with name, type and val. Strings are copied.

Return
new ParamBase with name, type and val
Parameters
  • name -

    name of new ParamBase

  • type -

    type of new ParamBase for possible types see Type

  • val -

    actual value

ParamBase(const ByteArray & name, const uint32 type, const int val)

constructor with name and type and int val creates a new ParamBase with name, type and val

Return
new ParamBase with name, type andval.
Parameters
  • name -

    name of new ParamBase

  • type -

    type of new ParamBase for possible types see Type

  • val -

    actual value

ParamBase(const ByteArray & name, const uint32 type, const unsigned int size, const char * values)

array constructor with name and type, size and array creates a new ParamBase (array) with name, type, size and values.

Return
new ParamBase (array) with name, type, size and values.
Parameters
  • name -

    name of new ParamBase

  • type -

    type of new ParamBase for possible types see Type

  • size -

    array size

  • val -

    values

ParamBase(const ByteArray & name, const uint32 type, const unsigned int size, const int * values)

array constructor with name and type, size and array creates a new ParamBase (array) with name, type, size and values.

Return
new ParamBase (array) with name, type, size and values.
Parameters
  • name -

    name of new ParamBase

  • type -

    type of new ParamBase for possible types see Type

  • size -

    array size

  • val -

    values

ParamBase(const ByteArray & name, const uint32 type, const unsigned int size, const double * values)

array constructor with name and type, size and array creates a new ParamBase (array) with name, type, size and values.

Return
new ParamBase (array) with name, type, size and values.
Parameters
  • name -

    name of new ParamBase

  • type -

    type of new ParamBase for possible types see Type

  • size -

    array size

  • val -

    values

virtual ~ParamBase()

destructor

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

ParamBase(const ParamBase & copyConstr)

copy constructor creates ParamBase according to passed Param, strings are copied

Return
new ParamBase with copied values
Parameters

const ParamBase operator[](const int num) const

braces operator for element-wise access in arrays

braces operator returns the value of the index num from the array

Return
new tParam with values of ParamBase[num] in the array
Parameters
  • num -

    array index for which the value should be returned

ParamBase & operator=(const ParamBase & rhs)

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

assignment operator sets values of lhs to values of rhs ParamBase, strings are copied

Return
new ParamBase with copied values
Parameters

ito::RetVal copyValueFrom(const ito::ParamBase * rhs)

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 or double

bool isValid(void) const

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

uint32 getType(bool filterFlags = true) const

returns parameter type (autosave flag and optional flag are only included if filterFlags is set false)

uint32 getFlags(void) const

returns parameter flags (parameter type is not included)

uint32 setFlags(const uint32 flags)

sets parameter flags (parameter type remains untouched), for possible flags see tParamType

const char * getName(void) const

returns parameter name (string is not copid)

uint32 getAutosave(void) 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 uint32 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)

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

setVal set parameter value - templated version

Return
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
Parameters
  • val -

    value to set to

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

setVal set parameter value - templated version for arrays

Return
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
Parameters
  • val -

    value to set to

  • len -

    length of array

template <typename _Tp>
_Tp getVal(void) 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.

Return
parameter value (numeric, casted)

template <typename _Tp>
_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 -

    length of array