|
OWL
OptiX7 Wrapper Library
|
#include <ObjectRegistry.h>
Public Member Functions | |
| size_t | size () const |
| bool | empty () const |
| void | forget (RegisteredObject *object) |
| void | track (RegisteredObject *object) |
| int | allocID () |
| RegisteredObject * | getPtr (int ID) |
Private Attributes | |
| std::vector< RegisteredObject * > | objects |
| int | numIDsAllocedInContext = 0 |
| std::stack< int > | previouslyReleasedIDs |
| std::mutex | mutex |
registry that tracks mapping between buffers and buffer IDs. Every buffer should have a valid ID, and should be tracked in this registry under this ID
| int owl::ObjectRegistry::allocID | ( | ) |
|
inline |
| void owl::ObjectRegistry::forget | ( | RegisteredObject * | object | ) |
| RegisteredObject * owl::ObjectRegistry::getPtr | ( | int | ID | ) |
|
inline |
| void owl::ObjectRegistry::track | ( | RegisteredObject * | object | ) |
|
private |
|
private |
number of IDs of given type allocated in the LL context; if we ever give out an ID that is greater or equal than this side, we first have to tell the LL context to generate more IDs
|
private |
list of all tracked objects. note this are NOT shared-ptr's, else we'd never released objects because each object would always be owned by the registry
|
private |
list of IDs that have already been allocated before, and have since gotten freed, so can be re-used