|
Last change
on this file since 220 was
219,
checked in by landauf, 18 years ago
|
- removed the "ClassHierarchy" manager-class and put its sole feature (bIsCreatingClassHierarchy_) directly into the Identifier.
- added a dynamic_cast from OrxonoxClass to BaseObject to the Factory. OrxonoxClass is needed because several classes use Interfaces, but all classes are derived at least from BaseObject, so the cast will work.
|
|
File size:
621 bytes
|
| Line | |
|---|
| 1 | #ifndef _Factory_H__ |
|---|
| 2 | #define _Factory_H__ |
|---|
| 3 | |
|---|
| 4 | #include <map> |
|---|
| 5 | #include <string> |
|---|
| 6 | |
|---|
| 7 | namespace orxonox |
|---|
| 8 | { |
|---|
| 9 | class Identifier; |
|---|
| 10 | class BaseObject; |
|---|
| 11 | |
|---|
| 12 | class ClassFactory |
|---|
| 13 | { |
|---|
| 14 | public: |
|---|
| 15 | static BaseObject* fabricate(const std::string& name); |
|---|
| 16 | static void add(const std::string& name, Identifier* identifier); |
|---|
| 17 | |
|---|
| 18 | private: |
|---|
| 19 | ClassFactory() {} |
|---|
| 20 | ClassFactory(const ClassFactory& factory) {} |
|---|
| 21 | ~ClassFactory() {} |
|---|
| 22 | |
|---|
| 23 | static ClassFactory* pointer_s; |
|---|
| 24 | std::map<std::string, Identifier*> identifierMap_; |
|---|
| 25 | }; |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | #endif |
|---|
Note: See
TracBrowser
for help on using the repository browser.