itom
|
< More...
#include <param.h>
Classes | |
struct | Data |
< struct used as shared memory of ParamBase shared data container More... | |
Public Types | |
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 } |
Public Member Functions | |
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 | |
ParamBase & | operator= (const ParamBase &rhs) |
rvalue assignment operator | |
ParamBase & | operator= (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 | clearData (Data *data) |
void | detach (bool allocNewArray=true) |
void | decRefAndFree (Data *x) |
increments the reference counter of data | |
void | incRef (Data *x) |
depending on the type, set the default value for the autosave flag. | |
void | setDefaultAutosaveFlag () |
< depending on the type, set the default value for the autosave flag. | |
void | checkAndCorrectInOutFlag () |
< Verifies and possibly corrects the proper set of the direction flags depending on the type. | |
Private Attributes | |
Data * | d |
Friends | |
template<typename _Tp > | |
struct | ItomParamHelper |
<
enum ito::ParamBase::Type |
Enumerator | |
---|---|
Pointer | character (int8) parameter |
Char | integer (int32) parameter |
Int | double (float64) parameter |
Double | complex (complex128) parameter |
Complex | dataObject parameter (pointer, no auto-save possible) |
DObjPtr | string parameter |
String | reference to another plugin instance (pointer, no auto-save possible) |
HWRef | array of characters |
CharArray | array of integers |
IntArray | array of doubles |
DoubleArray | array of complex numbers |
ComplexArray | point cloud parameter (pointer, no auto-safe possible) |
PointCloudPtr | point parameter (pointer, no auto-safe possible) |
PointPtr | polygon mesh parameter (pointer, no auto-safe possible) |
PolygonMeshPtr | list of strings, given as ito::ByteArray |
ito::ParamBase::ParamBase | ( | const ByteArray & | name | ) |
ito::ParamBase::ParamBase | ( | const ByteArray & | name, |
const uint32 | typeAndFlags ) |
ito::ParamBase::ParamBase | ( | const ByteArray & | name, |
const uint32 | typeAndFlags, | ||
const char * | val ) |
constructor with name and type, char val and optional info
[in] | name | name of new ParamBase |
[in] | type | type of new ParamBase for possible types see Type |
[in] | val | character pointer to string pointer |
[in] | info | character pointer to string pointer holding information about this ParamBase |
creates a new ParamBase with name, type, string value. Strings are copied
ito::ParamBase::ParamBase | ( | const ByteArray & | name, |
const uint32 | typeAndFlags, | ||
const float64 | val ) |
ito::ParamBase::ParamBase | ( | const ByteArray & | name, |
const uint32 | typeAndFlags, | ||
const int32 | val ) |
ito::ParamBase::ParamBase | ( | const ByteArray & | name, |
const uint32 | typeAndFlags, | ||
const complex128 | val ) |
|
virtual |
copy constructor
destructor
clear (frees) the name and in case a string value.
ito::ParamBase::ParamBase | ( | const ParamBase & | other | ) |
|
private |
if data is currently shared with another object, detach this data d from the shared ones by making a copy. If this data is not shared, this method is a noop.
|
private |
decrements the reference counter of data. If it drops below zero the allocated memory is cleared.
bool ito::ParamBase::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)
ito::ByteArray ito::ParamBase::getNameWithIndexSuffix | ( | int | index | ) | const |
return the name, where an integer index is appended with bracket squares, e.g. myArray becomes myArray[2].
|
inline |
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.
|
inline |
getVal read parameter value - templated version for arrays
[out] | len | length 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.
bool ito::ParamBase::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.
const ParamBase ito::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
[in] | num | array index for which the value should be returned |
returns the value of the index num from the array
void ito::ParamBase::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)
|
inline |
setVal set parameter value - templated version
[in] | val | value to set to |
|
inline |
setVal set parameter value - templated version for arrays
[in] | val | value to set to |
[in] | len | length of array |
|
mutableprivate |
clears and frees memory that has been allocated by data. Does not delete data itself. Usually this method is internally called by decRefAndFree.