source:
code/branches/objecthierarchie/src/Factory.cc
@
246
Last change on this file since 246 was 244, checked in by landauf, 16 years ago | |
---|---|
File size: 543 bytes |
Rev | Line | |
---|---|---|
[218] | 1 | #include "Factory.h" |
2 | #include "Identifier.h" | |
[219] | 3 | #include "BaseObject.h" |
[218] | 4 | |
5 | namespace orxonox | |
6 | { | |
[244] | 7 | Factory* Factory::pointer_s = NULL; |
[218] | 8 | |
[244] | 9 | Identifier* Factory::getIdentifier(const std::string& name) |
[218] | 10 | { |
[219] | 11 | if (!pointer_s) |
[244] | 12 | pointer_s = new Factory; |
[218] | 13 | |
[244] | 14 | return pointer_s->identifierMap_[name]; |
[218] | 15 | } |
16 | ||
[244] | 17 | void Factory::add(const std::string& name, Identifier* identifier) |
[218] | 18 | { |
[219] | 19 | if (!pointer_s) |
[244] | 20 | pointer_s = new Factory; |
[218] | 21 | |
[219] | 22 | pointer_s->identifierMap_[name] = identifier; |
[218] | 23 | } |
24 | } |
Note: See TracBrowser
for help on using the repository browser.