lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Types | Public Member Functions
lean::smart::weak_resource_ptr< Resource > Class Template Reference

Resource pointer class that performs weak reference counting on the given resource type. More...

#include <weak_resource_ptr.h>

List of all members.

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_ptroperator= (resource_type *resource)
 Replaces the stored resource with the given resource. [ESA]
weak_resource_ptroperator= (const weak_resource_ptr &right)
 Replaces the stored resource with one stored by the given resource pointer. [ESA]
template<class Resource2 >
weak_resource_ptroperator= (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_typeget (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_typeget_unchecked (void) const
 Gets the resource stored by this resource pointer.
LEAN_INLINE resource_typeoperator* () const
 Gets the resource stored by this resource pointer.
LEAN_INLINE resource_typeoperator-> () 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.

Detailed Description

template<class Resource>
class lean::smart::weak_resource_ptr< Resource >

Resource pointer class that performs weak reference counting on the given resource type.


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