|
From: Frank V. C. <fr...@us...> - 2000-10-29 17:09:55
|
Update of /cvsroot/corelinux/clfw/src/testdrivers/exf1 In directory slayer.i.sourceforge.net:/tmp/cvs-serv27714/src/testdrivers/exf1 Modified Files: examp1.cpp Log Message: 119678 Dispatch table for objects Index: examp1.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/testdrivers/exf1/examp1.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** examp1.cpp 2000/10/27 12:41:35 1.15 --- examp1.cpp 2000/10/29 17:09:53 1.16 *************** *** 49,52 **** --- 49,56 ---- #endif + #if !defined(__REALNUMBER_HPP) + #include <clfw/RealNumber.hpp> + #endif + #if !defined(__SHORTINTEGER_HPP) #include <clfw/ShortInteger.hpp> *************** *** 81,84 **** --- 85,89 ---- void dumpTypeInformation( FrameworkEntityPtr ); void dumpInstanceMembers( MetaTypeCptr ); + void dumpInstanceFunctions( MetaTypeCptr ); void dumpParents( MetaTypeCptr ); *************** *** 144,147 **** --- 149,169 ---- // + // bool + + BooleanPtr aBoolean = new Boolean(true); + dumpTypeInformation( aBoolean ); + cout << "Value of aBoolean = " << + getValue<bool>("Value",aBoolean) << endl; + delete aBoolean; + + // real + + RealNumberPtr aReal = RealNumber::create(); + setValue<Real>("Value",9.7,aReal); + dumpTypeInformation( aReal ); + cout << "Value of aReal = " << + getValue<Real>("Value",aReal) << endl; + RealNumber::destroy( aReal ); + // signed Integer *************** *** 257,260 **** --- 279,288 ---- dumpInstanceMembers( aMTPtr ); + // + // Dump dispatch table + // + + dumpInstanceFunctions( aMTPtr ); + } // *************** *** 348,351 **** --- 376,407 ---- } + + void dumpInstanceFunctions( MetaTypeCptr aMTPtr ) + { + DispatchDescriptorCptr * const aMDescs = aMTPtr->getInstanceFunctions(); + + cout << endl << "Instance Function List : " << endl; + if( aMDescs == NULLPTR ) + { + cout << "Internal class error for functions : " << + aMTPtr->getInstanceTypeName() << endl; + } + else + { + if( aMDescs[0] != NULLPTR ) + { + for( int x = 0; aMDescs[x] != NULLPTR; ++x ) + { + cout << "\tFunction name = " << aMDescs[x]->theClassMethodName << endl + << "\tFunction address = " << aMDescs[x]->theFunction << endl; + } + } + else + { + cout << "\tNo function members" << endl; + } + } + } + // |