|
From: Frank V. C. <fr...@us...> - 2000-11-15 04:33:04
|
Update of /cvsroot/corelinux/clfw/src/testdrivers/exf1 In directory slayer.i.sourceforge.net:/tmp/cvs-serv1096/src/testdrivers/exf1 Modified Files: examp1.cpp Log Message: 116737 Ontology work Index: examp1.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/testdrivers/exf1/examp1.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** examp1.cpp 2000/11/15 01:14:32 1.20 --- examp1.cpp 2000/11/15 04:33:02 1.21 *************** *** 105,113 **** --- 105,120 ---- void dumpMetaTypeInformation( MetaTypeCptr ); void dumpTypeInformation( FrameworkEntityPtr ); + void dumpInstanceMembers( MetaTypeCptr ); + void dumpInstanceMembers( MetaClassPtr ); + void dumpInstanceFunctions( MetaTypeCptr ); + void dumpInstanceFunctions( MetaClassPtr ); + void dumpParents( MetaTypeCptr ); + void dumpParents( MetaClassPtr ); void testDispatch( void ); + void walkOntology( MetaClassPtr , int ); void dumpOntology( void ); *************** *** 265,273 **** // Ontology *aOntology( MetaSpace::getOntology("corelinux") ); if( aOntology != NULLPTR ) { ! cout << "Have ontology " << aOntology->getDomainName() << endl; Iterator<MetaClassCptr> *aIterator( aOntology->createRootIterator()); --- 272,282 ---- // + cout << endl; + Ontology *aOntology( MetaSpace::getOntology("corelinux") ); if( aOntology != NULLPTR ) { ! cout << "Dumping ontology " << aOntology->getDomainName() << endl; Iterator<MetaClassCptr> *aIterator( aOntology->createRootIterator()); *************** *** 470,473 **** --- 479,504 ---- } + void dumpParents( MetaClassPtr aMCPtr ) + { + Iterator<MetaClassCptr> *aIterator + ( + aMCPtr->createParentIterator() + ); + + while( aIterator->isValid() ) + { + cout + << "\tClass = " << aIterator->getElement()->getTypeName() + << endl + << "\tMetaType = " << aIterator->getElement()->getMetaName() + << endl; + aIterator->setNext(); + } + + aMCPtr->destroyIterator( aIterator ); + + } + + // // Data member information *************** *** 534,537 **** --- 565,620 ---- } + void dumpInstanceMembers( MetaClassPtr aMCPtr ) + { + Iterator<MemberDescriptorCptr> *aIterator + ( + aMCPtr->createMemberIterator() + ); + + while( aIterator->isValid() ) + { + MemberDescriptorCptr anElement( aIterator->getElement() ); + + cout << "\tVar name = " << anElement->theTypeVariableName + << endl; + cout << "\tVar type = " << anElement->theTypeName + << endl; + cout << "\tVar size = " << anElement->theSizeInBytes + << endl; + + if( anElement->theTypePointer != NULLPTR ) + { + cout << "\tClass type = " + << anElement->theTypePointer->getInstanceTypeName() + << endl; + } + else + { + cout << "\tNot a FrameworkEntity" << endl; + } + + if( anElement->theGetter != NULLPTR ) + { + cout << "\tHas getter " << endl; + } + else + { + ; // do nothing + } + if( anElement->theSetter != NULLPTR ) + { + cout << "\tHas setter " << endl; + } + else + { + ; // do nothing + } + aIterator->setNext(); + } + + aMCPtr->destroyIterator( aIterator ); + + } + void dumpInstanceFunctions( MetaTypeCptr aMTPtr ) { *************** *** 561,564 **** --- 644,663 ---- } + void dumpInstanceFunctions( MetaClassPtr aMCPtr ) + { + Iterator<DispatchDescriptorCptr> *aIterator + ( + aMCPtr->createMethodIterator() + ); + + while( aIterator->isValid() ) + { + cout << "\tFunction name = " << + aIterator->getElement()->theClassMethodName << endl; + aIterator->setNext(); + } + + aMCPtr->destroyIterator( aIterator ); + } // |