Crazy Eddie's GUI System
0.8.7
|
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)
95 RefCounted<T>&
operator=(
const RefCounted<T>& other)
102 d_object = other.d_object;
103 d_count = d_object ? other.d_count : 0;
117 bool operator==(
const RefCounted<T>& other)
const
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:131
const T & operator*() const
Return the object referred to by the wrapped pointer. (beware of null pointers when using this!...
Definition: RefCounted.h:185
bool operator!=(const RefCounted< T > &other) const
Return whether the two RefCounted ptrs are not equal (point to different objects)
Definition: RefCounted.h:175
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:143
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Simple, generic, reference counted pointer class. This is primarily here for use by the Events system...
Definition: RefCounted.h:66
const T * operator->() const
Return the wrapped pointer.
Definition: RefCounted.h:199
bool operator==(const RefCounted< T > &other) const
Return whether the two RefCounted ptrs are equal (point to the same object)
Definition: RefCounted.h:165
bool isValid() const
Return whether the wrapped pointer is valid. i.e. that it is not null.
Definition: RefCounted.h:213
RefCounted()
Default constructor.
Definition: RefCounted.h:97