#include <BuilderFac.h>
Public Member Functions | |
| void | Register (const char *name, xmli::Builder *b) |
| Builder * | Get (const char *name) |
| Builder * | Get (const std::string &name) |
Static Public Member Functions | |
| BuilderFac & | Instance () |
Private Member Functions | |
| BuilderFac () | |
Private Attributes | |
| std::map< std::string, xmli::Builder * > | fBuilders |
| List of builders. | |
Static Private Attributes | |
| BuilderFac * | fInstance = 0 |
| Sole instance of factory. | |
Definition at line 15 of file BuilderFac.h.
|
|
Definition at line 65 of file BuilderFac.cxx. 00065 { }
|
|
|
Definition at line 54 of file BuilderFac.cxx. References fBuilders. 00055 {
00056 //======================================================================
00057 // Pull builder for tag out of table
00058 // name - XML tag we need a builder for
00059 //======================================================================
00060 return fBuilders[name];
00061 }
|
|
|
Definition at line 43 of file BuilderFac.cxx. Referenced by xmli::SAX2Handler::EndElement(). 00044 {
00045 //======================================================================
00046 // Pull builder for tag out of table
00047 // name - XML tag we need a builder for
00048 //======================================================================
00049 return this->Get(std::string(name));
00050 }
|
|
|
Definition at line 16 of file BuilderFac.cxx. References fInstance. Referenced by xmli::Builder::Builder(), and xmli::SAX2Handler::EndElement(). 00017 {
00018 //======================================================================
00019 // Return the sole instance of the factory
00020 //======================================================================
00021 if (fInstance == 0) fInstance = new xmli::BuilderFac;
00022 return *fInstance;
00023 }
|
|
||||||||||||
|
Definition at line 27 of file BuilderFac.cxx. References fBuilders. Referenced by xmli::Builder::Builder(). 00028 {
00029 //======================================================================
00030 // Insert a builder b into the table.
00031 // name - XML tag the builder handles
00032 // b - builder which handles tag
00033 //======================================================================
00034 std::string n(name);
00035 if (fBuilders[n] == 0) { fBuilders[n] = b; return; }
00036 // else
00037 std::cerr << "Builder for type '" << name << "' doublely defined.\n";
00038 std::abort();
00039 }
|
|
|
List of builders.
Definition at line 27 of file BuilderFac.h. Referenced by Get(), and Register(). |
|
|
Sole instance of factory.
Definition at line 12 of file BuilderFac.cxx. Referenced by Instance(). |
1.3.9.1