Line | |
---|
1 | #include "Factory.h" |
---|
2 | #include "Identifier.h" |
---|
3 | |
---|
4 | namespace orxonox |
---|
5 | { |
---|
6 | ClassFactory* ClassFactory::pointer_ = NULL; |
---|
7 | |
---|
8 | OrxonoxClass* ClassFactory::fabricate(const std::string& name) |
---|
9 | { |
---|
10 | if (!pointer_) |
---|
11 | pointer_ = new ClassFactory; |
---|
12 | |
---|
13 | return pointer_->identifierMap_[name]->fabricate(); |
---|
14 | } |
---|
15 | |
---|
16 | void ClassFactory::add(const std::string& name, Identifier* identifier) |
---|
17 | { |
---|
18 | if (!pointer_) |
---|
19 | pointer_ = new ClassFactory; |
---|
20 | |
---|
21 | pointer_->identifierMap_[name] = identifier; |
---|
22 | } |
---|
23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.