28 #ifndef __SharedPtr_H__
29 #define __SharedPtr_H__
161 inline T*
get()
const {
return pRep; }
199 bool destroyThis =
false;
252 #if OGRE_THREAD_SUPPORT
260 return a.
get() == b.
get();
265 return a.
get() != b.
get();
268 template<
class T,
class U>
inline bool operator<(SharedPtr<T>
const& a,
SharedPtr<U> const& b)
270 return std::less<const void*>()(a.get(), b.get());
SharedPtrFreeMethod useFreeMethod
virtual void swap(SharedPtr< T > &other)
virtual void destroy(void)
#define OGRE_NEW_AUTO_SHARED_MUTEX
SharedPtr & operator=(const SharedPtr &r)
#define OGRE_MUTEX_CONDITIONAL(name)
SharedPtr(const SharedPtr &r)
Use OGRE_DELETE_T to free (only MEMCATEGORY_GENERAL supported)
void bind(T *rep, SharedPtrFreeMethod inFreeMethod=SPFM_DELETE)
Binds rep to the SharedPtr.
#define OGRE_NEW_T(T, category)
Allocate space for one primitive type, external type or non-virtual type with constructor parameters...
#define OGRE_SET_AUTO_SHARED_MUTEX_NULL
SharedPtrFreeMethod freeMethod() const
SharedPtr(Y *rep, SharedPtrFreeMethod inFreeMethod=SPFM_DELETE)
Constructor.
#define OGRE_AUTO_SHARED_MUTEX
SharedPtr(const SharedPtr< Y > &r)
Use OGRE_DELETE to free the memory.
#define OGRE_LOCK_AUTO_SHARED_MUTEX
unsigned int useCount() const
Use OGRE_FREE to free (only MEMCATEGORY_GENERAL supported)
#define OGRE_LOCK_MUTEX(name)
OGRE_AUTO_SHARED_MUTEX SharedPtr()
Constructor, does not initialise the SharedPtr.
#define OGRE_FREE(ptr, category)
Free the memory allocated with OGRE_MALLOC or OGRE_ALLOC_T. Category is required to be restated to en...
SharedPtrFreeMethod
The method to use to free memory on destruction.
unsigned int * useCountPointer() const
#define OGRE_DELETE_T(ptr, T, category)
Free the memory allocated with OGRE_NEW_T. Category is required to be restated to ensure the matching...
Reference-counted shared pointer, used for objects where implicit destruction is required.
SharedPtr & operator=(const SharedPtr< Y > &r)
#define OGRE_DELETE_AUTO_SHARED_MUTEX
#define OGRE_COPY_AUTO_SHARED_MUTEX(from)
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
#define OGRE_AUTO_MUTEX_NAME
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)