APEX Framework: NvParameterized::Handle Class Reference

NVIDIA APEX

NvParameterized::Handle Class Reference

Provides access to individual parameters within the NvParameterized object. More...

#include <NvParameterized.h>

List of all members.

Public Types

enum  { MAX_DEPTH = 16 }

Public Member Functions

PX_INLINE Handle (::NvParameterized::Interface *iface)
 The constructor takes a pointer (if the user requires an instance before the NvParameterized::Interface exists)
PX_INLINE Handle (::NvParameterized::Interface &iface)
 The constructor takes a reference.
PX_INLINE Handle (const ::NvParameterized::Interface &iface)
 The constructor takes a const interface.
PX_INLINE Handle (const Handle &param_handle)
 Copy constructor.
PX_INLINE Handle (::NvParameterized::Interface &instance, const char *longName)
 This constructor allows the user to create a handle that initially points at a particular parameter in the instance.
PX_INLINE Handle (const ::NvParameterized::Interface &instance, const char *longName)
 This constructor allows the user to create a handle that initially points at a particular parameter in the instance.
PX_INLINE const DefinitionparameterDefinition (void) const
 Get the parameter Definition for the handle's parameter.
PX_INLINE int32_t numIndexes (void) const
 Get the depth of the handle within the NvParameterized object.
PX_INLINE int32_t index (int32_t i) const
 Get the index at the specified depth within the NvParameterized object.
PX_INLINE int32_t popIndex (int32_t levels=1)
 Reduce the handle's depth within the NvParameterized object.
PX_INLINE ErrorType set (const ::NvParameterized::Interface *instance, const Definition *root, const char *child_long_name)
 Set the Handle so it references a parameter in the specified instance with the name child_long_name.
PX_INLINE ErrorType set (const ::NvParameterized::Interface *instance, const char *child_long_name)
 Set the Handle so it references a parameter in the specified instance with the name child_long_name.
PX_INLINE ErrorType getParameter (const char *longName)
 Get the parameter specified by longName and set the Handle to point it Given a long name like "mystruct.somearray[10].foo", it will return a handle to that specific parameter. The handle can then be used to set/get values, as long as it's a handle to a leaf node.
PX_INLINE ErrorType set (int32_t child_index)
 Set the depth of the handle within the handle's parameter.
PX_INLINE ErrorType getChildHandle (const ::NvParameterized::Interface *instance, const char *child_long_name, Handle &outHandle)
 Get a child handle of this handle Sets handle to point to a child of this handle, with child_long_name being relative to the current long name.
PX_INLINE ErrorType getChildHandle (int32_t index, Handle &outHandle)
 Get a child handle of this handle Sets handle to point to a direct child of this handle. Works with structs and arrays.
PX_INLINE bool getLongName (char *str, uint32_t max_str_len) const
 Returns the long name of the parameter, with indexes into str.
PX_INLINE void reset ()
 Reset all of the state data for the handle.
PX_INLINE bool isConst (void) const
 Does handle correspond to an existing Interface?
PX_INLINE bool isValid (void) const
 Does handle correspond to a valid parameter?
PX_INLINE operator bool () const
 Same as isValid.
PX_INLINE const void * userData (void) const
 Return user data stored in handle.
PX_INLINE void * userData (void)
 Return user data stored in handle.
PX_INLINE void setUserData (void *user_data)
 Store user data in handle.
PX_INLINE::NvParameterized::Interface * getInterface (void) const
 Get associated NvParameterized object.
PX_INLINEconst::NvParameterized::Interface * getConstInterface (void) const
 Get associated NvParameterized object.
PX_INLINE void setInterface (::NvParameterized::Interface *iface)
 Set associated NvParameterized object.
PX_INLINE void setInterface (const ::NvParameterized::Interface *iface)
 Set associated NvParameterized object.
PX_INLINE ErrorType initParamRef (const char *chosenRefStr=0, bool doDestroyOld=false)
 Initialize a Reference parameter.
PX_INLINE ErrorType valueToStr (char *buf, uint32_t bufSize, const char *&ret)
 Store this Handle's parameter to a string.
PX_INLINE ErrorType strToValue (const char *str, const char **endptr)
 Store the string to this Handle's parameter.
ErrorType resizeArray (int32_t new_size)
 Resize the array that the Handle points to.
PX_INLINE ErrorType getArraySize (int32_t &size, int32_t dimension=0) const
 Get the array size for the given array dimension.
PX_INLINE ErrorType swapArrayElements (uint32_t firstElement, uint32_t secondElement)
 Swap two elements of an array.
PX_INLINE ErrorType getParamBool (bool &val) const
 Get param.
PX_INLINE ErrorType setParamBool (bool val)
 Set param.
PX_INLINE ErrorType getParamBoolArray (bool *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamBoolArray (const bool *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamString (const char *&val) const
 Get param.
PX_INLINE ErrorType setParamString (const char *val)
 Set param.
PX_INLINE ErrorType getParamStringArray (char **array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamStringArray (const char **array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamEnum (const char *&val) const
 Get param.
PX_INLINE ErrorType setParamEnum (const char *val)
 Set param.
PX_INLINE ErrorType getParamEnumArray (char **array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamEnumArray (const char **array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamRef (::NvParameterized::Interface *&val) const
PX_INLINE ErrorType getParamRefArray (::NvParameterized::Interface **array, int32_t n, int32_t offset=0) const
PX_INLINE ErrorType setParamRef (::NvParameterized::Interface *val, bool doDestroyOld=false)
PX_INLINE ErrorType setParamRefArray (::NvParameterized::Interface **array, int32_t n, int32_t offset=0, bool doDestroyOld=false)
PX_INLINE ErrorType getParamI8 (int8_t &val) const
 Get param.
PX_INLINE ErrorType setParamI8 (int8_t val)
 Set param.
PX_INLINE ErrorType getParamI8Array (int8_t *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamI8Array (const int8_t *val, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamI16 (int16_t &val) const
 Get param.
PX_INLINE ErrorType setParamI16 (int16_t val)
 Set param.
PX_INLINE ErrorType getParamI16Array (int16_t *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamI16Array (const int16_t *val, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamI32 (int32_t &val) const
 Get param.
PX_INLINE ErrorType setParamI32 (int32_t val)
 Set param.
PX_INLINE ErrorType getParamI32Array (int32_t *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamI32Array (const int32_t *val, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamI64 (int64_t &val) const
 Get param.
PX_INLINE ErrorType setParamI64 (int64_t val)
 Set param.
PX_INLINE ErrorType getParamI64Array (int64_t *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamI64Array (const int64_t *val, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamU8 (uint8_t &val) const
 Get param.
PX_INLINE ErrorType setParamU8 (uint8_t val)
 Set param.
PX_INLINE ErrorType getParamU8Array (uint8_t *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamU8Array (const uint8_t *val, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamU16 (uint16_t &val) const
 Get param.
PX_INLINE ErrorType setParamU16 (uint16_t val)
 Set param.
PX_INLINE ErrorType getParamU16Array (uint16_t *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamU16Array (const uint16_t *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamU32 (uint32_t &val) const
 Get param.
PX_INLINE ErrorType setParamU32 (uint32_t val)
 Set param.
PX_INLINE ErrorType getParamU32Array (uint32_t *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamU32Array (const uint32_t *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamU64 (uint64_t &val) const
 Get param.
PX_INLINE ErrorType setParamU64 (uint64_t val)
 Set param.
PX_INLINE ErrorType getParamU64Array (uint64_t *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamU64Array (const uint64_t *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamF32 (float &val) const
 Get param.
PX_INLINE ErrorType setParamF32 (float val)
 Set param.
PX_INLINE ErrorType getParamF32Array (float *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamF32Array (const float *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType getParamF64 (double &val) const
 Get param.
PX_INLINE ErrorType setParamF64 (double val)
 Set param.
PX_INLINE ErrorType getParamF64Array (double *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamF64Array (const double *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamVec2 (const physx::PxVec2 &val)
 Set param.
PX_INLINE ErrorType getParamVec2 (physx::PxVec2 &val) const
 Get param.
PX_INLINE ErrorType getParamVec2Array (physx::PxVec2 *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamVec2Array (const physx::PxVec2 *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamVec3 (const physx::PxVec3 &val)
 Get param.
PX_INLINE ErrorType getParamVec3 (physx::PxVec3 &val) const
 Set param.
PX_INLINE ErrorType getParamVec3Array (physx::PxVec3 *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamVec3Array (const physx::PxVec3 *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamVec4 (const physx::PxVec4 &val)
 Get param.
PX_INLINE ErrorType getParamVec4 (physx::PxVec4 &val) const
 Set param.
PX_INLINE ErrorType getParamVec4Array (physx::PxVec4 *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamVec4Array (const physx::PxVec4 *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamQuat (const physx::PxQuat &val)
 Get param.
PX_INLINE ErrorType getParamQuat (physx::PxQuat &val) const
 Set param.
PX_INLINE ErrorType getParamQuatArray (physx::PxQuat *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamQuatArray (const physx::PxQuat *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamMat33 (const physx::PxMat33 &val)
 Get param.
PX_INLINE ErrorType getParamMat33 (physx::PxMat33 &val) const
 Set param.
PX_INLINE ErrorType getParamMat33Array (physx::PxMat33 *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamMat33Array (const physx::PxMat33 *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamMat44 (const physx::PxMat44 &val)
 Set param.
PX_INLINE ErrorType getParamMat44 (physx::PxMat44 &val) const
 Get param.
PX_INLINE ErrorType getParamMat44Array (physx::PxMat44 *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamMat44Array (const physx::PxMat44 *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamMat34Legacy (const float(&val)[12])
 Set param.
PX_INLINE ErrorType getParamMat34Legacy (float(&val)[12]) const
 Get param.
PX_INLINE ErrorType getParamMat34LegacyArray (float *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamMat34LegacyArray (const float *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamBounds3 (const physx::PxBounds3 &val)
 Set param.
PX_INLINE ErrorType getParamBounds3 (physx::PxBounds3 &val) const
 Get param.
PX_INLINE ErrorType getParamBounds3Array (physx::PxBounds3 *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamBounds3Array (const physx::PxBounds3 *array, int32_t n, int32_t offset=0)
 Set param.
PX_INLINE ErrorType setParamTransform (const physx::PxTransform &val)
 Set param.
PX_INLINE ErrorType getParamTransform (physx::PxTransform &val) const
 Get param.
PX_INLINE ErrorType getParamTransformArray (physx::PxTransform *array, int32_t n, int32_t offset=0) const
 Get param.
PX_INLINE ErrorType setParamTransformArray (const physx::PxTransform *array, int32_t n, int32_t offset=0)
 Set param.
template<typename T >
PX_INLINE ErrorType setParam (const T &val)
 Template version of setParamXxx.
template<typename T >
PX_INLINE ErrorType getParam (T &val) const
 Template version of getParamXxx.
template<typename T >
PX_INLINE ErrorType getParamArray (T *array, int32_t n, int32_t offset=0) const
 Template version of getParamXxxArray.
template<typename T >
PX_INLINE ErrorType setParamArray (const T *array, int32_t n, int32_t offset=0)
 Template version of setParamXxxArray.

Detailed Description

Provides access to individual parameters within the NvParameterized object.


Constructor & Destructor Documentation

PX_INLINE NvParameterized::Handle::Handle ( const ::NvParameterized::Interface iface)

The constructor takes a const interface.

Note:
Handles which are constructed from const objects are not allowed to modify them.
PX_INLINE NvParameterized::Handle::Handle ( const ::NvParameterized::Interface instance,
const char *  longName 
)

This constructor allows the user to create a handle that initially points at a particular parameter in the instance.

Note:
Handles which are constructed from const objects are not allowed to modify them.

Member Function Documentation

PX_INLINE ::NvParameterized::Interface* NvParameterized::Handle::getInterface ( void  ) const [inline]

Get associated NvParameterized object.

Note:
Will return NULL in case of const handle (use getConstInterface instead)
PX_INLINE bool NvParameterized::Handle::getLongName ( char *  str,
uint32_t  max_str_len 
) const

Returns the long name of the parameter, with indexes into str.

Returns:
false if the long name didn't fit in str.
PX_INLINE ErrorType NvParameterized::Handle::getParameter ( const char *  longName)

Get the parameter specified by longName and set the Handle to point it Given a long name like "mystruct.somearray[10].foo", it will return a handle to that specific parameter. The handle can then be used to set/get values, as long as it's a handle to a leaf node.

Note:
this method will not work if an included reference's child is included in the longName
PX_INLINE ErrorType NvParameterized::Handle::getParamRef ( ::NvParameterized::Interface *&  val) const
PX_INLINE ErrorType NvParameterized::Handle::getParamRefArray ( ::NvParameterized::Interface **  array,
int32_t  n,
int32_t  offset = 0 
) const
PX_INLINE ErrorType NvParameterized::Handle::initParamRef ( const char *  chosenRefStr = 0,
bool  doDestroyOld = false 
)

Initialize a Reference parameter.

Parameters:
[in]chosenRefStrThis string must be one of the strings returned from Definition::refVariantVal()
[in]doDestroyOldSets whether the previous object should be destroyed or not
See also:
Interface::initParamRef(), Definition::numRefVariants(), Definition::refVariantVal()
PX_INLINE ErrorType NvParameterized::Handle::set ( int32_t  child_index)

Set the depth of the handle within the handle's parameter.

The set method is useful for accessing indices within an array of parameters or members within a struct.

PX_INLINE ErrorType NvParameterized::Handle::setParamRef ( ::NvParameterized::Interface val,
bool  doDestroyOld = false 
)
PX_INLINE ErrorType NvParameterized::Handle::setParamRefArray ( ::NvParameterized::Interface **  array,
int32_t  n,
int32_t  offset = 0,
bool  doDestroyOld = false 
)
PX_INLINE ErrorType NvParameterized::Handle::strToValue ( const char *  str,
const char **  endptr 
)

Store the string to this Handle's parameter.

Returns:
ERROR_TYPE_NOT_SUPPORTED if the Handle's parameter type is an array, struct, or reference
ERROR_NONE if the Handle's parameter type is a simple type (u32, i32, vec3, etc)
PX_PUSH_PACK_DEFAULT PX_POP_PACK PX_INLINE ErrorType NvParameterized::Handle::valueToStr ( char *  buf,
uint32_t  bufSize,
const char *&  ret 
)

Store this Handle's parameter to a string.

NvParameterized type X-macro template.

Parameters:
[in]bufthis buffer is used to store any strings that need to be constructed
[in]bufSizesize of buf
[out]retthis contains a pointer to the value as a string, it may or may not be equal to buf, depending if the value had to be constructed dynamically or if it already exists as a static string
Note:
See http://en.wikipedia.org/wiki/C_preprocessor#X-Macros for more detailsPX_PS4 PX_PS4

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

Generated on Fri Dec 15 2017 13:58:41

Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.