summaryrefslogtreecommitdiffstats
path: root/src/sp-factory.cpp
blob: 27aa6a97391fb1134a3d13a0ced6496eb0345548 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "sp-factory.h"

//#include <stdexcept>

//#include "sp-object.h"
//#include "xml/node.h"


//SPFactory::TypeNotRegistered::TypeNotRegistered(const std::string& type)
//	: std::exception(), type(type) {
//}
//
//const char* SPFactory::TypeNotRegistered::what() const throw() {
//	return type.c_str();
//}

//SPFactory& SPFactory::instance() {
//	static SPFactory factory;
//	return factory;
//}

//bool SPFactory::registerObject(const std::string& id, CreateFunction* createFunction) {
//	return this->objectMap.insert(std::make_pair(id, createFunction)).second;
//}

//SPObject* SPFactory::createObject(const std::string& id) const {
//	std::map<const std::string, CreateFunction*>::const_iterator it = this->objectMap.find(id);
//
//	if (it == this->objectMap.end()) {
//		throw TypeNotRegistered(id);
//	}
//
//	return (*it).second();
//}