Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

added factory

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