[Mobies-commit] [commit] r3595 - in UDM/trunk: include src/UdmUtil

endre at redhat1.isis.vanderbilt.edu endre at redhat1.isis.vanderbilt.edu
Wed Jan 5 00:44:08 CST 2011


Author: endre
Date: Wed Jan  5 00:44:07 2011
New Revision: 3595

Log:
Overloaded UdmUtil::ExtractName() for ObjectImpls.

Modified:
   UDM/trunk/include/UdmUtil.h
   UDM/trunk/src/UdmUtil/UdmUtil.cpp

Modified: UDM/trunk/include/UdmUtil.h
==============================================================================
--- UDM/trunk/include/UdmUtil.h	Wed Jan  5 00:30:22 2011	(r3594)
+++ UDM/trunk/include/UdmUtil.h	Wed Jan  5 00:44:07 2011	(r3595)
@@ -50,6 +50,7 @@
 	//this utility tries to extract the name-like attribute
 	//using stupid heuristics and assuming odd things like
 	//the name of the name attribute is "name". Anyway, it might be useful.
+	UDM_DLL string ExtractName(const Udm::ObjectImpl *impl, const string &att_name = "name");
 	UDM_DLL string ExtractName(const Udm::Object &ob, const string &att_name = "name");
 
 

Modified: UDM/trunk/src/UdmUtil/UdmUtil.cpp
==============================================================================
--- UDM/trunk/src/UdmUtil/UdmUtil.cpp	Wed Jan  5 00:30:22 2011	(r3594)
+++ UDM/trunk/src/UdmUtil/UdmUtil.cpp	Wed Jan  5 00:44:07 2011	(r3595)
@@ -74,9 +74,9 @@
 
 
 
-	UDM_DLL string ExtractName(const Udm::Object &ob,  const string &att_name )
+	UDM_DLL string ExtractName(const Udm::ObjectImpl *impl,  const string &att_name )
 	{
-		::Uml::Class cls= ob.type();				
+		::Uml::Class cls = impl->type();
 		set< ::Uml::Attribute> attrs=cls.attributes();		
 		
 		// Adding parent attributes
@@ -91,7 +91,7 @@
 				if(str==att_name)
 				{
 					
-					string value=ob.getStringAttr(*ai);
+					string value=impl->getStringAttr(*ai);
 					if(value.empty())value="<empty string>";
 					return value;
 				}			
@@ -101,6 +101,11 @@
 		return string("<no name specified>");
 	}
 
+	UDM_DLL string ExtractName(const Udm::Object &ob, const string &att_name)
+	{
+		return ExtractName(ob.__impl(), att_name);
+	}
+
 
 
 	UDM_DLL int CopyObjectHierarchy(Udm::ObjectImpl* p_srcRoot, Udm::ObjectImpl* p_dstRoot, Udm::DataNetwork* p_dstBackend, copy_assoc_map &cam, const CopyOpts &opts)


More information about the Mobies-commit mailing list