|
From: Christophe Prud'h. <pru...@us...> - 2000-10-03 23:23:06
|
Update of /cvsroot/corelinux/clfw/src/testdrivers/exf1 In directory slayer.i.sourceforge.net:/tmp/cvs-serv5095/src/testdrivers/exf1 Modified Files: examp1.cpp Added Files: .cvsignore Log Message: some files to ignore in .cvsignore added a few function calls in the example examp1.cpp plus documentation --- NEW FILE --- .deps .libs Makefile Makefile.in Index: examp1.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/testdrivers/exf1/examp1.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** examp1.cpp 2000/10/03 02:14:04 1.1 --- examp1.cpp 2000/10/03 23:23:02 1.2 *************** *** 21,25 **** /** \example examp1.cpp This example is to show use of the MetaType object ! */ --- 21,28 ---- /** \example examp1.cpp This example is to show use of the MetaType object ! ! It is a trivial example of the metaClass features. It creates a type descriptor, aMT, for the FrameworkEntity ! class then it creates an instance, aFrameworkEntity, of this class. ! Finally it compares the type of aFrameworkEntity with FrameworkEntity (the answer should be yes :) ) */ *************** *** 67,79 **** int main( void ) { ! // ! // Practice gracefull exception management ! // ! try ! { // --- 70,84 ---- + + int main( void ) { ! // ! // Practice gracefull exception management ! // ! try ! { // *************** *** 82,87 **** // - cout << "Made it hello world" << endl; - const MetaType *aMT= FrameworkEntity::getTypeDescriptor(); --- 87,90 ---- *************** *** 91,121 **** FrameworkEntityPtr aFrameworkEntity = new FrameworkEntity; - - cout << "Framework entity = " << aFrameworkEntity << endl; ! cout << "Compare meta-types = " << aFrameworkEntity->getType()->isType(aMT) << endl; delete aFrameworkEntity; ! ! } ! catch( AssertionRef aAssert ) ! { handleAssertion(aAssert); ! } ! catch( ExceptionRef aException ) ! { handleException(aException); ! } ! catch( std::exception & e ) ! { cerr << e.what() << endl; ! } ! catch( ... ) ! { cerr << "Unknown exception." << endl; ! } ! // No line exceeds the 78 column positions (Section 4.6) --| ! return 0; // Single exit point (Section 4.0) } --- 94,135 ---- FrameworkEntityPtr aFrameworkEntity = new FrameworkEntity; ! cout << "Framework entity = " << aFrameworkEntity << endl ! << "Framework entity type version = " << aFrameworkEntity->getType()->getTypeVersion() << endl ! << "Framework entity Instance name = " << aFrameworkEntity->getType()->getInstanceTypeName() << endl ! << "Framework entity Meta name = " << aFrameworkEntity->getType()->getMetaTypeName() << endl; ! ! cout << "Compare meta-types (is aFrameworkEntity of type FrameworkEntity?) = "; ! if ( aFrameworkEntity->getType()->isType(aMT) == true ) ! { ! cout << "yes!" << endl; ! } ! else ! { ! cout << "no!" << endl; ! } delete aFrameworkEntity; ! delete aMT; ! } ! catch( AssertionRef aAssert ) ! { handleAssertion(aAssert); ! } ! catch( ExceptionRef aException ) ! { handleException(aException); ! } ! catch( std::exception & e ) ! { cerr << e.what() << endl; ! } ! catch( ... ) ! { cerr << "Unknown exception." << endl; ! } ! // No line exceeds the 78 column positions (Section 4.6) --| ! return 0; // Single exit point (Section 4.0) } |