All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
flashmatch::FlashHypothesisFactory Class Reference

Factory class for instantiating flash algorithm instance. More...

#include <FlashHypothesisFactory.h>

Public Member Functions

 ~FlashHypothesisFactory ()
 Default dtor. More...
 
void add_factory (const std::string name, flashmatch::FlashHypothesisFactoryBase *factory)
 Factory registration method (should be called by global factory instance in algorithm header) More...
 
BaseFlashHypothesiscreate (const std::string name, const std::string instance_name)
 Factory creation method (should be called by clients, possibly you!) More...
 

Static Public Member Functions

static FlashHypothesisFactoryget ()
 Static sharable instance getter. More...
 

Private Member Functions

 FlashHypothesisFactory ()
 Default ctor, shouldn't be used. More...
 

Private Attributes

std::map< std::string,
flashmatch::FlashHypothesisFactoryBase * > 
_factory_map
 Static factory container. More...
 

Static Private Attributes

static FlashHypothesisFactory_me = nullptr
 Static self. More...
 

Detailed Description

Factory class for instantiating flash algorithm instance.

Definition at line 40 of file FlashHypothesisFactory.h.

Constructor & Destructor Documentation

flashmatch::FlashHypothesisFactory::FlashHypothesisFactory ( )
inlineprivate

Default ctor, shouldn't be used.

Definition at line 43 of file FlashHypothesisFactory.h.

43 {}
flashmatch::FlashHypothesisFactory::~FlashHypothesisFactory ( )
inline

Default dtor.

Definition at line 46 of file FlashHypothesisFactory.h.

46 {_factory_map.clear();}
std::map< std::string, flashmatch::FlashHypothesisFactoryBase * > _factory_map
Static factory container.

Member Function Documentation

void flashmatch::FlashHypothesisFactory::add_factory ( const std::string  name,
flashmatch::FlashHypothesisFactoryBase factory 
)
inline

Factory registration method (should be called by global factory instance in algorithm header)

Definition at line 51 of file FlashHypothesisFactory.h.

52  { _factory_map[name] = factory; }
std::map< std::string, flashmatch::FlashHypothesisFactoryBase * > _factory_map
Static factory container.
then echo fcl name
BaseFlashHypothesis* flashmatch::FlashHypothesisFactory::create ( const std::string  name,
const std::string  instance_name 
)
inline

Factory creation method (should be called by clients, possibly you!)

Definition at line 54 of file FlashHypothesisFactory.h.

54  {
55  auto iter = _factory_map.find(name);
56  if(iter == _factory_map.end() || !((*iter).second)) {
57  std::cerr << "Found no registered class " << name << std::endl;
58  return nullptr;
59  }
60  auto ptr = (*iter).second->create(instance_name);
61  return ptr;
62  }
BEGIN_PROLOG could also be cerr
std::map< std::string, flashmatch::FlashHypothesisFactoryBase * > _factory_map
Static factory container.
then echo fcl name
static FlashHypothesisFactory& flashmatch::FlashHypothesisFactory::get ( )
inlinestatic

Static sharable instance getter.

Definition at line 48 of file FlashHypothesisFactory.h.

49  { if(!_me) _me = new FlashHypothesisFactory; return *_me; }
FlashHypothesisFactory()
Default ctor, shouldn&#39;t be used.
static FlashHypothesisFactory * _me
Static self.

Member Data Documentation

std::map<std::string,flashmatch::FlashHypothesisFactoryBase*> flashmatch::FlashHypothesisFactory::_factory_map
private

Static factory container.

Definition at line 66 of file FlashHypothesisFactory.h.

flashmatch::FlashHypothesisFactory * flashmatch::FlashHypothesisFactory::_me = nullptr
staticprivate

Static self.

Definition at line 68 of file FlashHypothesisFactory.h.


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