27 #ifndef _CEGUIRefCounted_h_
28 #define _CEGUIRefCounted_h_
62 d_count((ob != 0) ? new unsigned int(1) : 0)
71 d_object(other.d_object),
72 d_count(other.d_count)
102 d_object = other.d_object;
103 d_count = d_object ? other.d_count : 0;
119 return d_object == other.d_object;
129 return d_object != other.d_object;
167 return d_object != 0;
190 CEGUI_DELETE_AO d_object;
200 unsigned int* d_count;
205 #endif // end of guard _CEGUIRefCounted_h_
~RefCounted()
Destructor. Only deletes the associated object if no further references exist.
Definition: RefCounted.h:83
RefCounted()
Default constructor.
Definition: RefCounted.h:49
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
bool operator==(const RefCounted< T > &other) const
Return whether the two RefCounted ptrs are equal (point to the same object)
Definition: RefCounted.h:117
bool operator!=(const RefCounted< T > &other) const
Return whether the two RefCounted ptrs are not equal (point to different objects) ...
Definition: RefCounted.h:127
RefCounted(T *ob)
Contruct a RefCounted object that wraps the pointer ob.
Definition: RefCounted.h:59
const T & operator*() const
Return the object referred to by the wrapped pointer. (beware of null pointers when using this!) ...
Definition: RefCounted.h:137
RefCounted< T > & operator=(const RefCounted< T > &other)
Assignment operator. Previously held object gets its reference count reduced, and is deleted if no fu...
Definition: RefCounted.h:95
Simple, generic, reference counted pointer class. This is primarily here for use by the Events system...
Definition: RefCounted.h:42
RefCounted(const RefCounted< T > &other)
Copy constructor.
Definition: RefCounted.h:70
const T * operator->() const
Return the wrapped pointer.
Definition: RefCounted.h:151
bool isValid() const
Return whether the wrapped pointer is valid. i.e. that it is not null.
Definition: RefCounted.h:165