APEX Framework: NvParameterized::Traits Class Reference

NVIDIA APEX

NvParameterized::Traits Class Reference

Interface class for user traits. More...

#include <NvParameterizedTraits.h>

List of all members.

Classes

class  Allocator
 Adapter for allocator classes in PxAlloctor.h. More...

Public Member Functions

virtual void registerFactory (::NvParameterized::Factory &factory)=0
 Register NvParameterized class factory.
virtual
::NvParameterized::Factory
removeFactory (const char *className)=0
 Remove NvParameterized class factory for current version of class.
virtual
::NvParameterized::Factory
removeFactory (const char *className, uint32_t version)=0
 Remove NvParameterized class factory for given version of class.
virtual bool doesFactoryExist (const char *className)=0
 Checks whether any class factory is registered.
virtual bool doesFactoryExist (const char *className, uint32_t version)=0
 Checks whether class factory for given version is registered.
virtual
::NvParameterized::Interface
createNvParameterized (const char *name)=0
 Create object of NvParameterized class using its staticClassName()
virtual
::NvParameterized::Interface
createNvParameterized (const char *name, uint32_t ver)=0
 Create object of NvParameterized class using its staticClassName()
virtual
::NvParameterized::Interface
finishNvParameterized (const char *name, void *obj, void *buf, int32_t *refCount)=0
 Finish construction of inplace object of NvParameterized class.
virtual
::NvParameterized::Interface
finishNvParameterized (const char *name, uint32_t ver, void *obj, void *buf, int32_t *refCount)=0
 Finish construction of inplace object of NvParameterized class.
virtual uint32_t getCurrentVersion (const char *className) const =0
 Get version of class which is currently used.
virtual uint32_t getAlignment (const char *className, uint32_t classVersion) const =0
 Get memory alignment required for objects of class.
virtual void registerConversion (const char *, uint32_t, uint32_t, Conversion &)
 Register converter for legacy version of class.
virtual
::NvParameterized::Conversion
removeConversion (const char *, uint32_t, uint32_t)
 Remove converter for legacy version of class.
virtual bool updateLegacyNvParameterized (::NvParameterized::Interface &legacyObj,::NvParameterized::Interface &obj)
 Update legacy object (most probably using appropriate registered converter)
virtual bool getNvParameterizedNames (const char **names, uint32_t &outCount, uint32_t inCount) const =0
 Get a list of the NvParameterized class type names.
virtual bool getNvParameterizedVersions (const char *className, uint32_t *versions, uint32_t &outCount, uint32_t inCount) const =0
 Get a list of versions of particular NvParameterized class.
virtual int32_t incRefCount (int32_t *refCount)=0
 Increment reference counter.
virtual int32_t decRefCount (int32_t *refCount)=0
 Decrement reference counter.
virtual void onInplaceObjectDestroyed (void *,::NvParameterized::Interface *)
 Called when inplace object is destroyed.
virtual void onAllInplaceObjectsDestroyed (void *buf)
 Called when all inplace objects are destroyed.
virtual void * alloc (uint32_t nbytes)=0
 Allocate memory with default alignment of 8.
virtual void * alloc (uint32_t nbytes, uint32_t align)=0
 Allocate aligned memory.
virtual void free (void *buf)=0
 Deallocate memory.
virtual char * strdup (const char *str)
 Copy string.
virtual void strfree (char *str)
 Release copied string.
virtual void traitsWarn (const char *) const
 Warns user.
virtual void release (void)=0
 Release Traits.

Detailed Description

Interface class for user traits.

This class is a collection of loosely-related functions provided by application or framework and used by NvParameterized library to do memory allocation, object creation, user notification, etc.


Member Function Documentation

virtual ::NvParameterized::Interface* NvParameterized::Traits::createNvParameterized ( const char *  name) [pure virtual]

Create object of NvParameterized class using its staticClassName()

Parameters:
[in]namestatic class name of the instance to create

Most probably this just calls Factory::create on appropriate factory.

virtual ::NvParameterized::Interface* NvParameterized::Traits::createNvParameterized ( const char *  name,
uint32_t  ver 
) [pure virtual]

Create object of NvParameterized class using its staticClassName()

Parameters:
[in]namestatic class name of the instance to create
[in]verversion of the class

Most probably this just calls Factory::create on appropriate factory.

virtual ::NvParameterized::Interface* NvParameterized::Traits::finishNvParameterized ( const char *  name,
void *  obj,
void *  buf,
int32_t *  refCount 
) [pure virtual]

Finish construction of inplace object of NvParameterized class.

Most probably this just calls Factory::finish using appropriate factory.

virtual ::NvParameterized::Interface* NvParameterized::Traits::finishNvParameterized ( const char *  name,
uint32_t  ver,
void *  obj,
void *  buf,
int32_t *  refCount 
) [pure virtual]

Finish construction of inplace object of NvParameterized class.

Most probably this just calls Factory::finish using appropriate factory.

virtual bool NvParameterized::Traits::getNvParameterizedNames ( const char **  names,
uint32_t &  outCount,
uint32_t  inCount 
) const [pure virtual]

Get a list of the NvParameterized class type names.

Parameters:
[in]namesbuffer for names
[out]outCountminimal required length of buffer
[in]inCountlength of buffer
Returns:
False if 'inCount' is not large enough to contain all of the names, true otherwise
Warning:
The memory for the strings returned is owned by the traits class and should only be read, not written or freed.
virtual bool NvParameterized::Traits::getNvParameterizedVersions ( const char *  className,
uint32_t *  versions,
uint32_t &  outCount,
uint32_t  inCount 
) const [pure virtual]

Get a list of versions of particular NvParameterized class.

Parameters:
[in]classNameName of the class
[in]versionsbuffer for versions
[out]outCountminimal required length of buffer
[in]inCountlength of buffer
Returns:
False if 'inCount' is not large enough to contain all of version names, true otherwise
Warning:
The memory for the strings returned is owned by the traits class and should only be read, not written or freed.
virtual ::NvParameterized::Factory* NvParameterized::Traits::removeFactory ( const char *  className) [pure virtual]

Remove NvParameterized class factory for current version of class.

Returns:
Removed factory or NULL if it is not found
virtual ::NvParameterized::Factory* NvParameterized::Traits::removeFactory ( const char *  className,
uint32_t  version 
) [pure virtual]

Remove NvParameterized class factory for given version of class.

Returns:
Removed factory or NULL if it is not found
virtual bool NvParameterized::Traits::updateLegacyNvParameterized ( ::NvParameterized::Interface legacyObj,
::NvParameterized::Interface obj 
) [inline, virtual]

Update legacy object (most probably using appropriate registered converter)

Parameters:
[in]legacyObjlegacy object to be converted
[in]objdestination object
Returns:
True if conversion was successful, false otherwise
Warning:
Note that update is intrusive - legacyObj may be modified as a result of update

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

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.