Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/objecthierarchy/src/orxonox/core/Factory.h @ 362

Last change on this file since 362 was 362, checked in by landauf, 16 years ago

added NetworkID

File size: 1.2 KB
Line 
1#ifndef _Factory_H__
2#define _Factory_H__
3
4#include <map>
5#include <string>
6
7namespace orxonox
8{
9    class BaseObject;
10    class Identifier;
11
12    // ###############################
13    // ###         Factory         ###
14    // ###############################
15    class Factory
16    {
17        public:
18            static Identifier* getIdentifier(const std::string& name);
19            static Identifier* getIdentifier(const unsigned int id);
20            static void add(const std::string& name, Identifier* identifier);
21            static void changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID);
22
23        private:
24            Factory() {}
25            Factory(const Factory& factory) {}
26            ~Factory() {}
27
28            static Factory* pointer_s;
29            std::map<std::string, Identifier*> identifierStringMap_;
30            std::map<unsigned int, Identifier*> identifierNetworkIDMap_;
31    };
32
33    // ###############################
34    // ###       BaseFactory       ###
35    // ###############################
36    class BaseFactory
37    {
38        public:
39            virtual BaseObject* fabricate() = 0;
40    };
41}
42
43#endif
Note: See TracBrowser for help on using the repository browser.