itom  4.1.0
ito::Param Class Reference

class for parameter handling e.g. to pass paramters to plugins More...

#include <param.h>

Inheritance diagram for ito::Param:
ito::ParamBase

Public Member Functions

 Param ()
 default constructor, creates "empty" Param More...
 
 Param (const ByteArray &name)
 type-less Param with name and type
 
 Param (const ByteArray &name, const uint32 type)
 Constructor for a string value (const char*)
 
 Param (const ByteArray &name, const uint32 type, const char *val, const char *info)
 Constructor for a char value parameter (int8)
 
 Param (const ByteArray &name, const uint32 type, const char minVal, const char maxVal, const char val, const char *info)
 Constructor for an integer value parameter (int32)
 
 Param (const ByteArray &name, const uint32 type, const int32 minVal, const int32 maxVal, const int32 val, const char *info)
 Constructor for an double value parameter (float64)
 
 Param (const ByteArray &name, const uint32 type, const float64 minVal, const float64 maxVal, const float64 val, const char *info)
 Constructor for a character array parameter (int8)
 
 Param (const ByteArray &name, const uint32 type, const unsigned int size, const char *values, const char *info)
 
 Param (const ByteArray &name, const uint32 type, const unsigned int size, const int32 *values, const char *info)
 < Constructor for an integer array parameter (int32) More...
 
 Param (const ByteArray &name, const uint32 type, const unsigned int size, const float64 *values, const char *info)
 Constructor for a complex128 array parameter.
 
 Param (const ByteArray &name, const uint32 type, const unsigned int size, const complex128 *values, const char *info)
 constructor for a character value (int8)
 
 Param (const ByteArray &name, const uint32 type, const char val, ParamMeta *meta, const char *info)
 constructor for an integer value (int32)
 
 Param (const ByteArray &name, const uint32 type, const int32 val, ParamMeta *meta, const char *info)
 constructor for a double value (float64)
 
 Param (const ByteArray &name, const uint32 type, const float64 val, ParamMeta *meta, const char *info)
 constructor for a complex value (complex128)
 
 Param (const ByteArray &name, const uint32 type, const complex128 val, ParamMeta *meta, const char *info)
 constructor for int32 arrays.
 
 Param (const ByteArray &name, const uint32 type, const unsigned int size, const char *values, ParamMeta *meta, const char *info)
 constructor for int32 arrays.
 
 Param (const ByteArray &name, const uint32 type, const unsigned int size, const int32 *values, ParamMeta *meta, const char *info)
 constructor for float64 arrays.
 
 Param (const ByteArray &name, const uint32 type, const unsigned int size, const float64 *values, ParamMeta *meta, const char *info)
 constructor for complex128 arrays.
 
 Param (const ByteArray &name, const uint32 type, const unsigned int size, const complex128 *values, ParamMeta *meta, const char *info)
 Destructor.
 
 ~Param ()
 Copy-Constructor.
 
 Param (const Param &copyConstr)
 
const Param operator[] (const int num) const
 braces operator for element-wise access in arrays
 
Paramoperator= (const Param &rhs)
 assignment operator (sets values of lhs to values of rhs Param, strings are copied)
 
ito::RetVal copyValueFrom (const ParamBase *rhs)
 just copies the value from the right-hand-side ParamBase (rhs) to this tParam.
 
const char * getInfo (void) const
 < returns content of info string (string is not copied) More...
 
void setInfo (const char *info)
 
void setInfo (const ByteArray &info)
 
const ParamMetagetMeta (void) const
 returns const-pointer to meta-information instance or NULL if not available. Cast this pointer to the right class of the parameter.
 
ParamMetagetMeta (void)
 returns pointer to meta-information instance or NULL if not available. Cast this pointer to the right class of the parameter. More...
 
template<typename _Tp >
const _Tp * getMetaT (void) const
 returns pointer to meta-information instance casted to '_Tp*' or NULL if not available or cast failed.
 
template<typename _Tp >
_Tp * getMetaT (void)
 
void setMeta (ParamMeta *meta, bool takeOwnership=false)
 sets a new ParamMeta-instance as meta information for this Param More...
 
float64 getMin () const
 
float64 getMax () const
 
- Public Member Functions inherited from ito::ParamBase
 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
 

Private Attributes

ParamMetam_pMeta
 
ByteArray m_info
 

Additional Inherited Members

- Public Types inherited from ito::ParamBase
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
}
 
- Protected Member Functions inherited from ito::ParamBase
void inOutCheck ()
 < Verifies and possibly corrects the proper set of the direction flags depending on the type.
 
- Static Protected Member Functions inherited from ito::ParamBase
static uint32 typeFilter (uint32 type)
 
- Protected Attributes inherited from ito::ParamBase
uint32 m_type
 
ByteArray m_name
 parameter name
 

Detailed Description

class for parameter handling e.g. to pass paramters to plugins

The plugins use this class to organize their parameters (internally) and for the paramList which is used for type checking whilst parsing parameters passed from python to c.

Constructor & Destructor Documentation

ito::Param::Param ( )
inline

default constructor, creates "empty" Param

type-less Param with name only

ito::Param::Param ( const ByteArray name,
const uint32  type,
const unsigned int  size,
const int32 *  values,
const char *  info 
)

< Constructor for an integer array parameter (int32)

Constructor for a double array parameter (float64)

Member Function Documentation

const char* ito::Param::getInfo ( void  ) const
inline

< returns content of info string (string is not copied)

sets content of info string, if necessary the info buffer is freed first, passed string is copied

float64 ito::Param::getMax ( ) const

returns maximum value of parameter if this is available and exists.

This method is a wrapper method for ((ito::IntMeta*)getMeta())->getMax()... and returns the maximum value of the underlying meta information. It only returns a valid value for meta structures of type char, charArray, int, intArray, range, double, doubleMeta.

Returns
maximum value of Inf maximum does not exist
ParamMeta* ito::Param::getMeta ( void  )
inline

returns pointer to meta-information instance or NULL if not available. Cast this pointer to the right class of the parameter.

returns const-pointer to meta-information instance casted to 'const _Tp*' or NULL if not available or cast failed.

float64 ito::Param::getMin ( ) const

returns minimum value of parameter if this is available and exists.

This method is a wrapper method for ((ito::IntMeta*)getMeta())->getMax()... and returns the minimum value of the underlying meta information. It only returns a valid value for meta structures of type char, charArray, int, intArray, interval, range, double, doubleMeta.

Returns
minimum value of -Inf maximum does not exist
void ito::Param::setMeta ( ParamMeta meta,
bool  takeOwnership = false 
)

sets a new ParamMeta-instance as meta information for this Param

Parameters
metais the pointer to any instance derived from ParamMeta
takeOwnership(default: false) defines, whether this Param should take the ownership of the ParamMeta-instance
See also
ito::ParamMeta

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