lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Resource pointer class that performs weak reference counting on the given resource type. More...
#include <weak_resource_ptr.h>
Public Types | |
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 | |
weak_resource_ptr (resource_type *resource=nullptr) | |
Constructs a resource pointer from the given resource. | |
template<class Resource2 > | |
weak_resource_ptr (Resource2 *resource) | |
Constructs a resource pointer from the given resource. | |
weak_resource_ptr (const weak_resource_ptr &right) | |
Constructs a resource pointer from the given resource pointer. | |
template<class Resource2 > | |
weak_resource_ptr (const weak_resource_ptr< Resource2 > &right) | |
Constructs a resource pointer from the given resource pointer. | |
weak_resource_ptr & | operator= (resource_type *resource) |
Replaces the stored resource with the given resource. [ESA] | |
weak_resource_ptr & | operator= (const weak_resource_ptr &right) |
Replaces the stored resource with one stored by the given resource pointer. [ESA] | |
template<class Resource2 > | |
weak_resource_ptr & | operator= (const weak_resource_ptr< Resource2 > &right) |
Replaces the stored resource with one stored by the given resource pointer. [ESA] | |
LEAN_INLINE bool | check () const |
Gets whether the resource stored by this pointer is still valid. | |
LEAN_INLINE resource_type * | get (void) const |
Gets the resource stored by this resource pointer or null, if the resource has been destroyed. | |
LEAN_INLINE resource_ptr < resource_type > | lock () const |
Locks the resource stored by this resource pointer or returns null, if the resource has been destroyed. | |
LEAN_INLINE resource_type * | get_unchecked (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. | |
LEAN_INLINE | operator resource_ptr< resource_type > () const |
Gets the resource stored by this resource pointer or null, if the resource has been destroyed. |
Resource pointer class that performs weak reference counting on the given resource type.