From: stephan b. <sg...@us...> - 2004-12-29 20:12:00
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/include/pclasses Modified Files: Factory.h Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: Factory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Factory.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Factory.h 26 Dec 2004 09:28:17 -0000 1.14 +++ Factory.h 29 Dec 2004 20:11:11 -0000 1.15 @@ -153,12 +153,17 @@ KeyType is a type which specifies the type of key used to look up classes, defaulting to std::string. - Both InterfaceT and KeyType must be Default Constructable, - and InterfaceT must be constructable on the heap - (e.g., via new InterfaceT()). Thus InterfaceT must not be - pointer-qualified. + For this default implementation, both InterfaceT and + KeyType must be Default Constructable, and InterfaceT must + be constructable on the heap (e.g., via new + InterfaceT()). Clients supplying FactoryCreateHook or + FactoryInstanceHook specializations may apply other + requirements to InterfaceT and ImplT - The default ipmlementation holds no per-instance state, + Thus InterfaceT must be a "plain type", without any pointer + or reference qualification. + + The default implementation holds no per-instance state, thus it can be copied quickly. Sample usage: @@ -214,7 +219,7 @@ */ AliasMap & aliases() { - return m_alias; + return ::P::Phoenix<AliasMap,ThisType>::instance(); } /** @@ -222,7 +227,7 @@ */ const AliasMap & aliases() const { - return m_alias; + return ::P::Phoenix<AliasMap,ThisType>::instance(); } /** @@ -306,7 +311,7 @@ "should" do the same, but are not strictly required to. */ - virtual ResultType create( const key_type & _key ) + virtual ResultType create( const key_type & _key ) // throw() ???? { key_type key = this->expandAliases( _key ); typename FactoryMap::const_iterator it = factoryMap().find( key ); @@ -399,12 +404,8 @@ } - private: - AliasMap m_alias; - }; // class Factory - /** NamedTypeFactory works for string-keyed types. It is expected that this will be the most-used factory |