Go to the documentation of this file.
28 #ifndef __SharedPtr_H__
29 #define __SharedPtr_H__
150 assert(!
"Bad method");
194 #if __cplusplus >= 201103L
196 class =
typename std::enable_if<std::is_convertible<Y*, T*>::value>::type>
211 #if __cplusplus >= 201103L
213 class =
typename std::enable_if<std::is_assignable<T*, Y*>::value>::type>
246 Y* rep =
dynamic_cast<Y*
>(
pRep);
318 return a.
get() == b.
get();
323 return a.
get() != b.
get();
328 return std::less<const void*>()(a.
get(), b.
get());
@ SPFM_DELETE
Use OGRE_DELETE to free the memory.
#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...
SharedPtrInfoDelete(T *o)
virtual ~SharedPtrInfoDeleteT()
@ SPFM_FREE
Use OGRE_FREE to free (only MEMCATEGORY_GENERAL supported)
@ SPFM_DELETE_T
Use OGRE_DELETE_T to free (only MEMCATEGORY_GENERAL supported)
#define OGRE_FREE(ptr, category)
Free the memory allocated with OGRE_MALLOC or OGRE_ALLOC_T. Category is required to be restated to en...
SharedPtr & operator=(const SharedPtr &r)
SharedPtr(const SharedPtr< Y > &r)
SharedPtr & operator=(const SharedPtr< Y > &r)
void swap(SharedPtr< T > &other)
unsigned int useCount() const
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
SharedPtr(T *rep, SharedPtrInfo *info)
AtomicScalar< unsigned > useCount
SharedPtr< Y > dynamicCast() const
void destroy(void)
IF YOU GET A CRASH HERE, YOU FORGOT TO FREE UP POINTERS BEFORE SHUTTING OGRE DOWN Use setNull() befor...
void bind(T *rep, SharedPtrFreeMethod inFreeMethod=SPFM_DELETE)
Binds rep to the SharedPtr.
SharedPtrInfoDeleteT(T *o)
@ MEMCATEGORY_GENERAL
General purpose.
SharedPtr(Y *rep, SharedPtrFreeMethod inFreeMethod=SPFM_DELETE)
Constructor.
virtual ~SharedPtrInfoFree()
virtual ~SharedPtrInfoDelete()
Reference-counted shared pointer, used for objects where implicit destruction is required.
SharedPtr(const SharedPtr &r)
static SharedPtrInfo * createInfoForMethod(T *rep, SharedPtrFreeMethod method)
void swap(Ogre::SmallVectorImpl< T > &LHS, Ogre::SmallVectorImpl< T > &RHS)
Implement std::swap in terms of SmallVector swap.
SharedPtr< Y > staticCast() const
void setUseCount(unsigned value)
SharedPtr()
Constructor, does not initialise the SharedPtr.
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
bool operator<(SharedPtr< T > const &a, SharedPtr< U > const &b)
SharedPtrFreeMethod
The method to use to free memory on destruction.
#define OGRE_NEW_T(T, category)
Allocate space for one primitive type, external type or non-virtual type with constructor parameters.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.