|
From: Frank V. C. <fr...@us...> - 2000-10-29 17:09:55
|
Update of /cvsroot/corelinux/clfw/clfw In directory slayer.i.sourceforge.net:/tmp/cvs-serv27714/clfw Modified Files: Boolean.hpp MetaType.hpp RealNumber.hpp Log Message: 119678 Dispatch table for objects Index: Boolean.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/Boolean.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Boolean.hpp 2000/10/22 14:46:38 1.1 --- Boolean.hpp 2000/10/29 17:09:52 1.2 *************** *** 57,60 **** --- 57,74 ---- Boolean( void ); + /** + Copy constructor + @param Boolean const reference + */ + + Boolean( BooleanCref ); + + /** + Value constructor + @param bool const reference + */ + + Boolean( bool const & ); + /// Virtual destructor *************** *** 76,80 **** Equality operator @param bool const reference ! @return bool true if the same object instance */ --- 90,94 ---- Equality operator @param bool const reference ! @return bool true if the values are the same */ Index: MetaType.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/MetaType.hpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** MetaType.hpp 2000/10/25 12:20:26 1.16 --- MetaType.hpp 2000/10/29 17:09:52 1.17 *************** *** 38,42 **** DECLARE_CLASS( DescriptorNotFound ); DECLARE_CLASS( AccessorNotFound ); - /*! --- 38,41 ---- *************** *** 76,79 **** --- 75,79 ---- static void destroy( className##Ptr aPointer ); \ static className##Ptr castDown( FrameworkEntityPtr ); \ + static className##Ref castDown( FrameworkEntityRef ); \ /** \ redefine the operator new[] \ *************** *** 295,299 **** Array storing the attribute descriptors \ */ \ ! MemberDescriptor const *className##Type##Members[] = \ { \ --- 295,299 ---- Array storing the attribute descriptors \ */ \ ! static MemberDescriptor const *className##Type##Members[] = \ { \ *************** *** 319,322 **** --- 319,371 ---- + typedef void (*DispatchFunction)( FrameworkEntityPtr, void *, void ** ); + struct __DispatchDescriptor + { + CharPtr theClassMethodName; + DispatchFunction theFunction; + } ; + + DECLARE_TYPE( struct __DispatchDescriptor, DispatchDescriptor ); + + /*! + \def DISPATCH_FUNCTION( className, methName ) + \brief Opens the standard header, body required to do something + \arg className : base name for method + \arg methName : unique name identifier + */ + #define DISPATCH_FUNCTION( className, methName ) \ + static extern "C" void className##methName( FrameworkEntityPtr aClass, void *ret, void **args ) \ + { \ + className##Ptr myPointer = className:::castDown( aClass ); + + #define CLOSE_DISPATH_FUNCTION \ + } + + /*! + \def DEFINE_DISPATCH_DESCRIPTOR( className, methName ) + \brief Defines a dispatch descriptor for a specific call + \arg className : identifies the class + \arg classMethName : identifies the class method that is called + \arg methName : identifies the dispath function + */ + + #define DEFINE_DISPATCH_DESCRIPTOR( className, classMethName, methName ) \ + static DispatchDescriptor className##Dispatch##methName = \ + { #classMethName, className##methName } + + #define OPEN_DISPATCH_TABLE( className ) \ + static DispatchDescriptor const *className##DispatchTable[] = \ + { \ + + #define DEFINE_DISPATCH_ENTRY( className, methName ) \ + &className##Dispatch##methName, + + #define CLOSE_DISPATH_TABLE \ + 0 } + + #define DEFINE_DUMMY_DISPATCHTABLE( className ) \ + static DispatchDescriptor const *className##DispatchTable[] = \ + { 0 } + /*! \def _DEFINE_FACTORY( className ) *************** *** 370,373 **** --- 419,426 ---- aAlPtr->destroyType(aPtr); \ } \ + className##Ref className::castDown( FrameworkEntityRef aP ) \ + { \ + return dynamic_cast<className##Ref>(aP); \ + } \ className##Ptr className::castDown( FrameworkEntityPtr aP ) \ { \ *************** *** 515,519 **** ); \ } \ ! /*! \def _DEFINE_ENTITY_ALWAYS_PARMS(className,identification,version) --- 568,572 ---- ); \ } \ ! /*! \def _DEFINE_ENTITY_ALWAYS_PARMS(className,identification,version) *************** *** 531,537 **** className##Size, \ className##MetaType##Parents, \ ! className##Type##Members, - #define _DEFINE_SINGLE_STRINGID( className ) \ className##Name \ --- 584,590 ---- className##Size, \ className##MetaType##Parents, \ ! className##Type##Members, \ ! className##DispatchTable, #define _DEFINE_SINGLE_STRINGID( className ) \ className##Name \ *************** *** 655,658 **** --- 708,712 ---- ,&the##className##Allocator \ _DEFINE_ENTITY_ALWAYS(className) + /*! \class MetaType *************** *** 684,692 **** ( UniversalIdentifierCref , ! DwordCref , ! DwordCref , ! MetaTypeCptr *, ! MemberDescriptorCptr *, ! CharCptr , CharCptr ) throw ( Assertion ); --- 738,747 ---- ( UniversalIdentifierCref , ! DwordCref , ! DwordCref , ! MetaTypeCptr *, ! MemberDescriptorCptr *, ! DispatchDescriptorCptr *, ! CharCptr , CharCptr ) throw ( Assertion ); *************** *** 708,717 **** ( UniversalIdentifierCref , ! DwordCref , ! DwordCref , ! MetaTypeCptr *, ! MemberDescriptorCptr *, ! CharCptr , ! CharCptr , AllocatorPtr ) throw ( Assertion ); --- 763,773 ---- ( UniversalIdentifierCref , ! DwordCref , ! DwordCref , ! MetaTypeCptr *, ! MemberDescriptorCptr *, ! DispatchDescriptorCptr *, ! CharCptr , ! CharCptr , AllocatorPtr ) throw ( Assertion ); *************** *** 723,726 **** --- 779,789 ---- //@} + /** @name Operator overloads + */ + //@{ + + bool operator==( MetaTypeCptr ) const; + //@} + /** @name MetaType Accessors General accessors for the meta type and various descriptors *************** *** 764,767 **** --- 827,836 ---- /** + get the instance dispatch descriptors + */ + + DispatchDescriptorCptr * const getInstanceFunctions( void ) const; + + /** get the name of the instance of this MetaType. @return the name of the instance of this MetaType *************** *** 871,874 **** --- 940,944 ---- MetaType( MetaTypeCref ) throw ( Assertion ); + protected: *************** *** 881,884 **** --- 951,955 ---- MetaTypeCptr *const theBaseClasses; MemberDescriptorCptr *const theInstanceMembers; + DispatchDescriptorCptr *const theDispatchFunctions; CharCptr theInstanceTypeName; CharCptr theMetaTypeName; *************** *** 886,889 **** --- 957,961 ---- }; } + #endif // if !defined(__METATYPE_HPP) Index: RealNumber.hpp =================================================================== RCS file: /cvsroot/corelinux/clfw/clfw/RealNumber.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** RealNumber.hpp 2000/10/14 11:40:20 1.1 --- RealNumber.hpp 2000/10/29 17:09:52 1.2 *************** *** 36,40 **** /*! \class RealNumber ! Represents the subset of Numbers that are whole */ --- 36,40 ---- /*! \class RealNumber ! Represents the subset of Numbers that are real */ *************** *** 57,60 **** --- 57,74 ---- RealNumber( void ); + /** + Copy constructor + @param RealNumber const reference + */ + + RealNumber( RealNumberCref ); + + /** + Value constructor + @param Real const reference + */ + + RealNumber( RealCref ); + /// Virtual destructor *************** *** 74,77 **** --- 88,99 ---- /** + Equality operator + @param Real const reference + @return bool true if the values are the same + */ + + bool operator==( RealCref ) const; + + /** Assignment operator @param RealNumber const reference *************** *** 80,83 **** --- 102,111 ---- RealNumberRef operator=( RealNumberCref ); + + /** + Value Assignment operator + @param Real const reference + @returnm RealNumber reference to (*this) + */ RealNumberRef operator=( RealCref ); |