|
From: Christophe Prud'h. <pru...@us...> - 2000-10-03 23:16:21
|
Update of /cvsroot/corelinux/clfw/clfw In directory slayer.i.sourceforge.net:/tmp/cvs-serv31421/clfw Modified Files: UniversalIdentifier.hpp MetaType.hpp FrameworkEntity.hpp Log Message: added documentation for doxygen Index: UniversalIdentifier.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/UniversalIdentifier.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** UniversalIdentifier.hpp 2000/10/03 02:14:02 1.2 --- UniversalIdentifier.hpp 2000/10/03 23:16:17 1.3 *************** *** 36,39 **** --- 36,43 ---- DECLARE_CLASS( UniversalIdentifier ); + /*! + \class UniversalIdentifier + @version $Id$ + */ class UniversalIdentifier : public Identifier { *************** *** 73,83 **** // UniversalIdentifierRef operator=( UniversalIdentifierCref ); ! UniversalIdentifierRef operator=( CharPtr ) throw ( Assertion ); ! UniversalIdentifierRef operator=( UniqueIdRef ); ! UniversalIdentifierRef operator=( UniqueIdPtr ) throw ( Assertion ); --- 77,88 ---- // + /// copy operator from a UniversalIdentifierCref UniversalIdentifierRef operator=( UniversalIdentifierCref ); ! /// copy operator from a CharPtr UniversalIdentifierRef operator=( CharPtr ) throw ( Assertion ); ! /// copy operator from a UniqueIdRef UniversalIdentifierRef operator=( UniqueIdRef ); ! /// copy operator from a UniqueIdPtr UniversalIdentifierRef operator=( UniqueIdPtr ) throw ( Assertion ); *************** *** 112,116 **** // Mutators // ! static void setNewUid( UniversalIdentifierRef ); --- 117,124 ---- // Mutators // ! /// set a new unique Id ! /** ! @arg UniversalIdentifierRef ! */ static void setNewUid( UniversalIdentifierRef ); *************** *** 158,162 **** protected: ! UniqueId theID; private: --- 166,170 ---- protected: ! /// the UniqueId UniqueId theID; private: Index: MetaType.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/MetaType.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** MetaType.hpp 2000/10/03 02:14:02 1.4 --- MetaType.hpp 2000/10/03 23:16:17 1.5 *************** *** 26,33 **** #endif ! extern "C" ! { ! #include <stdio.h> ! } namespace corelinux --- 26,30 ---- #endif ! #include <cstdio> namespace corelinux *************** *** 35,78 **** 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> \ --- 32,134 ---- DECLARE_CLASS( MetaType ); ! /*! ! \def DECLARE_METATYPEMEMBERS( className ) ! \brief define the metaType member for className. ! ! This must be located within the class interface. ! ! \attention this macro defines public, protected and private members ! therefore if you do not call this macro at the end of the class interface ! you may have some surprises about the visiblity of your own class members. ! ! \arg className the class name ! */ #define DECLARE_METATYPEMEMBERS( className ) \ public: \ + /** \ + get the type descriptor \ + \return a const pointer to the MetaType \ + */ \ static MetaTypeCptr getTypeDescriptor( void ); \ + /** \ + get the type \ + \return a const pointer to the MetaType \ + */ \ virtual MetaTypeCptr getType( void ) const; \ + /** \ + create a new instance of className \ + \return a pointer to className \ + */ \ static className##Ptr create( void ); \ ! /** \ ! destroy a point of className \ ! \arg pointer to className \ ! */ \ ! static void destroy( className##Ptr aPointer ); \ ! /** \ ! redefine the operator new[] \ ! \arg aSize \ ! \return a VoidPtr \ ! */ \ VoidPtr operator new(size_t aSize); \ + /** \ + redefine the operator delete[] \ + \arg aVoidPtr the pointer to delete \ + */ \ void operator delete(VoidPtr aVoidPtr); \ protected: \ private: \ ! /** \ ! the MetaType descriptor \ ! */ \ ! static MetaType theTypeDesc; #define OPEN_METATYPE_PARENTS( className ) \ + /** \ + array storing the parents descriptors \ + */ \ MetaType const *className##MetaType##Parents[] = \ { \ #define DEFINE_METATYPE_PARENT( parentName ) \ + /** \ + parentName type descriptor \ + */ \ MetaType##parentName::getTypeDescriptor(), \ #define CLOSE_METATYPE_PARENT \ + /** \ + The parent type descriptor array must be termined by the NULLPTR \ + */ \ MetaTypeCptr(NULLPTR) \ } ! /*! ! \def _DEFINE_FACTORY( className ) ! \brief Define the factory allocator. ! \arg className: the class name to define the factory for ! */ #define _DEFINE_FACTORY( className ) \ CORELINUX_DEFAULT_ALLOCATOR( className##Allocator, className ) \ + /** \ + the className Allocator \ + */ \ static className##Allocator the##className##Allocator; ! /*! ! \def _DEFINE_ENTITY(className) ! \brief Defines the factory methods for the type. ! Define the create(), destroy() functions ! to create and destroy entities and also overload the new ! and delete operators which call create and destroy() ! \arg className: the class name ! */ #define _DEFINE_ENTITY(className) \ + /** \ + create a new pointer to className \ + \return the allocated pointer \ + */ \ className##Ptr className::create( void ) \ { \ className##Allocator##Ptr aAlPtr = \ dynamic_cast<className##Allocator##Ptr> \ *************** *** 80,86 **** 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> \ --- 136,145 ---- return aAlPtr->createType(); \ } \ + /** \ + destroy a pointer to className \ + \arg the pointer aPtr \ + */ \ void className::destroy( className##Ptr aPtr ) \ { \ className##Allocator##Ptr aAlPtr = \ dynamic_cast<className##Allocator##Ptr> \ *************** *** 88,95 **** --- 147,166 ---- aAlPtr->destroyType(aPtr); \ } \ + /** \ + redefine the operator new for className \ + this operator use the className::create() \ + function \ + \return a VoidPtr \ + */ \ VoidPtr className::operator new(size_t aSize) \ { \ 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) \ { \ *************** *** 97,102 **** className::destroy(aPtr); \ } \ ! #define _DEFINE_ENTITY_ALWAYS_PARMS(className,identification,version) \ MetaType className::theTypeDesc \ ( \ --- 168,180 ---- className::destroy(aPtr); \ } \ ! /*! ! \def _DEFINE_ENTITY_ALWAYS_PARMS(className,identification,version) ! calls the constructor of theTypeDesc and implements the ! getTypeDescriptor() and getType() functions ! */ #define _DEFINE_ENTITY_ALWAYS_PARMS(className,identification,version) \ + /** \ + construct the theTypeDesc \ + */ \ MetaType className::theTypeDesc \ ( \ *************** *** 117,124 **** --- 195,208 ---- #define _DEFINE_ENTITY_ALWAYS(className) \ ); \ + /** \ + implements the getType() function \ + */ \ MetaTypeCptr className::getType( void ) const \ { \ return &theTypeDesc; \ } \ + /** \ + implements the getTypeDescriptor() function \ + */ \ MetaTypeCptr className::getTypeDescriptor( void ) \ { \ *************** *** 129,133 **** #define DECLARE_METATYPE_MEMBERS( className ) ! #define DEFINE_ABSTRACT_METATYPE( className, identifier, version ) \ _DEFINE_ENTITY( className ) \ --- 213,224 ---- #define DECLARE_METATYPE_MEMBERS( className ) ! ! /*! ! \def DEFINE_ABSTRACT_METATYPE( className, identifier, version ) ! define a new abstract MetaType ! \arg className: the class name ! \arg identifier: the identifier, typically a UniversalIdentifier ! \arg version: the version number of the MetaType ! */ #define DEFINE_ABSTRACT_METATYPE( className, identifier, version ) \ _DEFINE_ENTITY( className ) \ *************** *** 135,139 **** _DEFINE_SINGLE_STRINGID(className) \ _DEFINE_ENTITY_ALWAYS(className) ! #define DEFINE_METATYPE( className, identifier, version ) \ _DEFINE_FACTORY( className ) \ --- 226,237 ---- _DEFINE_SINGLE_STRINGID(className) \ _DEFINE_ENTITY_ALWAYS(className) ! ! /*! ! \def DEFINE_METATYPE( className, identifier, version ) ! define a new MetaType ! \arg className: the class name ! \arg identifier: the identifier, typically a UniversalIdentifier ! \arg version: the version number of the MetaType ! */ #define DEFINE_METATYPE( className, identifier, version ) \ _DEFINE_FACTORY( className ) \ *************** *** 143,147 **** ,&the##className##Allocator \ _DEFINE_ENTITY_ALWAYS(className) ! #define DEFINE_METATYPE1( className, metaName,identifier, version ) \ _DEFINE_FACTORY( className ) \ --- 241,253 ---- ,&the##className##Allocator \ _DEFINE_ENTITY_ALWAYS(className) ! ! /*! ! \def DEFINE_METATYPE( className, metaName, identifier, version ) ! define a new MetaType but gives a name to the class as a meta class ! \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( className, metaName,identifier, version ) \ _DEFINE_FACTORY( className ) \ *************** *** 152,155 **** --- 258,267 ---- _DEFINE_ENTITY_ALWAYS(className) + /*! + \class MetaType + This class contains the meta informations on the classes using the metaClass framework. + + \version $Id$ + */ class MetaType { *************** *** 157,163 **** public: ! // ! // Constructor and destructors ! // /** Constructor requires meaningful information --- 269,275 ---- public: ! /** @name Constructor and destructors ! */ ! //@{ /** Constructor requires meaningful information *************** *** 208,231 **** virtual ~MetaType( void ); ! ! // ! // 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 ); --- 320,378 ---- virtual ~MetaType( void ); ! //@} ! ! /** @name Accessors ! */ ! //@{ ! ! /** ! get the UniversalIdentifier associated to the MetaType. ! @return a UniversalIdentifierCref ! */ UniversalIdentifierCref getIdentifier( void ) const; ! ! /** ! get the version of the MetaType. ! @return the version ! */ DwordCref getTypeVersion( void ) const; ! /** ! get the Parent types. ! @return an array of MetaType ! */ ! MetaTypeCptr const * const getParentTypes( void ) const; ! ! /** ! get the name of the instance of this MetaType. ! @return the name of the instance of this MetaType ! */ CharCptr getInstanceTypeName( void ) const; + /** + get the name of this MetaType. + @return the name of this MetaType + */ CharCptr getMetaTypeName( void ) const; + /** + get the Allocator associated to this MetaType. + @return the allocator + */ AllocatorPtr getAllocator( void ) const; + /** + test if this MetaType is of the same type as aMetaType. + @arg aMetaType the MetaType to test with + @return true if the same false otherwise + */ + bool isType( MetaTypeCptr aMetaType ) const throw ( Assertion ); + + + /** + test if this MetaType is of the same type as aMetaType. + @arg aMetaType the MetaType to test with + @return true if the same false otherwise + */ bool isTypeOf( MetaTypeCptr ) const throw ( Assertion ); *************** *** 234,243 **** // bool isAbstractType( void ) const; - protected: MetaType( void ) throw ( Assertion ); MetaType( MetaTypeCref ) throw ( Assertion ); --- 381,398 ---- // + /** + tells if the MetaType is an abstract one or not + @return true if it is an abstract metatype false otherwise + */ bool isAbstractType( void ) const; + + //@} protected: + /// default constructor is protected MetaType( void ) throw ( Assertion ); + + /// copy constructor is protected MetaType( MetaTypeCref ) throw ( Assertion ); Index: FrameworkEntity.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/FrameworkEntity.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** FrameworkEntity.hpp 2000/10/03 02:14:02 1.1 --- FrameworkEntity.hpp 2000/10/03 23:16:17 1.2 *************** *** 30,37 **** DECLARE_CLASS( FrameworkEntity ); class FrameworkEntity { DECLARE_METATYPEMEMBERS( FrameworkEntity ); - public: --- 30,40 ---- DECLARE_CLASS( FrameworkEntity ); + /*! + \class FrameworkEntity + @version $Id$ + */ class FrameworkEntity { DECLARE_METATYPEMEMBERS( FrameworkEntity ); public: |