|
From: Frank V. C. <fr...@us...> - 2001-04-21 21:39:05
|
Update of /cvsroot/corelinux/clfw/src/libs/clfw
In directory usw-pr-cvs1:/tmp/cvs-serv16775/src/libs/clfw
Modified Files:
MetaClass.cpp Ontology.cpp
Log Message:
Creates actual schema db now, although no content. Cleaning, testing, and embellishing
Index: MetaClass.cpp
===================================================================
RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/MetaClass.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** MetaClass.cpp 2000/11/18 20:38:46 1.6
--- MetaClass.cpp 2001/04/21 21:39:01 1.7
***************
*** 204,207 ****
--- 204,214 ----
}
+ // Fetch the id
+
+ UniversalIdentifierCref MetaClass::getIdentifier( void ) const
+ {
+ return theType->getIdentifier();
+ }
+
// Fetch the type name
Index: Ontology.cpp
===================================================================
RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/Ontology.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Ontology.cpp 2001/04/11 01:39:25 1.7
--- Ontology.cpp 2001/04/21 21:39:01 1.8
***************
*** 147,150 ****
--- 147,154 ----
}
+ //
+ // Resolve class by name
+ //
+
MetaClassPtr Ontology::getClassFor
(
***************
*** 199,202 ****
--- 203,263 ----
return aPtr;
}
+ //
+ // Resolve class by id
+ //
+
+ MetaClassPtr Ontology::getClassFor
+ (
+ UniversalIdentifierCref aClassId,
+ CharCptr anOntology
+ )
+ throw ( NullPointerException, DescriptorNotFound )
+ {
+ MetaClassPtr aPtr( NULLPTR );
+
+ if( aClassId.isZero() == true )
+ {
+ throw NullPointerException( LOCATION );
+ }
+ else
+ {
+ OntologyPtr aOPtr =
+ MetaSpace::getOntology
+ (
+ ( anOntology == NULLPTR ? "corelinux" : anOntology )
+ );
+ if( aOPtr != NULLPTR )
+ {
+ Iterator<MetaClassCptr> *aIterator( aOPtr->createIterator() );
+
+ while( aIterator->isValid() == true && aPtr == NULLPTR )
+ {
+ MetaClassPtr aClass = (MetaClassPtr) aIterator->getElement();
+ if( aClass->getIdentifier() == aClassId )
+ {
+ aPtr = aClass;
+ }
+ else
+ {
+ ; // do nothing
+ }
+ aIterator->setNext();
+ }
+ aOPtr->destroyIterator( aIterator );
+
+ if( aPtr == NULLPTR )
+ {
+ throw DescriptorNotFound( LOCATION );
+ }
+ }
+ else
+ {
+ throw DescriptorNotFound("Ontology not found", LOCATION );
+ }
+ }
+
+ return aPtr;
+ }
+
//
// Add a new type to the ontology
|