ETL
0.04.19
|
Replaceable 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 Types inherited from handle< T > | |
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 | |
rhandle () | |
Default constructor - empty handle. | |
rhandle (pointer x) | |
Constructor that constructs from a pointer to new object. | |
rhandle (const handle< value_type > &x) | |
rhandle (const rhandle< value_type > &x) | |
Default copy constructor. | |
~rhandle () | |
Handle is released on deletion. | |
rhandle< value_type > & | operator= (const rhandle< value_type > &x) |
Template Assignment operator. | |
rhandle< value_type > & | operator= (const handle< value_type > &x) |
Template Assignment operator. | |
rhandle< value_type > & | operator= (value_type *x) |
void | detach () |
Handle release procedure. | |
void | reset () |
void | spawn () |
Creates a new instance of a T object and puts it in the handle. | |
count_type | rcount () const |
Returns number of reversible instances. | |
bool | runique () const |
Returns true if there is only one instance of the object. | |
int | replace (const handle< value_type > &x) |
handle< value_type > & | swap (handle< value_type > &x) |
Swaps the values of two handles without reference counts. | |
Public Member Functions inherited from handle< T > | |
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. | |
bool | empty () const |
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 |
Private Member Functions | |
void | add_to_rlist () |
void | del_from_rlist () |
Private Attributes | |
rhandle< value_type > * | prev_ |
rhandle< value_type > * | next_ |
Friends | |
class | rshared_object |
Additional Inherited Members | |
Static Public Member Functions inherited from handle< T > | |
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 inherited from handle< T > | |
value_type * | obj |
Pointer to object. |
Replaceable Object Handle.
typedef T rhandle< T >::value_type |
typedef const T& rhandle< T >::const_reference |
typedef const T* rhandle< T >::const_pointer |
typedef int rhandle< T >::count_type |
Constructor that constructs from a pointer to new object.
Definition at line 467 of file _handle.h.
References rhandle< T >::add_to_rlist(), and handle< T >::obj.
|
inline |
Definition at line 473 of file _handle.h.
References rhandle< T >::add_to_rlist(), and handle< T >::obj.
|
inline |
Default copy constructor.
Definition at line 480 of file _handle.h.
References rhandle< T >::add_to_rlist(), and handle< T >::obj.
Handle is released on deletion.
Definition at line 487 of file _handle.h.
References rhandle< T >::detach().
|
inlineprivate |
Definition at line 415 of file _handle.h.
References rhandle< T >::next_, handle< T >::obj, and rhandle< T >::prev_.
Referenced by rhandle< T >::operator=(), and rhandle< T >::rhandle().
|
inlineprivate |
Definition at line 436 of file _handle.h.
References rhandle< T >::next_, handle< T >::obj, and rhandle< T >::prev_.
Referenced by rhandle< T >::detach().
|
inline |
Template Assignment operator.
Definition at line 514 of file _handle.h.
References rhandle< T >::add_to_rlist(), rhandle< T >::detach(), handle< T >::get(), and handle< T >::obj.
Referenced by rhandle< T >::spawn().
|
inline |
Template Assignment operator.
Reimplemented from handle< T >.
Definition at line 532 of file _handle.h.
References rhandle< T >::add_to_rlist(), rhandle< T >::detach(), handle< T >::get(), and handle< T >::obj.
|
inline |
Definition at line 550 of file _handle.h.
References rhandle< T >::add_to_rlist(), rhandle< T >::detach(), and handle< T >::obj.
|
inline |
Handle release procedure.
unref()'s the object and sets the internal object pointer to NULL
Reimplemented from handle< T >.
Definition at line 570 of file _handle.h.
References rhandle< T >::del_from_rlist(), and handle< T >::obj.
Referenced by rhandle< T >::operator=(), rhandle< T >::reset(), and rhandle< T >::~rhandle().
|
inline |
Reimplemented from handle< T >.
Definition at line 581 of file _handle.h.
References rhandle< T >::detach().
|
inline |
Creates a new instance of a T object and puts it in the handle.
Uses the default constructor
Reimplemented from handle< T >.
Definition at line 585 of file _handle.h.
References rhandle< T >::operator=().
|
inline |
Returns number of reversible instances.
Definition at line 589 of file _handle.h.
References handle< T >::obj.
|
inline |
Returns true if there is only one instance of the object.
Definition at line 597 of file _handle.h.
References handle< T >::obj.
|
inline |
Definition at line 604 of file _handle.h.
References handle< T >::get(), rhandle< T >::next_, and handle< T >::obj.
handle<value_type>& rhandle< T >::swap | ( | handle< value_type > & | x | ) |
Swaps the values of two handles without reference counts.
Reimplemented from handle< T >.
|
friend |
|
private |
Definition at line 412 of file _handle.h.
Referenced by rhandle< T >::add_to_rlist(), and rhandle< T >::del_from_rlist().
|
private |
Definition at line 413 of file _handle.h.
Referenced by rhandle< T >::add_to_rlist(), rhandle< T >::del_from_rlist(), and rhandle< T >::replace().