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
RevLine 
[218]1#include "Factory.h"
2#include "Identifier.h"
[219]3#include "BaseObject.h"
[218]4
5namespace 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.