OSVR-Core
Public Member Functions | List of all members
osvr::util::BasicKeyedOwnershipContainer< Policy > Class Template Reference

Holds on to smart pointers by value, and lets you free them by providing the corresponding void *. More...

#include <KeyedOwnershipContainer.h>

Inheritance diagram for osvr::util::BasicKeyedOwnershipContainer< Policy >:

Public Member Functions

template<typename T >
void * acquire (T ptr)
 Adds an object held by a smart pointer to our ownership, returning its void * usable to release it before the destruction of this object. More...
 
bool release (void *ptr)
 Releases the indicated smart pointer in our ownership, if we have it. More...
 

Detailed Description

template<typename Policy = SingleOwnershipPolicy>
class osvr::util::BasicKeyedOwnershipContainer< Policy >

Holds on to smart pointers by value, and lets you free them by providing the corresponding void *.

Member Function Documentation

§ acquire()

template<typename Policy = SingleOwnershipPolicy>
template<typename T >
void* osvr::util::BasicKeyedOwnershipContainer< Policy >::acquire ( T  ptr)
inline

Adds an object held by a smart pointer to our ownership, returning its void * usable to release it before the destruction of this object.

§ release()

template<typename Policy = SingleOwnershipPolicy>
bool osvr::util::BasicKeyedOwnershipContainer< Policy >::release ( void *  ptr)
inline

Releases the indicated smart pointer in our ownership, if we have it.

Note that this just releases the smart pointer object that we have - the underlying memory may not be freed if your smart pointer is still referenced elsewhere, for instance.

Returns
true if we found it and released it

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