|
From: Frank V. C. <fr...@us...> - 2001-05-20 10:03:50
|
Update of /cvsroot/corelinux/clfw/src/libs/clfw
In directory usw-pr-cvs1:/tmp/cvs-serv7546/src/libs/clfw
Modified Files:
Ontology.cpp
Log Message:
Updates for 425600
Index: Ontology.cpp
===================================================================
RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/Ontology.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** Ontology.cpp 2001/04/21 21:39:01 1.8
--- Ontology.cpp 2001/05/20 10:03:47 1.9
***************
*** 203,206 ****
--- 203,207 ----
return aPtr;
}
+
//
// Resolve class by id
***************
*** 254,257 ****
--- 255,336 ----
{
throw DescriptorNotFound("Ontology not found", LOCATION );
+ }
+ }
+
+ return aPtr;
+ }
+
+ //
+ // Resolve class by name
+ //
+
+ MetaClassPtr Ontology::getClass
+ (
+ CharCptr aClassName
+ )
+ throw ( NullPointerException )
+ {
+ MetaClassPtr aPtr( NULLPTR );
+
+ if( aClassName == NULLPTR )
+ {
+ throw NullPointerException( LOCATION );
+ }
+ else
+ {
+ ClassMapIterator begin( theClassMap.begin() );
+ ClassMapIterator end( theClassMap.end() );
+ while( begin != end )
+ {
+ MetaTypePtr aType = (*begin).first;
+ MetaClassPtr aClass = (*begin).second;
+ if( std::strcmp(aClassName, aType->getInstanceTypeName()) == 0 )
+ {
+ aPtr = aClass;
+ begin = end;
+ }
+ else
+ {
+ ++begin;
+ }
+ }
+ }
+
+ return aPtr;
+ }
+
+ //
+ // Resolve class by id
+ //
+
+ MetaClassPtr Ontology::getClass
+ (
+ UniversalIdentifierCref aClassId
+ )
+ throw ( NullPointerException )
+ {
+ MetaClassPtr aPtr( NULLPTR );
+
+ if( aClassId.isZero() == true )
+ {
+ throw NullPointerException( LOCATION );
+ }
+ else
+ {
+ ClassMapIterator begin( theClassMap.begin() );
+ ClassMapIterator end( theClassMap.end() );
+ while( begin != end )
+ {
+ MetaTypePtr aType = (*begin).first;
+ MetaClassPtr aClass = (*begin).second;
+ if( aType->getIdentifier() == aClassId )
+ {
+ aPtr = aClass;
+ begin = end;
+ }
+ else
+ {
+ ++begin;
+ }
}
}
|