fix inlining problem
parent
538de80a91
commit
e01497632b
14
factory.h
14
factory.h
|
|
@ -54,17 +54,21 @@ public:
|
||||||
return factory ? factory->CreateObject() : NULL;
|
return factory ? factory->CreateObject() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ObjectFactoryRegistry<AbstractClass> & Registry()
|
// VC60 workaround: use "..." to prevent this function from being inlined
|
||||||
{
|
static ObjectFactoryRegistry<AbstractClass> & Registry(...);
|
||||||
static ObjectFactoryRegistry<AbstractClass> s_registry;
|
|
||||||
return s_registry;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::map<std::string, ObjectFactory<AbstractClass> *> Map;
|
typedef std::map<std::string, ObjectFactory<AbstractClass> *> Map;
|
||||||
Map m_map;
|
Map m_map;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class AbstractClass>
|
||||||
|
ObjectFactoryRegistry<AbstractClass> & ObjectFactoryRegistry<AbstractClass>::Registry(...)
|
||||||
|
{
|
||||||
|
static ObjectFactoryRegistry<AbstractClass> s_registry;
|
||||||
|
return s_registry;
|
||||||
|
}
|
||||||
|
|
||||||
template <class AbstractClass, class ConcreteClass>
|
template <class AbstractClass, class ConcreteClass>
|
||||||
void RegisterDefaultFactoryFor(const char *name, AbstractClass *Dummy1=NULL, ConcreteClass *Dummy2=NULL)
|
void RegisterDefaultFactoryFor(const char *name, AbstractClass *Dummy1=NULL, ConcreteClass *Dummy2=NULL)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue