#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 64 of file BuilderFac.cxx.
00064 { }
|
|
|
Definition at line 53 of file BuilderFac.cxx. References fBuilders.
00054 {
00055 //======================================================================
00056 // Pull builder for tag out of table
00057 // name - XML tag we need a builder for
00058 //======================================================================
00059 return fBuilders[name];
00060 }
|
|
|
Definition at line 42 of file BuilderFac.cxx. Referenced by xmli::SAX2Handler::EndElement().
00043 {
00044 //======================================================================
00045 // Pull builder for tag out of table
00046 // name - XML tag we need a builder for
00047 //======================================================================
00048 return this->Get(std::string(name));
00049 }
|
|
|
Definition at line 15 of file BuilderFac.cxx. References fInstance. Referenced by xmli::Builder::Builder(), and xmli::SAX2Handler::EndElement().
00016 {
00017 //======================================================================
00018 // Return the sole instance of the factory
00019 //======================================================================
00020 if (fInstance == 0) fInstance = new xmli::BuilderFac;
00021 return *fInstance;
00022 }
|
|
||||||||||||
|
Definition at line 26 of file BuilderFac.cxx. References fBuilders. Referenced by xmli::Builder::Builder().
00027 {
00028 //======================================================================
00029 // Insert a builder b into the table.
00030 // name - XML tag the builder handles
00031 // b - builder which handles tag
00032 //======================================================================
00033 std::string n(name);
00034 if (fBuilders[n] == 0) { fBuilders[n] = b; return; }
00035 // else
00036 std::cerr << "Builder for type '" << name << "' doublely defined.\n";
00037 abort();
00038 }
|
|
|
List of builders.
Definition at line 27 of file BuilderFac.h. Referenced by Get(), and Register(). |
|
|
Sole instance of factory.
Definition at line 11 of file BuilderFac.cxx. Referenced by Instance(). |
1.3.5