1 #ifndef _CLASSREGISTER_H_
2 #define _CLASSREGISTER_H_
10 class TypeProxyBase
; // forward declaration
13 static TypeRegister
*s_instance
;
15 std::map
<std::string
, TypeProxyBase
*> d_map
;
18 TypeRegister(const TypeRegister
&other
); // NI
19 TypeRegister
&operator=(const TypeRegister
&other
); // NI
22 static TypeRegister
&getInstance();
24 void add(const std::string
&name
, TypeProxyBase
*proxy
);
25 const TypeProxyBase
*get(const std::string
&name
);
30 TypeProxyBase(const std::string
&name
);
31 virtual const std::string
&getName() const = 0;
32 virtual const std::string
*getSuper() const = 0;
33 virtual Store
*newInstance(INTEGER id
) const = 0;
36 template <class T
> class TypeProxy
: public TypeProxyBase
{
38 TypeProxy(): TypeProxyBase(T::getType()) {}
39 virtual const std::string
&getName() const {
42 virtual const std::string
*getSuper() const {
45 virtual Store
*newInstance(INTEGER id
) const {
51 #endif // _CLASSREGISTER_H_