itom  3.0.0
ito::ParamBase Class Reference
Inheritance diagram for ito::ParamBase:
ito::Param

Public Types

enum  Type {
  NoAutosave = 0x010000, Readonly = 0x020000, In = 0x040000, Out = 0x080000,
  NotAvailable = 0x100000, Pointer = 0x000001, Char = 0x000002, Int = 0x000004,
  Double = 0x000008, Complex = 0x000400, DObjPtr = 0x000010 | Pointer | NoAutosave, String = 0x000020 | Pointer,
  HWRef = 0x000040 | Pointer | NoAutosave, CharArray = Char | Pointer, IntArray = Int | Pointer, DoubleArray = Double | Pointer,
  ComplexArray = Complex | Pointer, PointCloudPtr = 0x000080 | Pointer | NoAutosave, PointPtr = 0x000100 | Pointer | NoAutosave, PolygonMeshPtr = 0x000200 | Pointer | NoAutosave
}
 

Public Member Functions

 ParamBase ()
 default constructor, creates "empty" ParamBase
 
 ParamBase (const ByteArray &name)
 
 ParamBase (const ByteArray &name, const uint32 type)
 
 ParamBase (const ByteArray &name, const uint32 type, const char *val)
 
 ParamBase (const ByteArray &name, const uint32 type, const float64 val)
 
 ParamBase (const ByteArray &name, const uint32 type, const int32 val)
 
 ParamBase (const ByteArray &name, const uint32 type, const complex128 val)
 
 ParamBase (const ByteArray &name, const uint32 type, const uint32 size, const char *values)
 
 ParamBase (const ByteArray &name, const uint32 type, const uint32 size, const int32 *values)
 
 ParamBase (const ByteArray &name, const uint32 type, const uint32 size, const float64 *values)
 
 ParamBase (const ByteArray &name, const uint32 type, const uint32 size, const complex128 *values)
 
virtual ~ParamBase ()
 
 ParamBase (const ParamBase &copyConstr)
 
const ParamBase operator[] (const int num) const
 braces operator for element-wise access in arrays More...
 
ParamBaseoperator= (const ParamBase &rhs)
 assignment operator (sets values of lhs to values of rhs Param, strings are copied) More...
 
ito::RetVal copyValueFrom (const ito::ParamBase *rhs)
 just copies the value from the right-hand-side tParam (rhs) to this tParam.
 
bool operator== (const ParamBase &rhs) const
 
bool operator!= (const ParamBase &rhs) const
 
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.
 
uint32 getType (bool filterFlags=true) const
 returns parameter type (autosave flag and other flags (like in, out or readonly) are only included if filterFlags is set false)
 
uint32 getFlags (void) const
 returns parameter flags
 
void setFlags (const uint32 flags)
 sets parameter flagsfor possible flags see tParamType
 
const char * getName (void) const
 returns parameter name (returned string is no copy, do not delete it)
 
bool getAutosave (void) const
 
void setAutosave (const bool autosave)
 
int getLen (void) const
 returns length of array parameters or -1 if no array is given. For string parameter returns length of string or 0 if not given, for number parameters return 1. In all other cases -1.
 
template<typename _Tp >
ito::RetVal setVal (_Tp val)
 
template<typename _Tp >
ito::RetVal setVal (_Tp val, int len)
 
template<typename _Tp >
_Tp getVal (void) const
 
template<typename _Tp >
_Tp getVal (int &len) const
 

Protected Member Functions

void inOutCheck ()
 

Static Protected Member Functions

static uint32 typeFilter (uint32 type)
 

Protected Attributes

uint32 m_type
 
ByteArray m_name
 parameter name
 

Private Attributes

complex128_ m_dVal
 internal value for float64 and complex128 typed values
 
ito::int32 m_iVal
 internal value for integer typed values
 
char * m_cVal
 internal pointer for pointer type values (also strings)
 

Constructor & Destructor Documentation

ito::ParamBase::ParamBase ( const ByteArray name)

constructor with name only

Parameters
[in]namename of new ParamBase
Returns
new ParamBase name "name"

creates a new ParamBase with name "name", string is copied

ito::ParamBase::ParamBase ( const ByteArray name,
const uint32  type 
)

constructor with name and type

Parameters
[in]namename of new ParamBase
[in]typetype of new ParamBase for possible types see Type
Returns
new Param with name and type

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

ito::ParamBase::ParamBase ( const ByteArray name,
const uint32  type,
const char *  val 
)

constructor with name and type, char val and optional info

Parameters
[in]namename of new ParamBase
[in]typetype of new ParamBase for possible types see Type
[in]valcharacter pointer to string pointer
[in]infocharacter pointer to string pointer holding information about this ParamBase
Returns
new ParamBase with name, type, string value

creates a new ParamBase with name, type, string value. Strings are copied

ito::ParamBase::ParamBase ( const ByteArray name,
const uint32  type,
const float64  val 
)

constructor with name and type, float64 val

Parameters
[in]namename of new ParamBase
[in]typetype of new ParamBase for possible types see Type
[in]valactual value
Returns
new ParamBase with name, type and val

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

ito::ParamBase::ParamBase ( const ByteArray name,
const uint32  type,
const int32  val 
)

constructor with name and type and int val

Parameters
[in]namename of new ParamBase
[in]typetype of new ParamBase for possible types see Type
[in]valactual value
Returns
new ParamBase with name, type andval.

creates a new ParamBase with name, type and val

ito::ParamBase::ParamBase ( const ByteArray name,
const uint32  type,
const complex128  val 
)

constructor with name and type, double val

Parameters
[in]namename of new ParamBase
[in]typetype of new ParamBase for possible types see Type
[in]valactual value
Returns
new ParamBase with name, type and val

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

ito::ParamBase::~ParamBase ( )
virtual

destructor

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

ito::ParamBase::ParamBase ( const ParamBase copyConstr)

copy constructor

Parameters
[in]copyConstrParamBase to copy from
Returns
new ParamBase with copied values

creates ParamBase according to passed Param, strings are copied

Member Function Documentation

bool ito::ParamBase::getAutosave ( void  ) const
inline

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)

template<typename _Tp >
_Tp ito::ParamBase::getVal ( void  ) const
inline

getVal read parameter value - templated version

Returns
parameter value (numeric, casted)

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.

template<typename _Tp >
_Tp ito::ParamBase::getVal ( int &  len) const
inline

getVal read parameter value - templated version for arrays

Parameters
[out]lenlength of array

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.

ParamBase & ito::ParamBase::operator= ( const ParamBase rhs)

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

assignment operator

Parameters
[in]rhsParamBase to copy from
Returns
new ParamBase with copied values

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

const ParamBase ito::ParamBase::operator[] ( const int  num) const

braces operator for element-wise access in arrays

braces operator

Parameters
[in]numarray index for which the value should be returned
Returns
new tParam with values of ParamBase[num] in the array

returns the value of the index num from the array

void ito::ParamBase::setAutosave ( const bool  autosave)
inline

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 ito::ParamBase::setVal ( _Tp  val)
inline

setVal set parameter value - templated version

Parameters
[in]valvalue 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 >
ito::RetVal ito::ParamBase::setVal ( _Tp  val,
int  len 
)
inline

setVal set parameter value - templated version for arrays

Parameters
[in]valvalue to set to
[in]lenlength 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

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