From: stephan b. <sg...@us...> - 2004-12-25 20:55:16
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2183/include/pclasses Modified Files: FactoryReg.h Log Message: Added some API docs so when this shows up in doxygen it doesn't look so stupid. Index: FactoryReg.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/FactoryReg.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FactoryReg.h 25 Dec 2004 01:45:14 -0000 1.3 +++ FactoryReg.h 25 Dec 2004 20:55:04 -0000 1.4 @@ -46,11 +46,16 @@ // install a specialization of Factory's default factory type, // so that we won't try to instantiate a PFACREG_TYPE object. namespace P { namespace Hook { + /** + FactoryCreateHook specialization to install a no-op + factory. Intended for use with abastract types. + */ template <> struct FactoryCreateHook< PFACREG_TYPE_INTERFACE , PFACREG_TYPE > { typedef PFACREG_TYPE_INTERFACE * result_type; typedef PFACREG_TYPE actual_type; + /** Returns 0. */ static result_type create() { return 0; @@ -65,14 +70,19 @@ # define p_FACTORY_REG_CONTEXT_DEFINED 1 /////////////////////////////////////////////////////////////// // we must not include this more than once per compilation unit - /////////////////////////////////////////////////////////////// - // A unique (per Context/per compilation unit) space to assign - // a bogus value for classloader registration purposes (see - // the classloader docs for a full description of how this - // works). + /** + A unique (per Context/per compilation unit) space to assign + a bogus value for classloader registration purposes (see + the classloader docs for a full description of how this + works). + */ template <typename Context> struct pfactory_reg_context { + /** + Placeholder variable for automatic factory + registration. + */ static bool placeholder; }; template <typename Context> bool pfactory_reg_context<Context>::placeholder = false; @@ -80,8 +90,9 @@ # define FACTORY_FUNCTION_ ::P::Hook::FactoryCreateHook< PFACREG_TYPE_INTERFACE , PFACREG_TYPE >::create # define FACTORY_INSTANCE_ ::P::Factory< PFACREG_TYPE_INTERFACE, PFACREG_CONTEXT, std::string >::instance() - //////////////////////////////////////////////////////////////////////// - // Register a factory with the classloader: + /** + Placeholder variable for automatic factory registration. + */ bool pfactory_reg_context< PFACREG_TYPE >::placeholder= ( FACTORY_INSTANCE_.registerFactory( PFACREG_TYPE_NAME, FACTORY_FUNCTION_ ), true); |