ETL
0.04.19
|
Object Handle. More...
#include <ETL/handle>
Public Types | |
typedef T | value_type |
typedef T & | reference |
typedef const T & | const_reference |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef int | count_type |
typedef int | size_type |
Public Member Functions | |
handle () | |
Default constructor - empty handle. | |
handle (pointer x) | |
Constructor that constructs from a pointer to new object. | |
handle (const handle< value_type > &x) | |
Default copy constructor. | |
~handle () | |
Handle is released on deletion. | |
handle< value_type > & | operator= (const handle< value_type > &x) |
Template Assignment operator. | |
handle< value_type > & | swap (handle< value_type > &x) |
Swaps the values of two handles without reference counts. | |
void | detach () |
Handle detach procedure. | |
void | reset () |
bool | empty () const |
void | spawn () |
Creates a new instance of a T object and puts it in the handle. | |
handle< const value_type > | constant () const |
Returns a constant handle to our object. | |
count_type | count () const |
Returns number of instances. | |
bool | unique () const |
Returns true if there is only one instance of the object. | |
reference | operator* () const |
pointer | operator-> () const |
operator bool () const | |
More explicit bool cast. | |
operator handle< const value_type > () const | |
pointer | get () const |
Returns pointer to the object that is being wrapped. | |
bool | operator! () const |
template<class U > | |
operator handle< U > () const | |
static_cast<> overload – Useful for implicit casts |
Static Public Member Functions | |
template<class U > | |
static handle< T > | cast_static (const handle< U > &x) |
static_cast<> wrapper | |
template<class U > | |
static handle< T > | cast_dynamic (const handle< U > &x) |
dynamic_cast<> wrapper | |
template<class U > | |
static handle< T > | cast_const (const handle< U > &x) |
const_cast<> wrapper | |
template<class U > | |
static handle< T > | cast_reinterpret (const handle< U > &x) |
reinterpret_cast<> wrapper | |
template<class U > | |
static handle< T > | cast_static (const loose_handle< U > &x) |
template<class U > | |
static handle< T > | cast_dynamic (const loose_handle< U > &x) |
template<class U > | |
static handle< T > | cast_const (const loose_handle< U > &x) |
template<class U > | |
static handle< T > | cast_reinterpret (const loose_handle< U > &x) |
template<class U > | |
static handle< T > | cast_static (const rhandle< U > &x) |
template<class U > | |
static handle< T > | cast_dynamic (const rhandle< U > &x) |
template<class U > | |
static handle< T > | cast_const (const rhandle< U > &x) |
template<class U > | |
static handle< T > | cast_reinterpret (const rhandle< U > &x) |
template<class U > | |
static handle< T > | cast_static (U *x) |
template<class U > | |
static handle< T > | cast_dynamic (U *x) |
template<class U > | |
static handle< T > | cast_const (U *x) |
template<class U > | |
static handle< T > | cast_reinterpret (U *x) |
Protected Attributes | |
value_type * | obj |
Pointer to object. |
Object Handle.
typedef T handle< T >::value_type |
typedef const T& handle< T >::const_reference |
typedef const T* handle< T >::const_pointer |
typedef int handle< T >::count_type |
Default constructor - empty handle.
Definition at line 190 of file _handle.h.
Referenced by handle< T >::spawn().
Constructor that constructs from a pointer to new object.
Definition at line 193 of file _handle.h.
References handle< T >::obj.
|
inline |
Handle is released on deletion.
Definition at line 207 of file _handle.h.
References handle< T >::detach().
|
inline |
Template Assignment operator.
Reimplemented in rhandle< T >.
Definition at line 230 of file _handle.h.
References handle< T >::detach(), handle< T >::get(), and handle< T >::obj.
Referenced by handle< T >::spawn().
|
inline |
Swaps the values of two handles without reference counts.
Reimplemented in rhandle< T >.
Definition at line 244 of file _handle.h.
References handle< T >::obj.
|
inline |
Handle detach procedure.
unref()'s the object and sets the internal object pointer to NULL
Reimplemented in rhandle< T >.
Definition at line 255 of file _handle.h.
References handle< T >::obj.
Referenced by handle< T >::operator=(), handle< T >::reset(), and handle< T >::~handle().
|
inline |
Reimplemented in rhandle< T >.
Definition at line 271 of file _handle.h.
References handle< T >::detach().
|
inline |
Definition at line 273 of file _handle.h.
References handle< T >::obj.
|
inline |
Creates a new instance of a T object and puts it in the handle.
Uses the default constructor
Reimplemented in rhandle< T >.
Definition at line 277 of file _handle.h.
References handle< T >::handle(), and handle< T >::operator=().
|
inline |
Returns a constant handle to our object.
Definition at line 280 of file _handle.h.
References handle< T >::obj.
|
inline |
Returns number of instances.
Definition at line 284 of file _handle.h.
References handle< T >::obj.
Referenced by handle< T >::unique().
|
inline |
Returns true if there is only one instance of the object.
Definition at line 289 of file _handle.h.
References handle< T >::count(), and handle< T >::obj.
Definition at line 293 of file _handle.h.
References handle< T >::obj.
Definition at line 297 of file _handle.h.
References handle< T >::obj.
|
inline |
More explicit bool cast.
Definition at line 301 of file _handle.h.
References NULL, and handle< T >::obj.
|
inline |
Definition at line 304 of file _handle.h.
References handle< T >::obj.
|
static |
Definition at line 791 of file _handle.h.
References loose_handle< T >::get().
|
static |
Definition at line 792 of file _handle.h.
References loose_handle< T >::get().
|
static |
Definition at line 793 of file _handle.h.
References loose_handle< T >::get().
|
static |
Definition at line 794 of file _handle.h.
References loose_handle< T >::get().
|
static |
Definition at line 797 of file _handle.h.
References handle< T >::get().
|
static |
Definition at line 798 of file _handle.h.
References handle< T >::get().
|
static |
Definition at line 799 of file _handle.h.
References handle< T >::get().
|
static |
Definition at line 800 of file _handle.h.
References handle< T >::get().
Returns pointer to the object that is being wrapped.
Definition at line 332 of file _handle.h.
References handle< T >::obj.
Referenced by handle< T >::cast_const(), handle< T >::cast_dynamic(), handle< T >::cast_reinterpret(), handle< T >::cast_static(), operator!=(), handle< T >::operator=(), rhandle< T >::operator=(), loose_handle< T >::operator=(), operator==(), and rhandle< T >::replace().
|
inline |
Definition at line 335 of file _handle.h.
References handle< T >::obj.
static_cast<> overload – Useful for implicit casts
Definition at line 340 of file _handle.h.
References handle< T >::obj.
|
protected |
Pointer to object.
Definition at line 185 of file _handle.h.
Referenced by rhandle< T >::add_to_rlist(), handle< T >::constant(), handle< T >::count(), rhandle< T >::del_from_rlist(), handle< T >::detach(), rhandle< T >::detach(), handle< T >::empty(), handle< T >::get(), handle< T >::handle(), handle< T >::operator bool(), handle< T >::operator handle< const value_type >(), handle< T >::operator handle< U >(), handle< T >::operator!(), handle< T >::operator*(), handle< T >::operator->(), handle< T >::operator=(), rhandle< T >::operator=(), rhandle< T >::rcount(), rhandle< T >::replace(), rhandle< T >::rhandle(), rhandle< T >::runique(), handle< T >::swap(), and handle< T >::unique().