Public Member Functions | Static Public Member Functions | List of all members
Rose::Combinatorics::Hasher::HasherFactory Class Reference


HasherFactory is a singleton that creates and returns Hashers by name.

Hasher factory contains a map of names to HasherMaker . When createHasher is passed a name, it will attempt to create the correct Hasher and pass it back. Users can add Hashers to HasherFactory using . HasherFactory is created when Instance is first called. Generally this is done at module initialization time.

Definition at line 283 of file Combinatorics.h.

#include <Combinatorics.h>

Public Member Functions

void registerMaker (const std::string &hashType, IHasherMaker *createHasherPtr)
 Adds a new to the HasherFactory. More...
boost::shared_ptr< HashercreateHasher (const std::string &hashType) const
 Creates a registered Hasher by type from the map. More...

Static Public Member Functions

static HasherFactoryInstance ()
 Returns a reference to the HasherFactory singleton. More...

Member Function Documentation

static HasherFactory& Rose::Combinatorics::Hasher::HasherFactory::Instance ( )

Returns a reference to the HasherFactory singleton.

Creates a HasherFactory if necessary

void Rose::Combinatorics::Hasher::HasherFactory::registerMaker ( const std::string &  hashType,
IHasherMaker createHasherPtr 

Adds a new to the HasherFactory.

Ussually called by the HasherMaker constructor

boost::shared_ptr<Hasher> Rose::Combinatorics::Hasher::HasherFactory::createHasher ( const std::string &  hashType) const

Creates a registered Hasher by type from the map.

[in]hashTypeThe type of the Hasher to create. e.g. FNV
A Hasher of the correct type in a boost::shared_ptr
Rose::Combinatorics::Exceptionif inType names an unsupported type

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