|
SHOGUN
4.1.0
|
parameter struct
Definition at line 32 of file base/Parameter.h.
Public Member Functions | |
| TParameter (const TSGDataType *datatype, void *parameter, const char *name, const char *description) | |
| ~TParameter () | |
| void | print (const char *prefix) |
| bool | save (CSerializableFile *file, const char *prefix="") |
| bool | load (CSerializableFile *file, const char *prefix="") |
| bool | equals (TParameter *other, float64_t accuracy=0.0, bool tolerant=false) |
| bool | copy (TParameter *target) |
| bool | operator== (const TParameter &other) const |
| bool | operator< (const TParameter &other) const |
| bool | operator> (const TParameter &other) const |
| void | get_incremental_hash (uint32_t &hash, uint32_t &carry, uint32_t &total_length) |
| bool | is_valid () |
Static Public Member Functions | |
| static bool | compare_ptype (EPrimitiveType ptype, void *data1, void *data2, float64_t accuracy=0.0, bool tolerant=false) |
| static bool | compare_stype (EStructType stype, EPrimitiveType ptype, void *data1, void *data2, float64_t accuracy=0.0, bool tolerant=false) |
| static bool | copy_ptype (EPrimitiveType ptype, void *source, void *target) |
| static bool | copy_stype (EStructType stype, EPrimitiveType ptype, void *source, void *target) |
Public Attributes | |
| TSGDataType | m_datatype |
| void * | m_parameter |
| char * | m_name |
| char * | m_description |
|
explicit |
explicit constructor
| datatype | datatype |
| parameter | pointer to parameter |
| name | name of parameter |
| description | description of parameter |
Definition at line 1782 of file Parameter.cpp.
| ~TParameter | ( | ) |
destructor
Definition at line 1791 of file Parameter.cpp.
|
static |
Given two pointers to a scalar element of a given primitive-type, this method compares the values up to a given accuracy.
If the type of the data is SGObject, recursively calls equals on the object.
| ptype | primitive type of both data |
| data1 | pointer 1 |
| data2 | pointer 2 |
| accuracy | accuracy to compare |
| tolerant | allows linient check on float equality (within accuracy) |
ensure that no NULL data are de-referenced
Definition at line 3107 of file Parameter.cpp.
|
static |
Given two pointers to a string element of a given primitive-type, this method compares the values up to a given accuracy.
If the type of the data is SGObject, recursively calls equals on the object.
| stype | string type of both data |
| ptype | primitive type of both data |
| data1 | pointer 1 |
| data2 | pointer 2 |
| accuracy | accuracy to compare |
| tolerant | allows linient check on float equality (within accuracy) |
Definition at line 3496 of file Parameter.cpp.
| bool copy | ( | TParameter * | target | ) |
copy this to parameter target
| target | where this should be copied to |
Definition at line 3770 of file Parameter.cpp.
|
static |
copy primitive type from source to target
| ptype | the primitive type |
| source | from where to copy |
| target | where to copy to |
Definition at line 3352 of file Parameter.cpp.
|
static |
copy structured type from source to target
| stype | the structured type |
| ptype | the primitive type that the structured objects use |
| source | from where to copy |
| target | where to copy to |
Definition at line 3624 of file Parameter.cpp.
| bool equals | ( | TParameter * | other, |
| float64_t | accuracy = 0.0, |
||
| bool | tolerant = false |
||
| ) |
Numerically this instance with another instance. Compares recursively in case of non-numerical parameters
| other | other instance to compare with |
| accuracy | accuracy for numerical comparison |
| tolerant | allows linient check on float equality (within accuracy) |
Definition at line 2962 of file Parameter.cpp.
| void get_incremental_hash | ( | uint32_t & | hash, |
| uint32_t & | carry, | ||
| uint32_t & | total_length | ||
| ) |
Incrementally get a hash from parameter value
| hash | current hash value |
| carry | value for incremental murmur hashing |
| total_length | byte length of parameters. Function will add byte length to received value |
Definition at line 2423 of file Parameter.cpp.
| bool is_valid | ( | ) |
test if parameter can be validly accessed, e.g., in case of a list/vector/matrix of objects the list/vector/matrix has non-zero length
Definition at line 2507 of file Parameter.cpp.
| bool load | ( | CSerializableFile * | file, |
| const char * | prefix = "" |
||
| ) |
load from serializable file
| file | source file |
| prefix | prefix |
Definition at line 2612 of file Parameter.cpp.
| bool operator< | ( | const TParameter & | other | ) | const |
operator for comparison (by string m_name)
Definition at line 2952 of file Parameter.cpp.
| bool operator== | ( | const TParameter & | other | ) | const |
operator for comparison, (by string m_name)
Definition at line 2945 of file Parameter.cpp.
| bool operator> | ( | const TParameter & | other | ) | const |
operator for comparison (by string m_name)
Definition at line 2957 of file Parameter.cpp.
| void print | ( | const char * | prefix | ) |
| bool save | ( | CSerializableFile * | file, |
| const char * | prefix = "" |
||
| ) |
save to serializable file
| file | destination file |
| prefix | prefix |
Definition at line 2513 of file Parameter.cpp.
| TSGDataType m_datatype |
type of parameter
Definition at line 141 of file base/Parameter.h.
| char* m_description |
description of parameter
Definition at line 147 of file base/Parameter.h.
| char* m_name |
name of parameter
Definition at line 145 of file base/Parameter.h.
| void* m_parameter |
pointer to parameter
Definition at line 143 of file base/Parameter.h.