[GME-commit] GMESRC/SDK/BON BONImpl.cpp,1.29,1.30 BONImpl.h,1.17,1.18 Exceptions.cpp,1.5,1.6 Exceptions.h,1.4,1.5Extensions.cpp,1.10,1.11

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Tue Nov 15 22:01:36 CST 2005


Update of /project/gme-repository/GMESRC/SDK/BON
In directory escher:/tmp/cvs-serv23549

Modified Files:
	BONImpl.cpp BONImpl.h Exceptions.cpp Exceptions.h 
	Extensions.cpp 
Log Message:
Bon2 code now compiles with /clr flag (as managed code).


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: BONImpl.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/SDK/BON/BONImpl.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** BONImpl.cpp	15 Sep 2005 19:11:49 -0000	1.29
--- BONImpl.cpp	15 Nov 2005 22:01:34 -0000	1.30
***************
*** 121,137 ****
  	#define THROW_METAPROJECT_BELONG( META )					\
  		if ( META.project() != getProject()->getProjectMeta() )	\
! 			ASSERTTHROW( MON::Exception( "? does not belong to ? of ?!", "sss", META.infoString().c_str(), getProject()->getProjectMeta().infoString().c_str(), getProject()->getInfoString().c_str() ) );
  
  	#define THROW_PROJECT_BELONG( OBJECT )					\
  		if ( OBJECT->getProject() != getProject() )					\
! 			ASSERTTHROW( BON::Exception( "? does not belong to ?!", "ss", OBJECT->getInfoString().c_str(), getProject()->getInfoString().c_str() ) );
  
  	#define THROW_METAPROJECT_DOES_NOT_HAVE( META, CLASS, NAME )	\
  		if ( ! META )													\
[...1566 lines suppressed...]
! 			}
  
  			Point point;
***************
*** 6461,6465 ****
  		if ( aspect ) {
  			if ( getObject()->getProject()->getProjectMeta() != aspect.project() )
! 				ASSERTTHROW( MON::Exception( "? does not belong to ? of ?!", "sss", aspect.infoString().c_str(), getObject()->getProject()->getProjectMeta().infoString().c_str(), getObject()->getProject()->getInfoString().c_str() ) );
  
  			char chBuffer[ 100 ];
--- 6888,6896 ----
  		if ( aspect ) {
  			if ( getObject()->getProject()->getProjectMeta() != aspect.project() )
! 			{
! 				MON::Exception exc( "? does not belong to ? of ?!");
! 				exc << aspect.infoString() << getObject()->getProject()->getProjectMeta().infoString() << getObject()->getProject()->getInfoString();
! 				ASSERTTHROW( exc);
! 			}
  
  			char chBuffer[ 100 ];

Index: Extensions.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/SDK/BON/Extensions.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Extensions.cpp	29 Jun 2005 19:16:34 -0000	1.10
--- Extensions.cpp	15 Nov 2005 22:01:34 -0000	1.11
***************
*** 67,71 ****
  			return NULL;
  		if ( strBEType.empty() )
! 			ASSERTTHROW( Util::Exception( "Invalid BON Extension Class! Check meta-kind compatibility for ?!", "s", pObject->getObjectMeta().name().c_str() ) );
  		if ( eType == OT_Null && pObject->getStereotype() == OT_Folder || eType != OT_Null && pObject->getStereotype() != eType )
  			return NULL;
--- 67,75 ----
  			return NULL;
  		if ( strBEType.empty() )
! 		{
! 			Util::Exception exc( "Invalid BON Extension Class! Check meta-kind compatibility for ?!");
! 			exc << pObject->getObjectMeta().name().c_str();
! 			ASSERTTHROW( exc);
! 		}
  		if ( eType == OT_Null && pObject->getStereotype() == OT_Folder || eType != OT_Null && pObject->getStereotype() != eType )
  			return NULL;
***************
*** 94,98 ****
  	{
  		if ( strBEType.empty() )
! 			ASSERTTHROW( Util::Exception( "Invalid BON Extension Class! Check meta-kind compatibility for ?!", "s", strKind.c_str() ) );
  		ExtensionType exType = ET_None;
  		if ( eType != OT_Null && eOType != eType || eType == OT_Null && eOType == OT_Folder )
--- 98,106 ----
  	{
  		if ( strBEType.empty() )
! 		{
! 			Util::Exception exc( "Invalid BON Extension Class! Check meta-kind compatibility for ?!");//, "s", 
! 			exc << strKind.c_str();
! 			ASSERTTHROW( exc);
! 		}
  		ExtensionType exType = ET_None;
  		if ( eType != OT_Null && eOType != eType || eType == OT_Null && eOType == OT_Folder )
***************
*** 221,227 ****
  			if ( iCnt != 1 ) {
  				switch ( eType ) {
! 					case ET_Role : ASSERTTHROW( Util::Exception( "Implementations are ambiguous for Role [?]!", "s", strRole.c_str() ) );
! 					case ET_Kind : ASSERTTHROW( Util::Exception( "Implementations are ambiguous for Kind [?]!", "s", strKind.c_str() ) );
! 					case ET_MetaKind : ASSERTTHROW( Util::Exception( "Implementations are ambiguous for MetaKind [?]!", "s", toString( eOType ).c_str() ) );
  				}
  			}
--- 229,250 ----
  			if ( iCnt != 1 ) {
  				switch ( eType ) {
! 					case ET_Role : {
! 						Util::Exception exc( "Implementations are ambiguous for Role [?]!");//, "s", 
! 						exc << strRole.c_str();
! 						ASSERTTHROW( exc);
! 						break;
! 					}
! 					case ET_Kind : {
! 						Util::Exception exc( "Implementations are ambiguous for Kind [?]!");// "s", 
! 						exc << strKind.c_str();
! 						ASSERTTHROW( exc);
! 						break;
! 					}
! 					case ET_MetaKind : {
! 						Util::Exception exc( "Implementations are ambiguous for MetaKind [?]!");//, "s", 
! 						exc << toString( eOType ).c_str();
! 						ASSERTTHROW( exc );
! 						break;
! 					}
  				}
  			}

Index: Exceptions.h
===================================================================
RCS file: /project/gme-repository/GMESRC/SDK/BON/Exceptions.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Exceptions.h	3 Feb 2004 10:53:05 -0000	1.4
--- Exceptions.h	15 Nov 2005 22:01:34 -0000	1.5
***************
*** 76,80 ****
  		public :
  			Exception();
! 			Exception( std::string strMessage, std::string strFormat, ... );
  
  			Exception( std::string strMessage, const StringVector& vecParemeters = StringVector() );
--- 76,80 ----
  		public :
  			Exception();
! 			//Exception( std::string strMessage);//, std::string strFormat, ... );
  
  			Exception( std::string strMessage, const StringVector& vecParemeters = StringVector() );
***************
*** 84,87 ****
--- 84,93 ----
  		// Get and Set operations
  		public :
+ 			Exception& operator << ( char pchar);
+ 			Exception& operator << ( int  pint);
+ 			Exception& operator << ( long plong);
+ 			Exception& operator << ( const std::string& pstr);
+ 			Exception& operator << ( float pfloat);
+ 			Exception& operator << ( double pdoub);
  			std::string	getErrorMessage( bool bSubstitute = true ) const;
  			std::string	getParameter( int iPos ) const;
***************
*** 117,123 ****
  		public :
  			Exception( HRESULT hResult );
! 			Exception( HRESULT hResult, std::string strMessage, std::string strFormat, ... );
  			Exception( HRESULT hResult, std::string strMessage, const StringVector& vecParemeters = StringVector() );
! 			Exception( std::string strMessage, std::string strFormat, ... );
  			Exception( std::string strMessage, const StringVector& vecParemeters = StringVector() );
  			Exception( const Exception& ex );
--- 123,129 ----
  		public :
  			Exception( HRESULT hResult );
! 			//Exception( HRESULT hResult, std::string strMessage, std::string strFormat, ... );
  			Exception( HRESULT hResult, std::string strMessage, const StringVector& vecParemeters = StringVector() );
! 			//Exception( std::string strMessage, std::string strFormat, ... );
  			Exception( std::string strMessage, const StringVector& vecParemeters = StringVector() );
  			Exception( const Exception& ex );
***************
*** 154,160 ****
  		public :
  			Exception( HRESULT hResult );
! 			Exception( HRESULT hResult, std::string strMessage, std::string strFormat, ... );
  			Exception( HRESULT hResult, std::string strMessage, const StringVector& vecParemeters = StringVector() );
! 			Exception( std::string strMessage, std::string strFormat, ... );
  			Exception( std::string strMessage, const StringVector& vecParemeters = StringVector() );
  			Exception( const Exception& ex );
--- 160,166 ----
  		public :
  			Exception( HRESULT hResult );
! 			//Exception( HRESULT hResult, std::string strMessage, std::string strFormat, ... );
  			Exception( HRESULT hResult, std::string strMessage, const StringVector& vecParemeters = StringVector() );
! 			//Exception( std::string strMessage, std::string strFormat, ... );
  			Exception( std::string strMessage, const StringVector& vecParemeters = StringVector() );
  			Exception( const Exception& ex );

Index: Exceptions.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/SDK/BON/Exceptions.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Exceptions.cpp	29 Jun 2005 19:16:34 -0000	1.5
--- Exceptions.cpp	15 Nov 2005 22:01:34 -0000	1.6
***************
*** 25,28 ****
--- 25,29 ----
  #include "stdarg.h"
  
+ 
  #define ADDPARAMETERS() \
  		va_list vList;																			\
***************
*** 72,75 ****
--- 73,120 ----
  namespace Util
  {
+ 	Exception& Exception::operator << ( char pch)
+ 	{
+ 		addParameter( "" + pch);
+ 		return *this;
+ 	}
+ 
+ 	Exception& Exception::operator << ( int  pint)
+ 	{
+ 		char chBuffer[ 100 ];
+ 		sprintf( chBuffer, "%d", pint);
+ 		addParameter( std::string( chBuffer ) );
+ 		return *this;
+ 	}
+ 
+ 	Exception& Exception::operator << ( long plong)
+ 	{
+ 		char chBuffer[ 100 ];
+ 		sprintf( chBuffer, "%d", plong);
+ 		addParameter( std::string( chBuffer ) );
+ 		return *this;
+ 	}
+ 
+ 	Exception& Exception::operator << ( const std::string& pstr)
+ 	{
+ 		addParameter( pstr );
+ 		return *this;
+ 	}
+ 
+ 	Exception& Exception::operator << ( float pfloat)
+ 	{
+ 		char chBuffer[ 100 ];
+ 		sprintf( chBuffer, "%f", pfloat );
+ 		addParameter( std::string( chBuffer ) );
+ 		return *this;
+ 	}
+ 
+ 	Exception& Exception::operator << ( double pdoub)
+ 	{
+ 		char chBuffer[ 100 ];
+ 		sprintf( chBuffer, "%f", pdoub );
+ 		addParameter( std::string( chBuffer ) );
+ 		return *this;
+ 	}
+ 
  //###############################################################################################################################################
  //
***************
*** 89,97 ****
  	}
  
! 	Exception::Exception( std::string strMessage, std::string strFormat, ... )
! 		: m_strMessage( strMessage )
! 	{
! 		ADDPARAMETERS();
! 	}
  
  	Exception::Exception( std::string strMessage, const StringVector& vecParameters )
--- 134,142 ----
  	}
  
! 	//Exception::Exception( std::string strMessage)//, std::string strFormat, ... )
! 	//	: m_strMessage( strMessage )
! 	//{
! 	//	//ADDPARAMETERS();
! 	//}
  
  	Exception::Exception( std::string strMessage, const StringVector& vecParameters )
***************
*** 157,165 ****
  	}
  
! 	Exception::Exception( HRESULT hResult, std::string strMessage, std::string strFormat, ... )
! 		: Util::Exception( strMessage ), m_hResult( hResult )
! 	{
! 		ADDPARAMETERS();
! 	}
  
  	Exception::Exception( HRESULT hResult, std::string strMessage, const StringVector& vecParameters )
--- 202,210 ----
  	}
  
! 	//Exception::Exception( HRESULT hResult, std::string strMessage, std::string strFormat, ... )
! 	//	: Util::Exception( strMessage ), m_hResult( hResult )
! 	//{
! 	//	ADDPARAMETERS();
! 	//}
  
  	Exception::Exception( HRESULT hResult, std::string strMessage, const StringVector& vecParameters )
***************
*** 168,176 ****
  	}
  
! 	Exception::Exception( std::string strMessage, std::string strFormat, ... )
! 		: Util::Exception( strMessage ), m_hResult( -1 )
! 	{
! 		ADDPARAMETERS();
! 	}
  
  	Exception::Exception( std::string strMessage, const StringVector& vecParameters )
--- 213,221 ----
  	}
  
! 	//Exception::Exception( std::string strMessage, std::string strFormat, ... )
! 	//	: Util::Exception( strMessage ), m_hResult( -1 )
! 	//{
! 	//	ADDPARAMETERS();
! 	//}
  
  	Exception::Exception( std::string strMessage, const StringVector& vecParameters )
***************
*** 210,218 ****
  	}
  
! 	Exception::Exception( HRESULT hResult, std::string strMessage, std::string strFormat, ... )
! 		: Util::Exception( strMessage ), m_hResult( hResult )
! 	{
! 		ADDPARAMETERS();
! 	}
  
  	Exception::Exception( HRESULT hResult, std::string strMessage, const StringVector& vecParameters )
--- 255,263 ----
  	}
  
! 	//Exception::Exception( HRESULT hResult, std::string strMessage, std::string strFormat, ... )
! 	//	: Util::Exception( strMessage ), m_hResult( hResult )
! 	//{
! 	//	ADDPARAMETERS();
! 	//}
  
  	Exception::Exception( HRESULT hResult, std::string strMessage, const StringVector& vecParameters )
***************
*** 221,229 ****
  	}
  
! 	Exception::Exception( std::string strMessage, std::string strFormat, ... )
! 		: Util::Exception( strMessage ), m_hResult( -1 )
! 	{
! 		ADDPARAMETERS();
! 	}
  
  	Exception::Exception( std::string strMessage, const StringVector& vecParameters )
--- 266,274 ----
  	}
  
! 	//Exception::Exception( std::string strMessage, std::string strFormat, ... )
! 	//	: Util::Exception( strMessage ), m_hResult( -1 )
! 	//{
! 	//	ADDPARAMETERS();
! 	//}
  
  	Exception::Exception( std::string strMessage, const StringVector& vecParameters )

Index: BONImpl.h
===================================================================
RCS file: /project/gme-repository/GMESRC/SDK/BON/BONImpl.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** BONImpl.h	15 Sep 2005 19:11:49 -0000	1.17
--- BONImpl.h	15 Nov 2005 22:01:34 -0000	1.18
***************
*** 967,970 ****
--- 967,972 ----
  
  			FCO						findByPath( const std::string& strPath, const std::string& strDelimiter = "/", bool bReverseOrder = false );
+ 			std::set<FCO>			findByKind( const MON::Object& meta );
+ 			std::set<FCO>			findByKind( const std::string& strKind );
  
  		// Extensions
***************
*** 980,983 ****
--- 982,986 ----
  			FCOImpl* 		createChildFCOI( const MON::FCO& meta, const std::string& strRole, MON::ObjectType eType );
  			FCOImpl* 		createChildFCOI( const BON::FCO& fco, bool bAsInstance, const std::string& strRole, MON::ObjectType eType );
+ 			std::set<FCO>	findByKindHlp( const MON::FCO& meta );
  
  		// Helper methods



More information about the GME-commit mailing list