|
Diligent Engine API Reference
|
Template class implementing state object registry. More...
Public Member Functions | |
| void | Add (const ResourceDescType &ObjectDesc, IDeviceObject *pObject) |
| Adds a new object to the registry. More... | |
| void | Find (const ResourceDescType &Desc, IDeviceObject **ppObject) |
| Finds the object in the registry. | |
| void | Purge () |
| Purges outstanding deleted objects from the registry. | |
| void | ReportDeletedObject () |
| Increments the number of outstanding deleted objects. When this number reaches DeletedObjectsToPurge, Purge() will be called. | |
Static Public Attributes | |
| static constexpr int | DeletedObjectsToPurge = 32 |
| Number of outstanding deleted objects to purge the registry. | |
Template class implementing state object registry.
| ResourceDescType | - type of the resource description. The type must have operator== and a hash function defined. |
|
inline |
Adds a new object to the registry.
| [in] | ObjectDesc | - object description. |
| [in] | pObject | - pointer to the object. |
Besides adding a new object, the function also checks the number of outstanding deleted objects and calls Purge() if the number has reached the threshold value DeletedObjectsToPurge. Creating a state object is assumed to be an expensive operation and should be performed during the initialization. Occasional purge operations should not add significant cost to it.