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

GeneralMaker Class Reference

This is a factory class for GeneralData objects. More...

#include <generalmaker.h>

Inheritance diagram for GeneralMaker:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~GeneralMaker ()

Static Public Member Functions

static GeneralDatanewData (const std::string &)
static std::list< std::string > listRegistered ()

Protected Types

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

Protected Member Functions

 GeneralMaker ()
virtual GeneralDatamakeData ()=0

Static Protected Member Functions

static MakerMapregistry ()

Detailed Description

This is a factory class for GeneralData objects.

Definition at line 33 of file generalmaker.h.


Member Typedef Documentation

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

Definition at line 44 of file generalmaker.h.


Constructor & Destructor Documentation

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

Definition at line 36 of file generalmaker.h.

00037     {}

GeneralMaker::GeneralMaker  )  [inline, protected]
 

Definition at line 41 of file generalmaker.h.

00042     {}


Member Function Documentation

list< string > GeneralMaker::listRegistered  )  [static]
 

Definition at line 25 of file generalmaker.cpp.

References registry().

Referenced by LayerItem::add(), Destroyer::Destroyer(), TrapperView::getInfo(), ViewModes::initFeatureIterators(), TrapperDoc::openDbs(), TrapperDoc::saveExport(), TrapperApp::slotFileFlush(), TrapperView::TrapperView(), and TrapperView::writeSelected().

00026 {
00027     list<string> list;
00028 
00029     for ( MakerMap::const_iterator it = registry().begin(); it != registry().end(); ++it )
00030     {
00031         list.push_back( it->first );
00032     }
00033     return list;
00034 }

virtual GeneralData* GeneralMaker::makeData  )  [protected, pure virtual]
 

Implemented in GeneralMakerTP< Data, str_ >.

Referenced by newData().

GeneralData * GeneralMaker::newData const std::string &   )  [static]
 

Definition at line 48 of file generalmaker.cpp.

References makeData(), and registry().

Referenced by Database::Creator< T >::Creator(), Destroyer::destroy(), TrapperView::getInfo(), ViewModes::initFeatureIterators(), TrapperDoc::openDbs(), Database::PrimaryIterator< T >::PrimaryIterator(), Database::SecondaryIterator< T >::SecondaryIterator(), and TrapperView::writeSelected().

00049 {
00050     GeneralMaker* maker =
00051         (*registry().find( generalDataType )).second;
00052     return maker ? maker->makeData() : NULL;
00053 }

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

Definition at line 36 of file generalmaker.cpp.

Referenced by GeneralMakerTP< Data, str_ >::GeneralMakerTP(), listRegistered(), and newData().

00037 {
00038   /* We use this because static instances of sub classes of GeneralMaker
00039      make use of this map. The idea comes from c++ faq lite
00040      [10.12] How do I prevent the "static initialization order fiasco"?
00041   */
00042   
00043 
00044   static GeneralMaker::MakerMap reg;
00045   return reg;
00046 }


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