RenderManAPI
24.0
|
NOTE: This interface is deprecated and will be removed in a future release. More...
#include <RixInterfaces.h>
Inherits RixInterface.
Public Types | |
enum | Type { k_Float, k_Integer, k_StringV, k_Color, k_Normal, k_Vector, k_Point, k_HPoint, k_MPoint, k_Matrix } |
Public Member Functions | |
virtual void * | Get (const RtUString key)=0 |
Get the data associated with the given key, or NULL if there is none. More... | |
virtual void | Set (const RtUString key, void *data, RixCleanupFunc cleanup=NULL)=0 |
Set the data associated with the given key, along with an optional cleanup function. More... | |
virtual void | Clear (const RtUString key)=0 |
Clear any data associated with the given key, calling its cleanup function (if any). More... | |
virtual void | Lock ()=0 |
Lock this object. (Unnecessary unless it's used for global storage.) More... | |
virtual void | Unlock ()=0 |
Unlock this object. More... | |
virtual int | GetVersion () const |
Get the version number of this interface. More... | |
Protected Member Functions | |
RixStorage () | |
Constructor is for internal use only. More... | |
Protected Attributes | |
int | m_version |
Version number of this interface. More... | |
NOTE: This interface is deprecated and will be removed in a future release.
RixStorage allows plugins to store and share arbitrary data by associating it with an arbitrary key. For example, a shader plugin might share per-thread data as follows:
This code operates as follows:
Per-thread storage is thread-safe, but all other storage must be locked, for example the per-grid storage below is locked:
Per-thread storage can also be used from the global RixContext, as in the example below:
A cleanup function has a prototype like the following:
The RixContext argument allows the cleanup function to obtain interfaces for reporting errors, etc. Note that a cleanup function for per-thread data can access the per-thread RixStorage interface (e.g. for maintaining memory usage statistics). But per-thread storage is not accessible in a cleanup function for per-frame or per-session data.
|
inherited |
|
inlineprotected |
Constructor is for internal use only.
|
pure virtual |
Clear any data associated with the given key, calling its cleanup function (if any).
|
pure virtual |
Get the data associated with the given key, or NULL if there is none.
|
inlinevirtualinherited |
Get the version number of this interface.
Different interfaces might have different version numbers in a given release.
References RixInterface::m_version.
|
pure virtual |
Lock this object. (Unnecessary unless it's used for global storage.)
|
pure virtual |
Set the data associated with the given key, along with an optional cleanup function.
Any previously associated data is discarded (calling its cleanup function, if any). The key is copied.
|
pure virtual |
Unlock this object.
|
protectedinherited |
Version number of this interface.
Referenced by RixInterface::GetVersion().