DEADSOFTWARE

Testing odcread against a bunch of existing .odc files
[odcread.git] / typeregister.cc
1 #include <typeregister.h>
3 #include <iostream>
5 namespace odc {
7 TypeRegister::TypeRegister(): d_map() {}
9 TypeRegister *TypeRegister::s_instance = 0;
11 TypeRegister &TypeRegister::getInstance() {
12 if (s_instance == 0) {
13 s_instance = new TypeRegister();
14 }
15 return *s_instance;
16 }
18 void TypeRegister::add(const std::string &name, TypeProxyBase *proxy) {
19 d_map[name] = proxy;
20 }
22 const TypeProxyBase *TypeRegister::get(const std::string &name) {
23 return d_map[name];
24 }
26 TypeProxyBase::TypeProxyBase(const std::string &name) {
27 TypeRegister::getInstance().add(name, this);
28 }
30 }