Raytrix Light Field SDK
5.0
|
A key value map class.
This class is able to map a key of a given data type to a value of one of six possible data types. A value is described by a value definition and has an initial value and a default value.
TKey | The data type of the key. |
TGroup | The data type of the group. |
Public Types | |
typedef std::map< TKey, SValueDef< TGroup > > | TMapDefs |
typedef void(* | TParamSetCallback) (const TKey &tKey, void *pvContext) |
Defines an alias representing the callback function type of parameter-set-events. More... | |
Public Member Functions | |
CKeyValueMap ()=default | |
Default constructor. More... | |
CKeyValueMap (const CKeyValueMap< TKey, TGroup > &xMap) | |
Copy constructor. More... | |
~CKeyValueMap ()=default | |
Destructor. More... | |
void | Add (const TKey &tKey, const TGroup &tGroup, const CRxString &sxName, const CRxString &sxGUID, bool bRead, bool bWrite, bool bExtern, bool bExportable, EValueType::ID eType, Constraint::CAny *pxConstraint=nullptr) |
Adds tKey. More... | |
void | Clear () |
Clears this object to its blank/initial state. More... | |
std::vector< TKey > | FilterByGroup (const TGroup &tGroup) const |
Get a list of all keys matching the given group. More... | |
template<class TValue > | |
const TValue & | Get (const TKey &tKey) const |
bool | GetAsBool (const TKey &tKey) const |
float | GetAsFloat (const TKey &tKey) const |
int | GetAsInt (const TKey &tKey) const |
std::set< TGroup > | GetGroups () const |
Gets a set of all groups. More... | |
const TKey & | GetKey (size_t nIdx) const |
Gets the key at the given index. More... | |
const SValueDef< TGroup > & | GetValueDef (const TKey &tKey) const |
Gets the value definition of the given key. More... | |
const TMapDefs & | GetValueDefs () const |
Gets the value definitions. More... | |
template<class TArray , class TValue > | |
void | GetValueRange (const TKey &tKey, size_t &nArrayLenMin, size_t &nArrayLenMax, TValue &tMin, TValue &tMax) const |
Gets the value range of the value associated with the given key. More... | |
template<class TValue > | |
void | GetValueRange (const TKey &tKey, TValue &tMin, TValue &tMax) const |
Gets the value range of the value associated with the given key. More... | |
bool | HasKey (const TKey &tKey) const |
Query if this map contains the given key. More... | |
bool | IsKeyInGroup (const TKey &tKey, const TGroup &tGroup) const |
Query if the given key is in the given group. More... | |
bool | IsReadable (const TKey &tKey) const |
Query if the value associated with the given key is readable. It must be flagged as readable and NOT extern. More... | |
template<class TValue > | |
bool | IsValid (const TKey &tKey, const TValue &tValue) const |
Query if the given value is valid for the given key. This tests the data type and possible constraints. More... | |
bool | IsWritable (const TKey &tKey) const |
Query if the value associated with the given key is writable. It must be flagged as writable and NOT extern. More... | |
CKeyValueMap< TKey, TGroup > & | operator= (const CKeyValueMap< TKey, TGroup > &xMap) |
Assignment operator. More... | |
void | Reset () |
Resets this object. More... | |
void | ResetValue (const TKey &tKey, bool bResetToInitial=false) |
Sets the value associated with the given key to its initial or its default value. More... | |
template<class TValue > | |
void | Set (const TKey &tKey, const TValue &tValue) |
template<class TValue > | |
void | SetAll (const TKey &tKey, const TValue &tDefault) |
template<class TValue > | |
void | SetDefault (const TKey &tKey, const TValue &tDefault) |
void | SetParamSetCallback (TParamSetCallback pxCallback, void *pvContext) |
Set the parameter set callback function. More... | |
size_t | Size () const |
Gets the size of this map. More... | |
CRxString | ToString (EValueType::ID eValueType) const |
Gets the string representation of the given value type. More... | |
Static Public Member Functions | |
template<class TValue > | |
static EValueType::ID | GetValueType () |
Public Attributes | |
void * | m_pvCallbackContext |
TParamSetCallback | m_pxCallback |
std::map< TKey, SValue< CRxArrayDouble > > | m_xMapArrayDouble |
std::map< TKey, SValue< CRxArrayString > > | m_xMapArrayString |
std::map< TKey, SValue< CRxArrayUInt > > | m_xMapArrayUInt |
TMapDefs | m_xMapDefs |
std::map< TKey, SValue< double > > | m_xMapDouble |
std::map< TKey, SValue< CRxString > > | m_xMapString |
std::map< TKey, SValue< unsigned > > | m_xMapUInt |
typedef std::map< TKey, SValueDef < TGroup > > Rx::CKeyValueMap< TKey, TGroup >::TMapDefs |
typedef void(* Rx::CKeyValueMap< TKey, TGroup >::TParamSetCallback) (const TKey &tKey, void *pvContext) |
Defines an alias representing the callback function type of parameter-set-events.
|
default |
Default constructor.
|
inline |
Copy constructor.
xMap | The map to copy. |
|
default |
Destructor.
|
inline |
Adds tKey.
tKey | The key. |
tGroup | The group. |
sxName | Name of the sx. |
sxGUID | Unique identifier for the sx. |
bRead | true if the data was read. |
bWrite | true to write. |
bExtern | true to extern. |
bExportable | true if exportable. |
eType | The type. |
pxConstraint | (Optional) the constraint. |
|
inline |
Clears this object to its blank/initial state.
|
inline |
Get a list of all keys matching the given group.
tGroup | Only return keys of this group. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Gets a set of all groups.
|
inline |
Gets the key at the given index.
nIdx | The index. |
|
inline |
Gets the value definition of the given key.
tKey | The key. |
|
inline |
Gets the value definitions.
|
inline |
Gets the value range of the value associated with the given key.
TArray | The array type. |
TValue | The data type of the value. |
tKey | The key. |
nArrayLenMin | [out] The array length minimum. |
nArrayLenMax | [out] The array length maximum. |
tMin | [out] The minimum. |
tMax | [out] The maximum. |
|
inline |
Gets the value range of the value associated with the given key.
TValue | The data type of the value. |
tKey | The key. |
tMin | [out] The minimum. |
tMax | [out] The maximum. |
|
inlinestatic |
|
inline |
Query if this map contains the given key.
tKey | The key to test for containment. |
|
inline |
Query if the given key is in the given group.
tKey | The key. |
tGroup | The group. |
|
inline |
Query if the value associated with the given key is readable. It must be flagged as readable and NOT extern.
tKey | The key. |
|
inline |
Query if the given value is valid for the given key. This tests the data type and possible constraints.
TValue | The data type of the value. |
tKey | The key. |
tValue | The value. |
|
inline |
Query if the value associated with the given key is writable. It must be flagged as writable and NOT extern.
tKey | The key. |
|
inline |
Assignment operator.
xMap | The map. |
|
inline |
Resets this object.
|
inline |
Sets the value associated with the given key to its initial or its default value.
tKey | The key. |
bResetToInitial | (Optional) True to reset to initial, false to reset to default. |
|
inline |
|
inline |
|
inline |
|
inline |
Set the parameter set callback function.
pxCallback | The callback. |
pvContext | [in] A context pointer. |
|
inline |
Gets the size of this map.
|
inline |
Gets the string representation of the given value type.
eValueType | The value type. |
void* Rx::CKeyValueMap< TKey, TGroup >::m_pvCallbackContext |
TParamSetCallback Rx::CKeyValueMap< TKey, TGroup >::m_pxCallback |
std::map< TKey, SValue < CRxArrayDouble > > Rx::CKeyValueMap< TKey, TGroup >::m_xMapArrayDouble |
std::map< TKey, SValue < CRxArrayString > > Rx::CKeyValueMap< TKey, TGroup >::m_xMapArrayString |
std::map< TKey, SValue < CRxArrayUInt > > Rx::CKeyValueMap< TKey, TGroup >::m_xMapArrayUInt |
TMapDefs Rx::CKeyValueMap< TKey, TGroup >::m_xMapDefs |
std::map< TKey, SValue < double > > Rx::CKeyValueMap< TKey, TGroup >::m_xMapDouble |
std::map< TKey, SValue < CRxString > > Rx::CKeyValueMap< TKey, TGroup >::m_xMapString |
std::map< TKey, SValue < unsigned > > Rx::CKeyValueMap< TKey, TGroup >::m_xMapUInt |