Public Member Functions
nvidia::apex::ResourceProvider Class Reference

A user provided class for mapping names to pointers or integers. More...

#include <ResourceProvider.h>

List of all members.

Public Member Functions

virtual void registerCallback (ResourceCallback *impl)=0
 Register a callback.
virtual void setResource (const char *nameSpace, const char *name, void *resource, bool incRefCount=false)=0
 Provide the pointer for the specified named resource.
virtual void setResourceU32 (const char *nameSpace, const char *name, uint32_t id, bool incRefCount=false)=0
 Provide the unsigned integer for the specified named resource.
virtual void * getResource (const char *nameSpace, const char *name)=0
 Retrieve the pointer to the specified named resource.
virtual uint32_t releaseAllResourcesInNamespace (const char *nameSpace)=0
 Releases all resources in this namespace.
virtual uint32_t releaseResource (const char *nameSpace, const char *name)=0
 Releases a single resource.
virtual bool findRefCount (const char *nameSpace, const char *name, uint32_t &refCount)=0
 Reports if a current resource exists and, if so, the reference count.
virtual void * findResource (const char *nameSpace, const char *name)=0
 Locates an existing resource.
virtual uint32_t findResourceU32 (const char *nameSpace, const char *name)=0
 Locates an existing integer resource.
virtual void ** findAllResources (const char *nameSpace, uint32_t &count)=0
 Returns a list of all resources in a particular namespace.
virtual const char ** findAllResourceNames (const char *nameSpace, uint32_t &count)=0
 Returns a list of the names of all resources within a particular namespace.
virtual const char ** findNameSpaces (uint32_t &count)=0
 Returns a list of all registered namespaces.
virtual void dumpResourceTable ()=0
 Write contents of resource table to error stream.
virtual bool isCaseSensitive ()=0
 Returns if the resource provider is operating in a case sensitive mode.

Detailed Description

A user provided class for mapping names to pointers or integers.

Named resource provider - a name-to-pointer utility. User must provide the pointed-to data.


Member Function Documentation

virtual void* nvidia::apex::ResourceProvider::findResource ( const char *  nameSpace,
const char *  name 
) [pure virtual]

Locates an existing resource.

This function will *not* call back to the application if the resource does not exist. Only reports currently set resources.

virtual void* nvidia::apex::ResourceProvider::getResource ( const char *  nameSpace,
const char *  name 
) [pure virtual]

Retrieve the pointer to the specified named resource.

The game application (level loader) may use this to find assets by name, as a convenience. If the named resource has not yet been loaded it will trigger a call to ResourceCallback::requestResource(), assuming an ResourceCallback instance was registered with the APEX SDK. If the named resource has already been loaded, getResource will not increment the reference count.

virtual bool nvidia::apex::ResourceProvider::isCaseSensitive ( ) [pure virtual]

Returns if the resource provider is operating in a case sensitive mode.

Note:
By default the resource provider is NOT case sensitive
It's not possible to change the case sensitivity of the NRP once the APEX SDK is created, so the the switch is available in the ApexSDKDesc::resourceProviderIsCaseSensitive member variable.
virtual void nvidia::apex::ResourceProvider::registerCallback ( ResourceCallback impl) [pure virtual]

Register a callback.

Register a callback function for unresolved named resources. This function will be called by APEX when an unresolved named resource is requested. The function will be called at most once for each named resource. The function must directly return the pointer to the resource or NULL.

virtual uint32_t nvidia::apex::ResourceProvider::releaseAllResourcesInNamespace ( const char *  nameSpace) [pure virtual]

Releases all resources in this namespace.

Returns:
the total number of resources released.
virtual uint32_t nvidia::apex::ResourceProvider::releaseResource ( const char *  nameSpace,
const char *  name 
) [pure virtual]

Releases a single resource.

Returns:
the outstanding referernce count after the release is performed.

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

Generated on Sat Dec 1 2018 15:52:10

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