|
From: Frank V. C. <fr...@us...> - 2000-10-03 02:14:41
|
Update of /cvsroot/corelinux/clfw/clfw In directory slayer.i.sourceforge.net:/tmp/cvs-serv20350/clfw Modified Files: ClfwCommon.hpp Makefile.am MetaType.hpp UniversalIdentifier.hpp Added Files: FrameworkEntity.hpp Log Message: 113427 MetaType and FrameworkEntity ***** Error reading new file: (2, 'No such file or directory') Index: ClfwCommon.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/ClfwCommon.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ClfwCommon.hpp 2000/09/26 11:21:11 1.2 --- ClfwCommon.hpp 2000/10/03 02:14:02 1.3 *************** *** 30,33 **** --- 30,36 ---- #endif + #include <UniversalIdentifier.hpp> + #include <MetaType.hpp> + #endif // if !defined(__CLFWCOMMON_HPP) Index: Makefile.am =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Makefile.am 2000/10/01 15:56:21 1.5 --- Makefile.am 2000/10/03 02:14:02 1.6 *************** *** 15,19 **** include_HEADERS = ClfwCommon.hpp \ UniversalIdentifier.hpp \ ! MetaType.hpp \ Makefile.am --- 15,20 ---- include_HEADERS = ClfwCommon.hpp \ UniversalIdentifier.hpp \ ! MetaType.hpp \ ! FrameworkEntity.hpp \ Makefile.am Index: MetaType.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/MetaType.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** MetaType.hpp 2000/10/01 15:56:21 1.3 --- MetaType.hpp 2000/10/03 02:14:02 1.4 *************** *** 22,40 **** */ ! #if !defined(__CLFWCOMMON_HPP) ! #include <ClfwCommon.hpp> #endif ! #if !defined(__UNIVERSALIDENTIFIER_HPP) ! #include <UniversalIdentifier.hpp> ! #endif namespace corelinux { - - DECLARE_CLASS( Entity ); - DECLARE_CLASS( MetaType ); class MetaType { --- 22,155 ---- */ ! #if !defined(__ABSTRACTALLOCATOR_HPP) ! #include <corelinux/AbstractAllocator.hpp> #endif ! extern "C" ! { ! #include <stdio.h> ! } namespace corelinux { DECLARE_CLASS( MetaType ); + /// Expansion Macro + + #define DECLARE_METATYPEMEMBERS( className ) \ + public: \ + static MetaTypeCptr getTypeDescriptor( void ); \ + virtual MetaTypeCptr getType( void ) const; \ + static className##Ptr create( void ); \ + static void destroy( className##Ptr ); \ + VoidPtr operator new(size_t aSize); \ + void operator delete(VoidPtr aVoidPtr); \ + protected: \ + private: \ + static MetaType theTypeDesc; \ + + #define OPEN_METATYPE_PARENTS( className ) \ + MetaType const *className##MetaType##Parents[] = \ + { \ + + #define DEFINE_METATYPE_PARENT( parentName ) \ + MetaType##parentName::getTypeDescriptor(), \ + + #define CLOSE_METATYPE_PARENT \ + MetaTypeCptr(NULLPTR) \ + } + + // + // Define the factory allocator + // + + #define _DEFINE_FACTORY( className ) \ + CORELINUX_DEFAULT_ALLOCATOR( className##Allocator, className ) \ + static className##Allocator the##className##Allocator; + + // + // Defines the factory methods for the type + // + #define _DEFINE_ENTITY(className) \ + className##Ptr className::create( void ) \ + { \ + printf("in create for %s\n",#className); \ + className##Allocator##Ptr aAlPtr = \ + dynamic_cast<className##Allocator##Ptr> \ + (theTypeDesc.getAllocator()); \ + return aAlPtr->createType(); \ + } \ + void className::destroy( className##Ptr aPtr ) \ + { \ + printf("in destroy for %s\n",#className); \ + className##Allocator##Ptr aAlPtr = \ + dynamic_cast<className##Allocator##Ptr> \ + (theTypeDesc.getAllocator()); \ + aAlPtr->destroyType(aPtr); \ + } \ + VoidPtr className::operator new(size_t aSize) \ + { \ + return (VoidPtr)className::create(); \ + } \ + void className::operator delete(VoidPtr aVoidPtr) \ + { \ + className##Ptr aPtr = (className##Ptr)aVoidPtr; \ + className::destroy(aPtr); \ + } \ + + #define _DEFINE_ENTITY_ALWAYS_PARMS(className,identification,version) \ + MetaType className::theTypeDesc \ + ( \ + identification \ + ,version \ + ,sizeof(className) \ + ,className##MetaType##Parents + + + #define _DEFINE_SINGLE_STRINGID( className ) \ + ,#className \ + ,#className + + #define _DEFINE_DUAL_STRINGID( className, metaName ) \ + ,#className \ + ,#metaName + + #define _DEFINE_ENTITY_ALWAYS(className) \ + ); \ + MetaTypeCptr className::getType( void ) const \ + { \ + return &theTypeDesc; \ + } \ + MetaTypeCptr className::getTypeDescriptor( void ) \ + { \ + return &theTypeDesc; \ + } \ + + #define _DEFINE_METATYPE_ALWAYS + + #define DECLARE_METATYPE_MEMBERS( className ) + + #define DEFINE_ABSTRACT_METATYPE( className, identifier, version ) \ + _DEFINE_ENTITY( className ) \ + _DEFINE_ENTITY_ALWAYS_PARMS(className,identifier,version) \ + _DEFINE_SINGLE_STRINGID(className) \ + _DEFINE_ENTITY_ALWAYS(className) + + #define DEFINE_METATYPE( className, identifier, version ) \ + _DEFINE_FACTORY( className ) \ + _DEFINE_ENTITY( className ) \ + _DEFINE_ENTITY_ALWAYS_PARMS(className,identifier,version) \ + _DEFINE_SINGLE_STRINGID(className) \ + ,&the##className##Allocator \ + _DEFINE_ENTITY_ALWAYS(className) + + #define DEFINE_METATYPE1( className, metaName,identifier, version ) \ + _DEFINE_FACTORY( className ) \ + _DEFINE_ENTITY( className ) \ + _DEFINE_ENTITY_ALWAYS_PARMS(className,identifier,version) \ + _DEFINE_DUAL_STRINGID(className,metaName) \ + ,&the##className##Allocator \ + _DEFINE_ENTITY_ALWAYS(className) + class MetaType { *************** *** 45,51 **** // Constructor and destructors // ! ! MetaType( void ); virtual ~MetaType( void ); --- 160,209 ---- // Constructor and destructors // ! /** ! Constructor requires meaningful information ! for analysis, this is for abstract types that ! are not instantiated ! @param UniversalIdentifier a Unique ID ! @param Dword MetaType version number ! @param Char pointer to type instance (class) name ! @param Char pointer to MetaType name ! @param Dword size of class ! @param MetaType pointer to array of parents ! */ ! ! MetaType ! ( ! UniversalIdentifierCref , ! DwordCref , ! DwordCref , ! MetaTypeCptr *, ! CharCptr , ! CharCptr ! ) throw ( Assertion ); ! ! /** ! Constructor requires meaningful information ! for analysis ! @param UniversalIdentifier a Unique ID ! @param Dword MetaType version number ! @param Char pointer to type instance (class) name ! @param Char pointer to MetaType name ! @param Dword size of class ! @param MetaType pointer to array of parents ! @param Allocator pointer to instance allocator ! */ ! ! MetaType ! ( ! UniversalIdentifierCref , ! DwordCref , ! DwordCref , ! MetaTypeCptr *, ! CharCptr , ! CharCptr , ! AllocatorPtr ! ) throw ( Assertion ); + /// Virtual destructor virtual ~MetaType( void ); *************** *** 54,70 **** // Accessors // ! virtual bool isType( MetaTypeCptr ) const ! throw ( Assertion ); ! virtual bool isType( MetaTypeCref ) const ; - bool isTypeOf( MetaTypeCptr ) const throw ( Assertion ); protected: ! MetaType( MetaTypeCref ); protected: --- 212,244 ---- // Accessors // + + UniversalIdentifierCref getIdentifier( void ) const; + + DwordCref getTypeVersion( void ) const; ! MetaTypeCptr *const getParentTypes( void ) const; ! CharCptr getInstanceTypeName( void ) const; + CharCptr getMetaTypeName( void ) const; + + AllocatorPtr getAllocator( void ) const; + + + bool isType( MetaTypeCptr ) const throw ( Assertion ); + + bool isTypeOf( MetaTypeCptr ) const throw ( Assertion ); + + // + // Factory + // + bool isAbstractType( void ) const; protected: ! MetaType( void ) throw ( Assertion ); ! MetaType( MetaTypeCref ) throw ( Assertion ); protected: *************** *** 73,78 **** private: ! MetaTypeCptr *const theBaseClasses; ! CharCptr theName; }; --- 247,257 ---- private: ! DwordCref theVersion; ! DwordCref theInstanceSize; ! UniversalIdentifierCref theTypeId; ! MetaTypeCptr *const theBaseClasses; ! CharCptr theInstanceTypeName; ! CharCptr theMetaTypeName; ! AllocatorPtr theFactoryAllocator; }; Index: UniversalIdentifier.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/UniversalIdentifier.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** UniversalIdentifier.hpp 2000/10/01 15:56:21 1.1 --- UniversalIdentifier.hpp 2000/10/03 02:14:02 1.2 *************** *** 22,29 **** */ - #if !defined(__CLFWCOMMON_HPP) - #include <ClfwCommon.hpp> - #endif - namespace corelinux { --- 22,25 ---- |