33 |
**/ |
**/ |
34 |
class ObjectRegistry |
class ObjectRegistry |
35 |
{ |
{ |
36 |
static std::auto_ptr<ObjectRegistry> mInstance; |
// static std::auto_ptr<ObjectRegistry> mInstance; |
37 |
|
static ObjectRegistry* Instance; |
38 |
std::auto_ptr<ObjectRegistryImpl> mImpl; |
std::auto_ptr<ObjectRegistryImpl> mImpl; |
39 |
ObjectRegistry(); |
ObjectRegistry(); |
40 |
|
~ObjectRegistry() throw(); |
41 |
public: |
public: |
42 |
|
struct StaticKilla |
43 |
|
{ |
44 |
|
~StaticKilla() |
45 |
|
{ObjectRegistry::die();} |
46 |
|
}; |
47 |
|
|
48 |
|
friend class StaticKilla; |
49 |
|
|
50 |
/** \brief get a pointer to the ObjectRegistry |
/** \brief get a pointer to the ObjectRegistry |
51 |
\todo define characteristics, and exception specs better |
\todo define characteristics, and exception specs better |
52 |
*/ |
*/ |
53 |
|
static void die(); |
54 |
static ObjectRegistry* instance(); |
static ObjectRegistry* instance(); |
55 |
|
|
56 |
/** |
/** |
66 |
\endcode |
\endcode |
67 |
**/ |
**/ |
68 |
|
|
69 |
void add(const char* object_name, BIOCF create_func) throw(); |
void add(const char* object_name, BIOCF create_func) throw(); |
70 |
|
|
71 |
|
Object* create(const std::string& name); |
72 |
|
|
73 |
}; |
}; |
74 |
/** |
/** |