Factory with caching support.
More...
#include <CachedFactory.h>
Inherits EncapsulationPolicy< AbstractProduct >, CreationPolicy, StatisticPolicy, and EvictionPolicy< AbstractProduct *, unsigned >.
template<class AbstractProduct, typename IdentifierType, typename CreatorParmTList = NullType, template< class > class EncapsulationPolicy = SimplePointer, class CreationPolicy = AlwaysCreate, template< typename, typename > class EvictionPolicy = EvictRandom, class StatisticPolicy = NoStatisticPolicy, template< typename, class > class FactoryErrorPolicy = DefaultFactoryError, class ObjVector = std::vector<AbstractProduct*>>
class Loki::CachedFactory< AbstractProduct, IdentifierType, CreatorParmTList, EncapsulationPolicy, CreationPolicy, EvictionPolicy, StatisticPolicy, FactoryErrorPolicy, ObjVector >
Factory with caching support.
This class acts as a Factory (it creates objects) but also keeps the already created objects to prevent long constructions time.
Note this implementation do not retain ownership.
◆ ReleaseObject()
template<class AbstractProduct , typename IdentifierType , typename CreatorParmTList = NullType, template< class > class EncapsulationPolicy = SimplePointer, class CreationPolicy = AlwaysCreate, template< typename, typename > class EvictionPolicy = EvictRandom, class StatisticPolicy = NoStatisticPolicy, template< typename, class > class FactoryErrorPolicy = DefaultFactoryError, class ObjVector = std::vector<AbstractProduct*>>
void Loki::CachedFactory< AbstractProduct, IdentifierType, CreatorParmTList, EncapsulationPolicy, CreationPolicy, EvictionPolicy, StatisticPolicy, FactoryErrorPolicy, ObjVector >::ReleaseObject |
( |
ProductReturn & |
object | ) |
|
|
inline |
Use this function to release the object.
if execution brakes in this function then you tried to release an object that wasn't provided by this Cache ... which is bad :-)
The documentation for this class was generated from the following file: