Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/objecthierarchie/src/Factory.cc @ 246

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

reimplementation of the factory and parts of the class-hierarchy-generating-algorithm. interfaces with protected constructors are now allowed.

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