|
From: Frank V. C. <fr...@us...> - 2000-10-25 12:20:29
|
Update of /cvsroot/corelinux/clfw/clfw In directory slayer.i.sourceforge.net:/tmp/cvs-serv31616 Modified Files: Makefile.am MetaType.hpp Number.hpp Added Files: Prototype.hpp Log Message: 116738 Prototype type ***** Error reading new file: (2, 'No such file or directory') Index: Makefile.am =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** Makefile.am 2000/10/23 04:05:53 1.13 --- Makefile.am 2000/10/25 12:20:26 1.14 *************** *** 21,24 **** --- 21,25 ---- MetaType.hpp \ FrameworkEntity.hpp \ + Prototype.hpp \ Boolean.hpp \ Number.hpp \ *************** *** 32,35 **** --- 33,41 ---- Makefile.am + # Common rcs information do not modify + # $Author$ + # $Revision$ + # $Date$ + # $Locker$ Index: MetaType.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/MetaType.hpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** MetaType.hpp 2000/10/22 14:49:16 1.15 --- MetaType.hpp 2000/10/25 12:20:26 1.16 *************** *** 395,398 **** --- 395,442 ---- className::destroy(aPtr); \ } \ + + /*! + \def DEFINE_ENTITY_WITH_FACTORY( className ) + \brief Defines the basic types for className and + assumes the user has the create/delete new covered + by the implementation + \arg className : the class name + */ + + #define _DEFINE_ENTITY_WITH_FACTORY(className) \ + /** \ + the size of the class object \ + */ \ + const DwordCref className##Size(sizeof(className)); \ + const CharPtr className##Name = #className; \ + const CharPtr MetaType##className##Name = "MetaType"#className; \ + /** \ + Cast to type \ + */ \ + className##Ptr className::castDown( FrameworkEntityPtr aP ) \ + { \ + return dynamic_cast<className##Ptr>(aP); \ + } \ + /** \ + redefine the operator new for className \ + this operator use the className::create() \ + function \ + \return a VoidPtr \ + */ \ + VoidPtr className::operator new( size_t ) \ + { \ + return (VoidPtr)className::create(); \ + } \ + /** \ + redefine the operator delete for className \ + this operator use the className::destroy() \ + function \ + \arg the pointer aVoidPtr \ + */ \ + void className::operator delete(VoidPtr aVoidPtr) \ + { \ + className##Ptr aPtr = (className##Ptr)aVoidPtr; \ + className::destroy(aPtr); \ + } \ /*! *************** *** 545,548 **** --- 589,593 ---- _DEFINE_DUAL_STRINGID(className,metaName) \ _DEFINE_ENTITY_ALWAYS(className) + /*! \def DEFINE_METATYPE( className, identifier, version ) *************** *** 552,555 **** --- 597,601 ---- \arg version: the version number of the MetaType */ + #define DEFINE_METATYPE( className, identifier, version ) \ _DEFINE_FACTORY( className ) \ *************** *** 560,563 **** --- 606,624 ---- _DEFINE_ENTITY_ALWAYS(className) + /*! + \def DEFINE_METATYPE_WITH_FACTORY( className, identifier, version ) + define a new MetaType and assume the user has defined the factory + \arg className: the class name + \arg identifier: the identifier, typically a UniversalIdentifier + \arg version: the version number of the MetaType + */ + + #define DEFINE_METATYPE_WITH_FACTORY( className, identifier, version ) \ + _DEFINE_ENTITY_WITH_FACTORY( className ) \ + _DEFINE_ENTITY_ALWAYS_PARMS(className,identifier,version) \ + _DEFINE_SINGLE_STRINGID(className) \ + ,&the##className##Allocator \ + _DEFINE_ENTITY_ALWAYS(className) + /*! \def DEFINE_METATYPE1( className, metaName, identifier, version ) *************** *** 578,581 **** --- 639,658 ---- _DEFINE_ENTITY_ALWAYS(className) + /*! + \def DEFINE_METATYPE1_WITH_FACTORY( className, metaName, identifier, version ) + define a new MetaType but gives a name to the metatype. For example, + the FrameworkEntity passes MetaTypeRoot which is destined to be the + root of all MetaTypes, and assume the user has defined the factory + \arg className: the class name + \arg metaName: the meta class name + \arg identifier: the identifier, typically a UniversalIdentifier + \arg version: the version number of the MetaType + */ + #define DEFINE_METATYPE1_WITH_FACTORY( className, metaName, identifier, version ) \ + _DEFINE_ENTITY_WITH_FACTORY( className ) \ + _DEFINE_ENTITY_ALWAYS_PARMS(className,identifier,version) \ + _DEFINE_DUAL_STRINGID(className,metaName) \ + ,&the##className##Allocator \ + _DEFINE_ENTITY_ALWAYS(className) /*! \class MetaType Index: Number.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/Number.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Number.hpp 2000/10/14 11:49:33 1.2 --- Number.hpp 2000/10/25 12:20:26 1.3 *************** *** 39,43 **** */ ! class Number : public FrameworkEntity { DECLARE_METATYPEMEMBERS( Number ); --- 39,43 ---- */ ! class Number : public virtual FrameworkEntity { DECLARE_METATYPEMEMBERS( Number ); |