itom
Loading...
Searching...
No Matches
ito::Param Class Reference

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

#include <param.h>

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

Classes

struct  MetaShared
 < struct for the shared container for meta information shared meta information object More...
 

Public Member Functions

 Param ()
 default constructor, creates "empty" Param
 
 Param (const ByteArray &name)
 type-less Param with name and type
 
 Param (const ByteArray &name, const uint32 typeAndFlags)
 Constructor for a string value (const char*)
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const char *val, const char *info)
 Constructor for a char value parameter (int8)
 
 Param (const ByteArray &name, const uint32 typeAndFlags, 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 typeAndFlags, 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 typeAndFlags, 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 typeAndFlags, const unsigned int size, const char *values, const char *info)
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const int32 *values, const char *info)
 < Constructor for an integer array parameter (int32)
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const float64 *values, const char *info)
 Constructor for a complex128 array parameter.
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const complex128 *values, const char *info)
 Constructor for a string list parameter.
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const ByteArray *values, const char *info)
 constructor for a character value (int8)
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const char val, ParamMeta *meta, const char *info)
 constructor for an integer value (int32)
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const int32 val, ParamMeta *meta, const char *info)
 constructor for a double value (float64)
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const float64 val, ParamMeta *meta, const char *info)
 constructor for a complex value (complex128)
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const complex128 val, ParamMeta *meta, const char *info)
 constructor for int32 arrays.
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const char *values, ParamMeta *meta, const char *info)
 constructor for int32 arrays.
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const int32 *values, ParamMeta *meta, const char *info)
 constructor for float64 arrays.
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const float64 *values, ParamMeta *meta, const char *info)
 constructor for complex128 arrays.
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const complex128 *values, ParamMeta *meta, const char *info)
 constructor for a string list.
 
 Param (const ByteArray &name, const uint32 typeAndFlags, const unsigned int size, const ByteArray *values, ParamMeta *meta, const char *info)
 Destructor.
 
 ~Param ()
 Copy-Constructor.
 
 Param (const Param &copyConstr)
 rvalue copy constructor
 
 Param (Param &&rvalue)
 
const Param operator[] (const int index) const
 < braces operator for element-wise access in arrays
 
Paramoperator= (const Param &rhs)
 rvalue assignment operator
 
Paramoperator= (Param &&rvalue) noexcept
 
ito::RetVal copyValueFrom (const ParamBase *rhs)
 
const char * getInfo () const
 < returns content of info string (string is not copied)
 
void setInfo (const char *info)
 set the info string (description) to info.
 
void setInfo (const ByteArray &info)
 
const ParamMetagetMeta () const
 
const ParamMetagetConstMeta () const
 
ParamMetagetMeta (void)
 
template<typename _Tp >
const _Tp * getMetaT (void) const
 
template<typename _Tp >
const _Tp * getConstMetaT (void) const
 
template<typename _Tp >
_Tp * getMetaT (void)
 
void setMeta (ParamMeta *meta, bool takeOwnership=false)
 sets a new ParamMeta-instance as meta information for this Param
 
float64 getMin () const
 get the maximum value of the current meta info.
 
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 typeAndFlags)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const char *val)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const float64 val)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const int32 val)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const complex128 val)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const uint32 size, const char *values)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const uint32 size, const int32 *values)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const uint32 size, const float64 *values)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const uint32 size, const complex128 *values)
 
 ParamBase (const ByteArray &name, const uint32 typeAndFlags, const uint32 size, const ByteArray *values)
 Destructor.
 
virtual ~ParamBase ()
 copy constructor
 
 ParamBase (const ParamBase &other)
 copy constructor for rvalues
 
 ParamBase (ParamBase &&other) noexcept
 
const ParamBase operator[] (const int index) const
 < braces operator for element-wise access in arrays
 
ParamBaseoperator= (const ParamBase &rhs)
 rvalue assignment operator
 
ParamBaseoperator= (ParamBase &&other) noexcept
 just copies the value from the right-hand-side tParam (rhs) to this tParam.
 
ito::RetVal copyValueFrom (const ito::ParamBase *rhs)
 
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
 
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
 
bool getAutosave () const
 
void setAutosave (const bool autosave)
 
int getLen () const
 returns length of array parameters.
 
template<typename _Tp >
ito::RetVal setVal (_Tp val)
 
template<typename _Tp >
ito::RetVal setVal (_Tp val, int len)
 
template<typename _Tp >
_Tp getVal () const
 
template<typename _Tp >
_Tp getVal (int &len) const
 

Private Member Functions

void detachMeta ()
 
void incRefMeta (MetaShared *ms) const
 
void decRefMeta (MetaShared *ms) const
 

Private Attributes

MetaSharedm_pMetaShared
 description of this parameter
 
ByteArray m_info
 

Additional Inherited Members

- Public Types inherited from ito::ParamBase
enum  Flag {
  NoAutosave = 0x010000 , Readonly = 0x020000 , In = 0x040000 , Out = 0x080000 ,
  NotAvailable = 0x100000
}
 < Flag section, new for itom > 4.1. Before it was part of the Type enumeration.
 
enum  Type {
  Pointer = 0x0001 , Char = 0x0002 , Int = 0x0004 , Double = 0x0008 ,
  Complex = 0x0400 , DObjPtr = 0x0010 | Pointer , String = 0x0020 | Pointer , HWRef = 0x0040 | Pointer ,
  CharArray = Char | Pointer , IntArray = Int | Pointer , DoubleArray = Double | Pointer , ComplexArray = Complex | Pointer ,
  PointCloudPtr = 0x0080 | Pointer , PointPtr = 0x0100 | Pointer , PolygonMeshPtr = 0x0200 | Pointer , StringList = 0x0800 | Pointer
}
 

Detailed Description

class for parameter handling e.g. to pass parameters 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

◆ Param() [1/2]

ito::Param::Param ( )

default constructor, creates "empty" Param

type-less Param with name only

◆ Param() [2/2]

ito::Param::Param ( const ByteArray & name,
const uint32 typeAndFlags,
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

◆ getConstMeta()

const ParamMeta * ito::Param::getConstMeta ( ) const
inline

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

◆ getConstMetaT()

template<typename _Tp >
const _Tp * ito::Param::getConstMetaT ( void ) const
inline

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

◆ getInfo()

const char * ito::Param::getInfo ( ) 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

◆ getMax()

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

◆ getMeta() [1/2]

const ParamMeta * ito::Param::getMeta ( ) const
inline

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

◆ getMeta() [2/2]

ParamMeta * ito::Param::getMeta ( void )
inline

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

◆ getMetaT()

template<typename _Tp >
const _Tp * ito::Param::getMetaT ( void ) const
inline

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

◆ getMin()

float64 ito::Param::getMin ( ) const

get the maximum value of the current meta info.

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

◆ operator=()

Param & ito::Param::operator= ( Param && rvalue)
noexcept

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

◆ operator[]()

const Param ito::Param::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)

◆ setInfo()

void ito::Param::setInfo ( const ByteArray & info)
inline

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

◆ setMeta()

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 if this Param should take the ownership of the given meta object. If false, a deep copy of the meta object is stored in this param.
See also
ito::ParamMeta get the minimum value of the current meta info.

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