lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Resource pointer class that performs strong reference counting on the given resource type. More...
#include <resource_ptr.h>
Public Types | |
enum | bind_reference_t { bind_reference } |
Allows for the binding of existing COM object references on COM pointer construction. More... | |
typedef Resource | resource_type |
Type of the resource stored by this resource pointer. | |
typedef Resource * | value_type |
Type of the pointer stored by this resource pointer. | |
Public Member Functions | |
resource_ptr (resource_type *resource=nullptr) | |
Constructs a resource pointer from the given resource. | |
template<class Resource2 > | |
resource_ptr (Resource2 *resource) | |
Constructs a resource pointer from the given resource. | |
resource_ptr (Resource *resource, bind_reference_t) | |
Constructs a resource pointer from the given resource without incrementing its reference count. | |
resource_ptr (const resource_ptr &right) | |
Constructs a resource pointer from the given resource pointer. | |
template<class Resource2 , bool Critical2> | |
resource_ptr (const resource_ptr< Resource2, Critical2 > &right) | |
Constructs a resource pointer from the given resource pointer. | |
~resource_ptr () throw () | |
Destroys the resource pointer. | |
resource_type * | unbind () |
Unbinds the resource reference held by this resource pointer. | |
resource_ptr< resource_type, true > | transfer () |
Transfers the resource reference held by this resource pointer to a new resource pointer. | |
resource_ptr & | operator= (resource_type *resource) |
Replaces the stored resource with the given resource. [ESA] | |
resource_ptr & | operator= (const resource_ptr &right) |
Replaces the stored resource with one stored by the given resource pointer. [ESA] | |
template<class Resource2 , bool Critical2> | |
resource_ptr & | operator= (const resource_ptr< Resource2, Critical2 > &right) |
Replaces the stored resource with one stored by the given resource pointer. [ESA] | |
LEAN_INLINE resource_type *const & | get (void) const |
Gets the resource stored by this resource pointer. | |
LEAN_INLINE resource_type & | operator* () const |
Gets the resource stored by this resource pointer. | |
LEAN_INLINE resource_type * | operator-> () const |
Gets the resource stored by this resource pointer. | |
LEAN_INLINE | operator resource_type * () const |
Gets the resource stored by this resource pointer. | |
Static Public Member Functions | |
static LEAN_INLINE resource_ptr< resource_type, true > | bind (resource_type *resource) |
Binds the given resource reference to this resource pointer. | |
Protected Member Functions | |
template<class Counter , class Allocator > | |
resource_ptr (Resource *resource, const ref_counter< Counter, Allocator > &refCounter) | |
Constructs a resource pointer from the given resource and reference counter. | |
Friends | |
class | weak_resource_ptr |
Resource pointer class that performs strong reference counting on the given resource type.
enum lean::smart::resource_ptr::bind_reference_t |