Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

AlgoMaker Class Reference

#include <algomaker.h>

Inheritance diagram for AlgoMaker:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~AlgoMaker ()

Static Public Member Functions

static AlgonewAlgo (const std::string &AlgoType, TrapperDoc *doc, std::set< db_recno_t > &recnoList, AlgoParam *param=0)
static std::list< std::string > algosRegistered ()

Protected Types

typedef std::map< std::string,
AlgoMaker * > 
MakerMap

Protected Member Functions

 AlgoMaker ()
virtual AlgomakeAlgo (TrapperDoc *doc, std::set< db_recno_t > &recnoList, AlgoParam *param)=0
virtual bool algoIsPopup ()=0

Static Protected Member Functions

static MakerMapregistry ()

Detailed Description

Definition at line 26 of file algomaker.h.


Member Typedef Documentation

typedef std::map< std::string , AlgoMaker * > AlgoMaker::MakerMap [protected]
 

Definition at line 38 of file algomaker.h.


Constructor & Destructor Documentation

virtual AlgoMaker::~AlgoMaker  )  [inline, virtual]
 

Definition at line 29 of file algomaker.h.

00030   {}

AlgoMaker::AlgoMaker  )  [inline, protected]
 

Definition at line 34 of file algomaker.h.

00035   {}


Member Function Documentation

virtual bool AlgoMaker::algoIsPopup  )  [protected, pure virtual]
 

Implemented in AlgoMakerTP< AlgoType, algoName, algoShouldPopup >.

list< string > AlgoMaker::algosRegistered  )  [static]
 

Definition at line 19 of file algomaker.cpp.

References registry().

Referenced by TrapperView::contentsContextMenuEvent().

00020 {
00021   list<string> list;
00022   
00023   for ( MakerMap::const_iterator it = registry().begin(); it != registry().end(); ++it )
00024     {
00025       if ( it->second->algoIsPopup() )//NOTA BENE, maybe put this info in a separate map...
00026         list.push_back( it->first );
00027     }
00028   return list;
00029 }

virtual Algo* AlgoMaker::makeAlgo TrapperDoc doc,
std::set< db_recno_t > &  recnoList,
AlgoParam param
[protected, pure virtual]
 

Implemented in AlgoMakerTP< AlgoType, algoName, algoShouldPopup >.

Referenced by newAlgo().

Algo * AlgoMaker::newAlgo const std::string &  AlgoType,
TrapperDoc doc,
std::set< db_recno_t > &  recnoList,
AlgoParam param = 0
[static]
 

Definition at line 41 of file algomaker.cpp.

References makeAlgo(), and registry().

Referenced by TrapperView::runAlgo().

00043 {
00044     AlgoMaker* maker =
00045         (*registry().find( AlgoType )).second;
00046     return maker ? maker->makeAlgo( doc, recnoList, param ) : NULL;
00047 }

AlgoMaker::MakerMap & AlgoMaker::registry  )  [static, protected]
 

Definition at line 31 of file algomaker.cpp.

Referenced by AlgoMakerTP< AlgoType, algoName, algoShouldPopup >::AlgoMakerTP(), algosRegistered(), and newAlgo().

00032 {
00033     /* We use this because static instances of sub classes of AlgoMaker
00034     make use of this map. The idea comes from c++ faq lite
00035     [10.12] How do I prevent the "static initialization order fiasco"?
00036      */
00037     static AlgoMaker::MakerMap reg;
00038     return reg;
00039 }


The documentation for this class was generated from the following files:
Generated on Fri Mar 17 17:44:57 2006 for trapper by  doxygen 1.4.4