18#ifndef OBJECT_CACHE_GUARD
19#define OBJECT_CACHE_GUARD
71 return unique_ptr<T>(
new T());
73 unique_ptr<T> object(
_cache.back());
78template<
class T>
template<
class S>
81 return unique_ptr<T>(
new T(copyOf));
83 unique_ptr<T> object(
_cache.back());
89template<
class T>
template<
class S>
91 ASSERT(
dynamic_cast<T*
>(
object.get()) != 0);
93 unique_ptr<T> casted(
static_cast<T*
>(
object.release()));
void noThrowPushBack(Container &container, unique_ptr< Element > pointer)
unique_ptr< T > newObjectCopy(const S ©Of)
Returns a copy of copyOf.
unique_ptr< T > newObject()
Returns an object.
void freeObject(unique_ptr< S > object)
Insert an object into the cache.
ElementDeleter< vector< T * > > _cacheDeleter