28 #ifndef _CEGUIRefCounted_h_
29 #define _CEGUIRefCounted_h_
59 d_count((ob != 0) ? new unsigned int(1) : 0)
68 d_object(other.d_object),
69 d_count(other.d_count)
99 d_object = other.d_object;
100 d_count = d_object ? other.d_count : 0;
116 return d_object == other.d_object;
126 return d_object != other.d_object;
164 return d_object != 0;
194 unsigned int* d_count;
199 #endif // end of guard _CEGUIRefCounted_h_
~RefCounted()
Destructor. Only deletes the associated object if no further references exist.
Definition: CEGUIRefCounted.h:80
RefCounted()
Default constructor.
Definition: CEGUIRefCounted.h:47
bool operator==(const RefCounted< T > &other) const
Return whether the two RefCounted ptrs are equal (point to the same object)
Definition: CEGUIRefCounted.h:114
bool operator!=(const RefCounted< T > &other) const
Return whether the two RefCounted ptrs are not equal (point to different objects) ...
Definition: CEGUIRefCounted.h:124
RefCounted(T *ob)
Contruct a RefCounted object that wraps the pointer ob.
Definition: CEGUIRefCounted.h:57
const T & operator*() const
Return the object referred to by the wrapped pointer. (beware of null pointers when using this!) ...
Definition: CEGUIRefCounted.h:134
RefCounted< T > & operator=(const RefCounted< T > &other)
Assignment operator. Previously held object gets its reference count reduced, and is deleted if no fu...
Definition: CEGUIRefCounted.h:92
Simple, generic, reference counted pointer class. This is primarily here for use by the Events system...
Definition: CEGUIRefCounted.h:40
RefCounted(const RefCounted< T > &other)
Copy constructor.
Definition: CEGUIRefCounted.h:67
const T * operator->() const
Return the wrapped pointer.
Definition: CEGUIRefCounted.h:148
bool isValid() const
Return whether the wrapped pointer is valid. i.e. that it is not null.
Definition: CEGUIRefCounted.h:162