[commit] r2055 - trunk/GME/ConstraintManager

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Sep 18 09:51:48 CDT 2012


Author: ksmyth
Date: Tue Sep 18 09:51:48 2012
New Revision: 2055

Log:
ConstraintManager: Add kindDisplayedName to FCOs

Modified:
   trunk/GME/ConstraintManager/OCLCommonEx.cpp
   trunk/GME/ConstraintManager/OCLCommonEx.h
   trunk/GME/ConstraintManager/OCLTypeExGMECM.cpp

Modified: trunk/GME/ConstraintManager/OCLCommonEx.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLCommonEx.cpp	Tue Sep 18 09:51:31 2012	(r2054)
+++ trunk/GME/ConstraintManager/OCLCommonEx.cpp	Tue Sep 18 09:51:48 2012	(r2055)
@@ -144,6 +144,15 @@
 		return GetObjectName( spMeta );
 	}
 
+	std::string GetObjectDisplayedName(CComPtr<IMgaObject>& spObject)
+	{
+		CComPtr<IMgaMetaBase> spMeta;
+		COMTHROW( spObject->get_MetaBase( &spMeta ) );
+		_bstr_t name;
+		COMTHROW(spMeta->get_Name(name.GetAddress()));
+		return static_cast<const char*>(name);
+	}
+
 	std::string GetFCORole( CComPtr<IMgaFCO> spFCO )
 	{
 		CComPtr<IMgaMetaRole> spMetaRole;

Modified: trunk/GME/ConstraintManager/OCLCommonEx.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLCommonEx.h	Tue Sep 18 09:51:31 2012	(r2054)
+++ trunk/GME/ConstraintManager/OCLCommonEx.h	Tue Sep 18 09:51:48 2012	(r2055)
@@ -60,6 +60,7 @@
 	std::string GetConnPointRole( CComPtr<IMgaConnPoint> spCP );
 
 	std::string GetObjectKind( CComPtr<IMgaObject> spObject );
+	std::string GetObjectDisplayedName(CComPtr<IMgaObject>& spObject);
 
 	std::string GetFCORole( CComPtr<IMgaFCO> spFCO );
 

Modified: trunk/GME/ConstraintManager/OCLTypeExGMECM.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLTypeExGMECM.cpp	Tue Sep 18 09:51:31 2012	(r2054)
+++ trunk/GME/ConstraintManager/OCLTypeExGMECM.cpp	Tue Sep 18 09:51:48 2012	(r2055)
@@ -310,6 +310,17 @@
 		}
 	};
 
+	ATTRIBUTE( TObject_KindDisplayedName )
+	{
+		void operator()()
+		{
+			DECL_GMEOBJECT( spThis, GetThis() );
+			if ( ! spThis.p )
+				ThrowException( "Object is null." );
+			SetResult( CREATE_STRING( GetTypeManager(), OclCommonEx::GetObjectDisplayedName( spThis ) ) );
+		}
+	};
+
 	ATTRIBUTE( TObject_StereotypeName )
 	{
 		void operator()()
@@ -405,6 +416,12 @@
 			return;
 		}
 
+		if ( strName == "kindDisplayedName" ) {
+			vecType.push_back( "ocl::String" );
+			vecFeatures.push_back( new OclMeta::Attribute( strName, vecType, new TObject_KindDisplayedName(), false ) );
+			return;
+		}
+
 		if ( strName == "metaKindName" ) {
 			vecType.push_back( "ocl::String" );
 			vecFeatures.push_back( new OclMeta::Attribute( strName, vecType, new TObject_StereotypeName(), false ) );


More information about the gme-commit mailing list