te::graph::LFUCachePolicyFactory Class Reference

This is the concrete factory for the LFU cache policy. More...

#include <LFUCachePolicyFactory.h>

Inheritance diagram for te::graph::LFUCachePolicyFactory:
te::graph::AbstractCachePolicyFactory te::common::AbstractFactory< AbstractCachePolicy, std::string >

Public Types

typedef FactoryDictionary< AbstractFactory< AbstractCachePolicy, std::string, std::less< std::string > >, std::string, std::less< std::string > > dictionary_type
 
typedef AbstractFactory factory_type
 

Public Member Functions

const std::string & getKey () const
 It returns the factory key associated to the concreate factory. More...
 
const std::string & getType () const
 Returns the type (name) of this factory. More...
 
 ~LFUCachePolicyFactory ()
 Virtual destructor. More...
 

Static Public Member Functions

static void finalize ()
 It finalizes the factory: the singleton instance will be destroyed and will be unregistered from the abstract factory ... More...
 
static const factory_typefind (const std::string &factoryKey)
 
static dictionary_typegetDictionary ()
 It returns a reference to the internal dictionary of concrete factories. More...
 
static void initialize ()
 It initializes the factory: the singleton instance will be registered in the abstract factory ... More...
 
static AbstractCachePolicymake ()
 It creates and returns default cache policy. More...
 
static AbstractCachePolicymake (const std::string &cpType)
 It creates a cache policy with the proper type. More...
 

Protected Member Functions

te::graph::AbstractCachePolicybuild ()
 Builds a new cache policy object. More...
 
 LFUCachePolicyFactory ()
 Default constructor. More...
 

Protected Attributes

std::string m_factoryKey
 The key that identifies the concrete factory: it will be used for unregistering the factory during destruction. More...
 

Static Private Attributes

static LFUCachePolicyFactorysm_factory
 Static attribute used to register this factory. More...
 

Detailed Description

This is the concrete factory for the LFU cache policy.

See also
te::graph::AbstractCachePolicyFactory

Definition at line 44 of file LFUCachePolicyFactory.h.

Member Typedef Documentation

typedef FactoryDictionary<AbstractFactory<AbstractCachePolicy , std::string , std::less<std::string > >, std::string , std::less<std::string > > te::common::AbstractFactory< AbstractCachePolicy , std::string , std::less<std::string > >::dictionary_type
inherited

Definition at line 73 of file AbstractFactory.h.

typedef AbstractFactory te::common::AbstractFactory< AbstractCachePolicy , std::string , std::less<std::string > >::factory_type
inherited

Definition at line 77 of file AbstractFactory.h.

Constructor & Destructor Documentation

te::graph::LFUCachePolicyFactory::~LFUCachePolicyFactory ( )
inline

Virtual destructor.

Definition at line 49 of file LFUCachePolicyFactory.h.

te::graph::LFUCachePolicyFactory::LFUCachePolicyFactory ( )
protected

Default constructor.

Definition at line 53 of file LFUCachePolicyFactory.cpp.

Referenced by initialize().

Member Function Documentation

te::graph::AbstractCachePolicy * te::graph::LFUCachePolicyFactory::build ( )
protectedvirtual

Builds a new cache policy object.

Implements te::common::AbstractFactory< AbstractCachePolicy, std::string >.

Definition at line 58 of file LFUCachePolicyFactory.cpp.

void te::graph::LFUCachePolicyFactory::finalize ( )
static

It finalizes the factory: the singleton instance will be destroyed and will be unregistered from the abstract factory ...

Definition at line 47 of file LFUCachePolicyFactory.cpp.

References sm_factory.

Referenced by te::graph::Module::finalize(), and initialize().

static const factory_type* te::common::AbstractFactory< AbstractCachePolicy , std::string , std::less<std::string > >::find ( const std::string &  factoryKey)
staticinherited
static dictionary_type& te::common::AbstractFactory< AbstractCachePolicy , std::string , std::less<std::string > >::getDictionary ( )
staticinherited

It returns a reference to the internal dictionary of concrete factories.

The dictionary is a singleton.

Returns
A reference to the internal dictionary.
const std::string & te::common::AbstractFactory< AbstractCachePolicy , std::string , std::less<std::string > >::getKey ( ) const
inherited

It returns the factory key associated to the concreate factory.

Returns
The factory key associated to the concreate factory.
const std::string & te::graph::LFUCachePolicyFactory::getType ( ) const
virtual

Returns the type (name) of this factory.

Implements te::graph::AbstractCachePolicyFactory.

Definition at line 36 of file LFUCachePolicyFactory.cpp.

References te::graph::Globals::sm_factoryCachePolicyTypeLFU.

void te::graph::LFUCachePolicyFactory::initialize ( )
static

It initializes the factory: the singleton instance will be registered in the abstract factory ...

Definition at line 41 of file LFUCachePolicyFactory.cpp.

References finalize(), LFUCachePolicyFactory(), and sm_factory.

Referenced by te::graph::Module::initialize().

te::graph::AbstractCachePolicy * te::graph::AbstractCachePolicyFactory::make ( )
staticinherited

It creates and returns default cache policy.

Returns
A default cache policy
Note
The caller will take the ownership of the returned pointer.

Definition at line 36 of file AbstractCachePolicyFactory.cpp.

References te::common::AbstractFactory< TPRODUCT, TFACTORYKEY, TKEYCOMPARE >::make(), and TE_DEFAULT_CACHE_POLICY_TYPE.

Referenced by te::graph::AbstractGraphFactory::getCachePolicy(), and te::graph::GraphCache::GraphCache().

te::graph::AbstractCachePolicy * te::graph::AbstractCachePolicyFactory::make ( const std::string &  cpType)
staticinherited

It creates a cache policy with the proper type.

Parameters
cpTypeThe name of the specific cache policy.
Returns
A specific cache policy
Note
The caller will take the ownership of the returned pointer.

Definition at line 41 of file AbstractCachePolicyFactory.cpp.

References te::common::Convert2UCase(), and te::common::AbstractFactory< TPRODUCT, TFACTORYKEY, TKEYCOMPARE >::make().

Member Data Documentation

std::string te::common::AbstractFactory< AbstractCachePolicy , std::string , std::less<std::string > >::m_factoryKey
protectedinherited

The key that identifies the concrete factory: it will be used for unregistering the factory during destruction.

Definition at line 136 of file AbstractFactory.h.

te::graph::LFUCachePolicyFactory * te::graph::LFUCachePolicyFactory::sm_factory
staticprivate

Static attribute used to register this factory.

Definition at line 69 of file LFUCachePolicyFactory.h.

Referenced by finalize(), and initialize().


The documentation for this class was generated from the following files: