Loki  0.1.7
Loki::CachedFactory< AbstractProduct, IdentifierType, CreatorParmTList, EncapsulationPolicy, CreationPolicy, EvictionPolicy, StatisticPolicy, FactoryErrorPolicy, ObjVector > Class Template Reference

Factory with caching support. More...

#include <CachedFactory.h>

Inherits EncapsulationPolicy< AbstractProduct >, CreationPolicy, StatisticPolicy, and EvictionPolicy< AbstractProduct *, unsigned >.

Public Member Functions

std::vector< IdentifierType > & RegisteredIds ()
 Return the registered ID in this Factory.
 
void ReleaseObject (ProductReturn &object)
 Use this function to release the object. More...
 
void displayCacheType ()
 display the cache configuration
 

Detailed Description

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.

Member Function Documentation

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: