|
From: Frank V. C. <fr...@us...> - 2000-11-15 23:07:24
|
Update of /cvsroot/corelinux/clfw/src/libs/clfw In directory slayer.i.sourceforge.net:/tmp/cvs-serv22653/src/libs/clfw Modified Files: MetaClass.cpp MetaSpace.cpp MetaType.cpp Ontology.cpp Log Message: 116737 Finishing touches Index: MetaClass.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/MetaClass.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** MetaClass.cpp 2000/11/15 12:29:31 1.3 --- MetaClass.cpp 2000/11/15 23:07:21 1.4 *************** *** 47,62 **** Iterator<T>(), theBase( NULLPTR ), ! theCurrent( NULLPTR ), ! theCount( 0 ) { ; // do nothing } ! FixedParentIterator( MetaTypeCptr *a, Count aCount ) : Iterator<T>(), theBase( a ), ! theCurrent( a ), ! theCount( aCount ) { ; // do nothing --- 47,60 ---- Iterator<T>(), theBase( NULLPTR ), ! theIterator( NULLPTR ) { ; // do nothing } ! FixedParentIterator( MetaTypePtr a ) : Iterator<T>(), theBase( a ), ! theIterator( theBase->createParentIterator() ) { ; // do nothing *************** *** 67,72 **** Iterator<T>( aRef ), theBase( aRef.theBase ), ! theCurrent( theBase ), ! theCount( aRef.theCount ) { ; // do nothing --- 65,69 ---- Iterator<T>( aRef ), theBase( aRef.theBase ), ! theIterator( theBase->createParentIterator() ) { ; // do nothing *************** *** 75,94 **** virtual ~FixedParentIterator( void ) { ! theBase = theCurrent = NULLPTR; ! theCount = 0; } virtual bool isValid( void ) const { ! return !(*theCurrent == NULLPTR); } ! virtual MetaClassCptr getElement( void ) const throw(IteratorBoundsException) { ! MetaClassCptr aClass( NULLPTR ); ! if( this->isValid() == false ) { throw IteratorBoundsException(LOCATION); --- 72,92 ---- virtual ~FixedParentIterator( void ) { ! theBase->destroyIterator( theIterator ); ! theBase = NULLPTR; ! theIterator = NULLPTR; } virtual bool isValid( void ) const { ! return theIterator->isValid(); } ! virtual T getElement( void ) const throw(IteratorBoundsException) { ! T aClass( NULLPTR ); ! if( theIterator->isValid() == false ) { throw IteratorBoundsException(LOCATION); *************** *** 96,100 **** else { ! aClass = MetaSpace::getClassForType( *theCurrent ); } return aClass; --- 94,98 ---- else { ! aClass = MetaSpace::getClassForType( theIterator->getElement() ); } return aClass; *************** *** 102,106 **** virtual void setFirst( void ) { ! theCurrent = theBase; } --- 100,104 ---- virtual void setFirst( void ) { ! theIterator->setFirst(); } *************** *** 109,120 **** throw(IteratorBoundsException) { ! if( *theCurrent != NULLPTR ) ! { ! ++theCurrent; ! } ! else ! { ! throw IteratorBoundsException(LOCATION); ! } } --- 107,111 ---- throw(IteratorBoundsException) { ! theIterator->setNext(); } *************** *** 123,135 **** throw(IteratorBoundsException) { ! if( theCurrent != theBase && ! *theBase != NULLPTR ) ! { ! --theCurrent; ! } ! else ! { ! throw IteratorBoundsException(LOCATION); ! } } --- 114,118 ---- throw(IteratorBoundsException) { ! theIterator->setPrevious(); } *************** *** 139,144 **** throw(IteratorBoundsException) { ! theCurrent = theBase; ! for( Count x = 0; x < theCount; ++x, ++theCurrent ); } --- 122,126 ---- throw(IteratorBoundsException) { ! theIterator->setLast(); } *************** *** 146,152 **** private: ! MetaTypeCptr *theBase; ! MetaTypeCptr *theCurrent; ! Count theCount; }; --- 128,133 ---- private: ! MetaTypePtr theBase; ! Iterator<MetaTypePtr> *theIterator; }; *************** *** 158,162 **** MetaClass::MetaClass( void ) : ! TransparentComponent<MetaClassCptr>(), theType( NULLPTR ) { --- 139,143 ---- MetaClass::MetaClass( void ) : ! TransparentComponent<MetaClassPtr>(), theType( NULLPTR ) { *************** *** 170,174 **** MetaClass::MetaClass( MetaClassCref aRef ) : ! TransparentComponent<MetaClassCptr>( aRef ), theType( NULLPTR ) { --- 151,155 ---- MetaClass::MetaClass( MetaClassCref aRef ) : ! TransparentComponent<MetaClassPtr>( aRef ), theType( NULLPTR ) { *************** *** 180,186 **** // ! MetaClass::MetaClass( MetaTypeCptr aType ) : ! TransparentComponent<MetaClassCptr>(), theType( aType ) { --- 161,167 ---- // ! MetaClass::MetaClass( MetaTypePtr aType ) : ! TransparentComponent<MetaClassPtr>(), theType( aType ) { *************** *** 251,255 **** // ! void MetaClass::addComponent( MetaClassCptr aClass ) throw(InvalidCompositeException) { --- 232,236 ---- // ! void MetaClass::addComponent( MetaClassPtr aClass ) throw(InvalidCompositeException) { *************** *** 268,272 **** // ! void MetaClass::removeComponent( MetaClassCptr aClass ) throw(InvalidCompositeException) { --- 249,253 ---- // ! void MetaClass::removeComponent( MetaClassPtr aClass ) throw(InvalidCompositeException) { *************** *** 293,300 **** // ! Iterator<MetaClassCptr> *MetaClass::createIterator( void ) throw( InvalidCompositeException ) { ! return new CoreLinuxIterator<ChildrenIterator,MetaClassCptr> ( theChildren.begin(), --- 274,281 ---- // ! Iterator<MetaClassPtr> *MetaClass::createIterator( void ) throw( InvalidCompositeException ) { ! return new CoreLinuxIterator<ChildrenIterator,MetaClassPtr> ( theChildren.begin(), *************** *** 307,318 **** // ! Iterator<MetaClassCptr> *MetaClass::createParentIterator( void ) throw( InvalidCompositeException ) { ! return new FixedParentIterator<MetaClassCptr> ! ( ! theType->getParentTypes(), ! theType->getParentCount() ! ); } --- 288,295 ---- // ! Iterator<MetaClassPtr> *MetaClass::createParentIterator( void ) throw( InvalidCompositeException ) { ! return new FixedParentIterator<MetaClassPtr>(theType); } *************** *** 321,328 **** // ! Iterator<MemberDescriptorCptr> *MetaClass::createMemberIterator( void ) throw( InvalidCompositeException ) { ! return MetaTypePtr(theType)->createMemberIterator(); } --- 298,305 ---- // ! Iterator<MemberDescriptorPtr> *MetaClass::createMemberIterator( void ) throw( InvalidCompositeException ) { ! return theType->createMemberIterator(); } *************** *** 331,338 **** // ! Iterator<DispatchDescriptorCptr> *MetaClass::createMethodIterator( void ) throw( InvalidCompositeException ) { ! return MetaTypePtr(theType)->createMethodIterator(); } --- 308,315 ---- // ! Iterator<DispatchDescriptorPtr> *MetaClass::createMethodIterator( void ) throw( InvalidCompositeException ) { ! return theType->createMethodIterator(); } *************** *** 341,345 **** // ! void MetaClass::destroyIterator( Iterator<MetaClassCptr> *anIterator ) throw( InvalidCompositeException ) { --- 318,322 ---- // ! void MetaClass::destroyIterator( Iterator<MetaClassPtr> *anIterator ) throw( InvalidCompositeException ) { *************** *** 352,359 **** // ! void MetaClass::destroyIterator( Iterator<MemberDescriptorCptr> *anIterator ) throw( InvalidCompositeException ) { ! MetaTypePtr(theType)->destroyIterator(anIterator); } --- 329,336 ---- // ! void MetaClass::destroyIterator( Iterator<MemberDescriptorPtr> *anIterator ) throw( InvalidCompositeException ) { ! theType->destroyIterator(anIterator); } *************** *** 362,369 **** // ! void MetaClass::destroyIterator( Iterator<DispatchDescriptorCptr> *anIterator ) throw( InvalidCompositeException ) { ! MetaTypePtr(theType)->destroyIterator(anIterator); } --- 339,346 ---- // ! void MetaClass::destroyIterator( Iterator<DispatchDescriptorPtr> *anIterator ) throw( InvalidCompositeException ) { ! theType->destroyIterator(anIterator); } Index: MetaSpace.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/MetaSpace.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** MetaSpace.cpp 2000/11/15 04:33:01 1.4 --- MetaSpace.cpp 2000/11/15 23:07:21 1.5 *************** *** 112,118 **** // ! MetaClassCptr MetaSpace::getClassForType( MetaTypeCptr aType ) { ! MetaClassCptr aClass( NULLPTR ); if( MetaSpace::theInitializedFlag == true ) --- 112,118 ---- // ! MetaClassPtr MetaSpace::getClassForType( MetaTypePtr aType ) { ! MetaClassPtr aClass( NULLPTR ); if( MetaSpace::theInitializedFlag == true ) *************** *** 226,230 **** while( aLink != NULLPTR ) { ! MetaTypeCptr aMT = ( MetaTypeCptr ) aLink->data; aFItr = theMap->find(aMT->getDomainName()); --- 226,230 ---- while( aLink != NULLPTR ) { ! MetaTypePtr aMT = ( MetaTypePtr ) aLink->data; aFItr = theMap->find(aMT->getDomainName()); Index: MetaType.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/MetaType.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** MetaType.cpp 2000/11/15 12:29:31 1.16 --- MetaType.cpp 2000/11/15 23:07:21 1.17 *************** *** 48,51 **** --- 48,102 ---- namespace corelinux { + // + // Templated link builders + // + + template < class T > MetaType::InfoLinkPtr createLinks( T const **aBlock ) + { + MetaType::InfoLinkPtr aBase( new MetaType::InfoLink ); + + // By default we have at least one + + aBase->next = NULLPTR; + aBase->data = NULLPTR; + + // If the array is not empty + + if( *aBlock != NULLPTR ) + { + MetaType::InfoLinkPtr aCurrent( aBase ); + + // At least get the first one + + aCurrent->data = (void *)*aBlock; + + ++aBlock; + + // Now go through the rest + + while( *aBlock != NULLPTR ) + { + MetaType::InfoLink *aLink( new MetaType::InfoLink ); + aCurrent->next = aLink; + aLink->data = (void *)*aBlock; + aLink->next = NULLPTR; + aCurrent = aLink; + ++aBlock; + } + + // Add the tail + + aCurrent->next = new MetaType::InfoLink; + aCurrent->next->data = NULLPTR; + aCurrent->next->next = NULLPTR; + } + else + { + ; // do nothing + } + + return aBase; + } + CharCptr MetaType::theDefaultDomainName = "corelinux"; *************** *** 71,77 **** theInstanceSize( aSize ), theTypeId( aMetaTypeUid ), ! theBaseClasses( aParentArray ), ! theInstanceMembers( aMemberArray ), ! theDispatchFunctions( aDispatchArray ), theDomainName( (aDomainName != NULLPTR ? aDomainName : MetaType::theDefaultDomainName) ), theTypeDescription( aDescription ), --- 122,128 ---- theInstanceSize( aSize ), theTypeId( aMetaTypeUid ), ! theParents( NULLPTR ), ! theMembers( NULLPTR ), ! theMethods( NULLPTR ), theDomainName( (aDomainName != NULLPTR ? aDomainName : MetaType::theDefaultDomainName) ), theTypeDescription( aDescription ), *************** *** 80,83 **** --- 131,137 ---- theFactoryAllocator( NULLPTR ) { + theParents = createLinks<MetaType>(aParentArray); + theMembers = createLinks<MemberDescriptor>(aMemberArray); + theMethods = createLinks<DispatchDescriptor>(aDispatchArray); MetaSpace::storeType( this ); } *************** *** 105,111 **** theInstanceSize( aSize ), theTypeId( aMetaTypeUid ), ! theBaseClasses( aParentArray ), ! theInstanceMembers( aMemberArray ), ! theDispatchFunctions( aDispatchArray ), theDomainName( (aDomainName != NULLPTR ? aDomainName : MetaType::theDefaultDomainName) ), theTypeDescription( aDescription ), --- 159,165 ---- theInstanceSize( aSize ), theTypeId( aMetaTypeUid ), ! theParents( NULLPTR ), ! theMembers( NULLPTR ), ! theMethods( NULLPTR ), theDomainName( (aDomainName != NULLPTR ? aDomainName : MetaType::theDefaultDomainName) ), theTypeDescription( aDescription ), *************** *** 114,117 **** --- 168,175 ---- theFactoryAllocator( aAllocation ) { + theParents = createLinks<MetaType>(aParentArray); + theMembers = createLinks<MemberDescriptor>(aMemberArray); + theMethods = createLinks<DispatchDescriptor>(aDispatchArray); + MetaSpace::storeType( this ); } *************** *** 125,129 **** theVersion( gNoVersion ), theInstanceSize( gNoVersion ), ! theTypeId( UniversalIdentifier::getZeroUid() ) { NEVER_GET_HERE; --- 183,190 ---- theVersion( gNoVersion ), theInstanceSize( gNoVersion ), ! theTypeId( UniversalIdentifier::getZeroUid() ), ! theParents( NULLPTR ), ! theMembers( NULLPTR ), ! theMethods( NULLPTR ) { NEVER_GET_HERE; *************** *** 138,142 **** theVersion( gNoVersion ), theInstanceSize( gNoVersion ), ! theTypeId(aMetaType.theTypeId) { NEVER_GET_HERE; --- 199,206 ---- theVersion( gNoVersion ), theInstanceSize( gNoVersion ), ! theTypeId(aMetaType.theTypeId), ! theParents( NULLPTR ), ! theMembers( NULLPTR ), ! theMethods( NULLPTR ) { NEVER_GET_HERE; *************** *** 173,239 **** } - // Get the list of parents - - MetaTypeCptr *const MetaType::getParentTypes( void ) const - { - return theBaseClasses; - } - // Get the count of parents Count MetaType::getParentCount( void ) const { ! Count aValue(0); ! MetaTypeCptr *pMt( this->getParentTypes() ); ! while(*pMt++ != NULLPTR ) { ++aValue; ! } return aValue; } - - // Get the list of data members - - MemberDescriptorCptr * const MetaType::getInstanceMembers( void ) const - { - return theInstanceMembers; - } - // Get the count of members declared Count MetaType::getInstanceMemberCount( void ) const { ! Count aValue(0); ! MemberDescriptorCptr *pMt( this->getInstanceMembers() ); ! while(*pMt++ != NULLPTR ) { ++aValue; ! } return aValue; } - // Get the list of function dispatch descriptors - - DispatchDescriptorCptr *const MetaType::getInstanceFunctions( void ) const - { - return theDispatchFunctions; - } - // Get the count of members declared Count MetaType::getInstanceFunctionCount( void ) const { ! Count aValue(0); ! DispatchDescriptorCptr *pMt( this->getInstanceFunctions() ); ! while(*pMt++ != NULLPTR ) { ++aValue; ! } return aValue; --- 237,281 ---- } // Get the count of parents Count MetaType::getParentCount( void ) const { ! Count aValue(0); ! MetaTypeFixedIterator<MetaTypePtr> aIterator(theParents); ! for( ; aIterator.isValid(); aIterator.setNext() ) { ++aValue; ! } return aValue; } // Get the count of members declared Count MetaType::getInstanceMemberCount( void ) const { ! Count aValue(0); ! MetaTypeFixedIterator<MemberDescriptorPtr> aIterator(theMembers); ! for( ; aIterator.isValid(); aIterator.setNext() ) { ++aValue; ! } return aValue; } // Get the count of members declared Count MetaType::getInstanceFunctionCount( void ) const { ! Count aValue(0); ! MetaTypeFixedIterator<DispatchDescriptorPtr> aIterator(theMethods); ! for( ; aIterator.isValid(); aIterator.setNext() ) { ++aValue; ! } return aValue; *************** *** 295,302 **** if( aTypeOf == false ) { ! MetaTypeCptr *pMt = theBaseClasses; ! while(*pMt != NULLPTR ) { ! if( (*pMt++)->isTypeOf(aTypePtr) == true ) { aTypeOf = true; --- 337,344 ---- if( aTypeOf == false ) { ! MetaTypeFixedIterator<MetaTypePtr> aIterator(theParents); ! while( aIterator.isValid() ) { ! if( aIterator.getElement()->isTypeOf( aTypePtr ) == true ) { aTypeOf = true; *************** *** 307,311 **** --- 349,355 ---- ; // do nothing } + aIterator.setNext(); } + } else *************** *** 354,370 **** // ! MemberDescriptorCptr aDesc( NULLPTR ); VoidPtr aValuePtr( NULLPTR ); ! MemberDescriptorCptr *pMd(theInstanceMembers); ! while( *pMd != NULLPTR ) { ! if( strcmp((*pMd)->theTypeVariableName,aName) == 0 ) { ! aDesc = *pMd; if( aDesc->theGetter != NULLPTR ) { aValuePtr = (*(aDesc->theGetter))(anInstance); } else --- 398,416 ---- // ! MemberDescriptorPtr aDesc( NULLPTR ); VoidPtr aValuePtr( NULLPTR ); ! MetaTypeFixedIterator<MemberDescriptorPtr> aIterator(theMembers); ! while( aIterator.isValid() ) { ! ! if( strcmp(aIterator.getElement()->theTypeVariableName,aName) == 0 ) { ! aDesc = aIterator.getElement(); if( aDesc->theGetter != NULLPTR ) { aValuePtr = (*(aDesc->theGetter))(anInstance); + break; } else *************** *** 372,376 **** throw AccessorNotFound(aName, LOCATION); } - break; } else --- 418,421 ---- *************** *** 378,382 **** ; // do nothing } ! ++pMd; } --- 423,428 ---- ; // do nothing } ! ! aIterator.setNext(); } *************** *** 423,436 **** MemberDescriptorCptr aDesc( NULLPTR ); ! MemberDescriptorCptr *pMd(theInstanceMembers); ! while( *pMd != NULLPTR ) { ! if( strcmp((*pMd)->theTypeVariableName,aName) == 0 ) { ! aDesc = *pMd; if( aDesc->theSetter != NULLPTR ) { (*(aDesc->theSetter))(anInstance,aValuePtr); } else --- 469,484 ---- MemberDescriptorCptr aDesc( NULLPTR ); ! MetaTypeFixedIterator<MemberDescriptorPtr> aIterator(theMembers); ! while( aIterator.isValid() ) { ! ! if( strcmp(aIterator.getElement()->theTypeVariableName,aName) == 0 ) { ! aDesc = aIterator.getElement(); if( aDesc->theSetter != NULLPTR ) { (*(aDesc->theSetter))(anInstance,aValuePtr); + break; } else *************** *** 438,442 **** throw AccessorNotFound(aName, LOCATION); } - break; } else --- 486,489 ---- *************** *** 444,448 **** ; // do nothing } ! ++pMd; } --- 491,496 ---- ; // do nothing } ! ! aIterator.setNext(); } *************** *** 484,498 **** DispatchDescriptorCptr aDesc( NULLPTR ); - - DispatchDescriptorCptr *pMd(theDispatchFunctions); ! while( *pMd != NULLPTR ) { ! if( strcmp((*pMd)->theClassMethodName,aFunctionName) == 0 ) { ! aDesc = *pMd; if( aDesc->theFunction != NULLPTR ) { (*(aDesc->theFunction))(aInstanceObject,args,retArg); } else --- 532,546 ---- DispatchDescriptorCptr aDesc( NULLPTR ); ! MetaTypeFixedIterator<DispatchDescriptorPtr> aIterator(theMethods); ! while( aIterator.isValid() ) { ! if( strcmp( aIterator.getElement()->theClassMethodName,aFunctionName) == 0 ) { ! aDesc = aIterator.getElement(); if( aDesc->theFunction != NULLPTR ) { (*(aDesc->theFunction))(aInstanceObject,args,retArg); + break; } else *************** *** 500,504 **** throw NullPointerException(LOCATION); } - break; } else --- 548,551 ---- *************** *** 506,510 **** ; // do nothing } ! ++pMd; } --- 553,557 ---- ; // do nothing } ! aIterator.setNext(); } *************** *** 544,558 **** DispatchDescriptorCptr aDesc( NULLPTR ); - - DispatchDescriptorCptr *pMd(theDispatchFunctions); ! while( *pMd != NULLPTR ) { ! if( strcmp((*pMd)->theClassMethodName,aFunctionName) == 0 ) { ! aDesc = *pMd; if( aDesc->theFunction != NULLPTR ) { ! (*(aDesc->theFunction))(NULLPTR, args, retArg ); } else --- 591,605 ---- DispatchDescriptorCptr aDesc( NULLPTR ); ! MetaTypeFixedIterator<DispatchDescriptorPtr> aIterator(theMethods); ! while( aIterator.isValid() ) { ! if( strcmp( aIterator.getElement()->theClassMethodName,aFunctionName) == 0 ) { ! aDesc = aIterator.getElement(); if( aDesc->theFunction != NULLPTR ) { ! (*(aDesc->theFunction))(NULLPTR,args,retArg); ! break; } else *************** *** 560,564 **** throw NullPointerException(LOCATION); } - break; } else --- 607,610 ---- *************** *** 566,570 **** ; // do nothing } ! ++pMd; } --- 612,616 ---- ; // do nothing } ! aIterator.setNext(); } *************** *** 582,592 **** // ! Iterator<MetaTypeCptr> *MetaType::createParentIterator( void ) { ! return new MetaTypeFixedIterator<MetaTypeCptr> ! ( ! this->getParentTypes(), ! this->getParentCount() ! ); } --- 628,634 ---- // ! Iterator<MetaTypePtr> *MetaType::createParentIterator( void ) { ! return new MetaTypeFixedIterator<MetaTypePtr>(theParents); } *************** *** 595,605 **** // ! Iterator<MemberDescriptorCptr> *MetaType::createMemberIterator( void ) { ! return new MetaTypeFixedIterator<MemberDescriptorCptr> ! ( ! this->getInstanceMembers(), ! this->getInstanceMemberCount() ! ); } --- 637,643 ---- // ! Iterator<MemberDescriptorPtr> *MetaType::createMemberIterator( void ) { ! return new MetaTypeFixedIterator<MemberDescriptorPtr>(theMembers); } *************** *** 608,618 **** // ! Iterator<DispatchDescriptorCptr> *MetaType::createMethodIterator( void ) { ! return new MetaTypeFixedIterator<DispatchDescriptorCptr> ! ( ! this->getInstanceFunctions(), ! this->getInstanceFunctionCount() ! ); } --- 646,652 ---- // ! Iterator<DispatchDescriptorPtr> *MetaType::createMethodIterator( void ) { ! return new MetaTypeFixedIterator<DispatchDescriptorPtr>(theMethods); } *************** *** 621,625 **** // ! void MetaType::destroyIterator( Iterator<MetaTypeCptr> *anIterator ) { delete anIterator; --- 655,659 ---- // ! void MetaType::destroyIterator( Iterator<MetaTypePtr> *anIterator ) { delete anIterator; *************** *** 631,635 **** // ! void MetaType::destroyIterator( Iterator<MemberDescriptorCptr> *anIterator ) { delete anIterator; --- 665,669 ---- // ! void MetaType::destroyIterator( Iterator<MemberDescriptorPtr> *anIterator ) { delete anIterator; *************** *** 640,644 **** // ! void MetaType::destroyIterator( Iterator<DispatchDescriptorCptr> *anIterator ) { delete anIterator; --- 674,678 ---- // ! void MetaType::destroyIterator( Iterator<DispatchDescriptorPtr> *anIterator ) { delete anIterator; Index: Ontology.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/Ontology.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Ontology.cpp 2000/11/15 04:33:01 1.5 --- Ontology.cpp 2000/11/15 23:07:21 1.6 *************** *** 143,147 **** // ! void Ontology::addMetaType( MetaTypeCptr aMetaType ) { if( aMetaType == NULLPTR ) --- 143,147 ---- // ! void Ontology::addMetaType( MetaTypePtr aMetaType ) { if( aMetaType == NULLPTR ) *************** *** 161,165 **** // ! void Ontology::addAsChild( MetaTypeCptr aParent, MetaClassCptr aChild ) throw ( NullPointerException ) { --- 161,165 ---- // ! void Ontology::addAsChild( MetaTypePtr aParent, MetaClassPtr aChild ) throw ( NullPointerException ) { *************** *** 189,193 **** ( UniversalIdentifierCref aParentId, ! MetaTypeCptr aChild ) throw ( NullPointerException ) --- 189,193 ---- ( UniversalIdentifierCref aParentId, ! MetaTypePtr aChild ) throw ( NullPointerException ) *************** *** 263,267 **** // ! void Ontology::seedMetaType( MetaTypeCptr aMetaType ) { if( aMetaType == NULLPTR ) --- 263,267 ---- // ! void Ontology::seedMetaType( MetaTypePtr aMetaType ) { if( aMetaType == NULLPTR ) *************** *** 306,310 **** // ! void Ontology::insertType( MetaTypeCptr aType, MetaClassPtr aClass ) { Count parentCount( aType->getParentCount() ); --- 306,310 ---- // ! void Ontology::insertType( MetaTypePtr aType, MetaClassPtr aClass ) { Count parentCount( aType->getParentCount() ); *************** *** 326,335 **** else { ! Count nonLocal(0); ! MetaTypeCptr *parents( aType->getParentTypes() ); ! while( *parents != NULLPTR ) { ! CharCptr aDomainName((*parents)->getDomainName()); // // If parent is local to this ontology --- 326,335 ---- else { ! Count nonLocal(0); ! Iterator<MetaTypePtr> *aIterator( aType->createParentIterator() ); ! while( aIterator->isValid() ) { ! CharCptr aDomainName( aIterator->getElement()->getDomainName()); // // If parent is local to this ontology *************** *** 338,342 **** if( strcmp(theDomainName,aDomainName) == 0 ) { ! this->addAsChild( *parents, aClass ); } --- 338,342 ---- if( strcmp(theDomainName,aDomainName) == 0 ) { ! this->addAsChild( aIterator->getElement(), aClass ); } *************** *** 352,356 **** if( aOntology != NULLPTR ) { ! aOntology->addAsChild( *parents, aClass ); } else --- 352,356 ---- if( aOntology != NULLPTR ) { ! aOntology->addAsChild( aIterator->getElement(), aClass ); } else *************** *** 360,365 **** ++nonLocal; } ! ++parents; } // --- 360,366 ---- ++nonLocal; } ! aIterator->setNext(); } + aType->destroyIterator( aIterator ); // *************** *** 384,390 **** // ! MetaClassCptr Ontology::getClass( MetaTypeCptr aType ) const { ! MetaClassCptr aClass( NULLPTR ); if( strcmp( theDomainName, aType->getDomainName() ) == 0 ) --- 385,391 ---- // ! MetaClassPtr Ontology::getClass( MetaTypePtr aType ) const { ! MetaClassPtr aClass( NULLPTR ); if( strcmp( theDomainName, aType->getDomainName() ) == 0 ) |