From: Christian P. <cp...@us...> - 2005-01-10 13:01:09
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14506/include/pclasses Modified Files: Factory.h Log Message: Added some NamedTypeFactory / Plugin registering helper macros Index: Factory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Factory.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Factory.h 10 Jan 2005 02:41:37 -0000 1.18 +++ Factory.h 10 Jan 2005 13:00:56 -0000 1.19 @@ -458,6 +458,19 @@ virtual ~NamedTypeFactory(){} }; + /* + Two helper macros to register types with the plugin manager... + added by cproch + */ + + //! Register type with NamedTypeFactory + #define NAMEDTYPEFACTORY_REGISTER_TYPE(b, c) \ + P::NamedTypeFactory<b>::instance().registerType(#c, c()) + + //! Register type-alias with NamedTypeFactory + #define NAMEDTYPEFACTORY_REGISTER_ALIAS(b, n, c) \ + P::NamedTypeFactory<b>::instance().registerType(n, c()) + /** The CL namespace encapsulates P's classloader-related API. |