[GME-commit] GMESRC/GME/ConstraintManager OCLTree.h,1.12,1.13 OCLTree.cpp,1.20,1.21 OCLGMECMFacade.cpp,1.19,1.20 OCLFeatureImplementation.h,1.3,1.4 ConstraintManager.dsp,1.17,1.18

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Fri Apr 30 17:08:52 CDT 2004


Update of /var/lib/gme/GMESRC/GME/ConstraintManager
In directory braindrain:/tmp/cvs-serv2353

Modified Files:
	OCLTree.h OCLTree.cpp OCLGMECMFacade.cpp 
	OCLFeatureImplementation.h ConstraintManager.dsp 
Log Message:
constarint: all violation info record listed

CVS User: bogyom

Index: OCLTree.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/OCLTree.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** OCLTree.h	27 Apr 2004 20:28:23 -0000	1.12
--- OCLTree.h	30 Apr 2004 21:08:48 -0000	1.13
***************
*** 15,18 ****
--- 15,19 ----
  #include "OCLType.h"
  #include "OCLFormalParameter.h"
+ #include "OclViolation.h"
  
  namespace OclTree
***************
*** 81,84 ****
--- 82,86 ----
  	typedef OclCommon::ContextStack< OclMeta::Object > ObjectContextStack;
  
+ /*	transferred to OclViolation
  	struct Violation {
  		bool						bIsException;
***************
*** 91,95 ****
  
  	typedef vector< Violation >	ViolationVector;
! 
  	struct ObjectContext {
  		ObjectContextStack	oCtx;
--- 93,97 ----
  
  	typedef vector< Violation >	ViolationVector;
! */
  	struct ObjectContext {
  		ObjectContextStack	oCtx;
***************
*** 146,149 ****
--- 148,152 ----
  
  			 		void 					AddViolation( ObjectContext& context, int iLine, const string& strSignature, const string& strMessage = "" );
+ 					void					AddViolation(ObjectContext& context, Violation &violation);
  			 		bool					IsBooleanReturned();
  					OclMeta::Object 		CheckFalseResult( ObjectContext& context, OclMeta::Object spObject, int iLine, const string& strSignature );

Index: OCLTree.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/OCLTree.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** OCLTree.cpp	27 Apr 2004 20:28:23 -0000	1.20
--- OCLTree.cpp	30 Apr 2004 21:08:48 -0000	1.21
***************
*** 303,306 ****
--- 303,316 ----
  	}
  
+ 	// terge
+ 	void TreeNode::AddViolation(ObjectContext& context, Violation &violation)
+ 	{
+ 		context.vecViolations.push_back( violation );
+ 		context.iViolationCount++;
+ 
+ 		if ( violation.bIsException )
+ 			context.m_bHasException;
+ 	}
+ 
  	bool TreeNode::IsBooleanReturned()
  	{
***************
*** 1564,1568 ****
  			// all of the violations collected in pIMethod (((OclGmeCM::ConstraintMethod*)pIMethod)->m_spFunction)
  			// will lose, one violation will be added to context depending on spResult 
! 			// ?? !!
  			return CheckFalseResult( context, spResult, iLineFeatureName, signature.Print() );
  		} EVALCATCH( iLineFeatureName, signature.Print() );
--- 1574,1583 ----
  			// all of the violations collected in pIMethod (((OclGmeCM::ConstraintMethod*)pIMethod)->m_spFunction)
  			// will lose, one violation will be added to context depending on spResult 
! 			// ?? !! terge
! 			OclTree::ViolationVector vec = pIMethod->GetViolations();
! 			int num = vec.size();
! 			for (int kk=0; kk<num; kk++)
! 				AddViolation(context, vec[kk]);
! 
  			return CheckFalseResult( context, spResult, iLineFeatureName, signature.Print() );
  		} EVALCATCH( iLineFeatureName, signature.Print() );

Index: OCLGMECMFacade.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/OCLGMECMFacade.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** OCLGMECMFacade.cpp	2 Dec 2002 19:07:00 -0000	1.19
--- OCLGMECMFacade.cpp	30 Apr 2004 21:08:48 -0000	1.20
***************
*** 64,67 ****
--- 64,72 ----
  			}
  
+ 			OclTree::ViolationVector GetViolations() 
+ 			{
+ 				return m_spFunction->GetViolations();
+ 			}
+ 
  			void operator()()
  			{
***************
*** 580,584 ****
  		long lPriority = 1;
  
! 		for ( int i = 0 ; i < vecInputs.size() && ! bStopEvaluation ; i++ ) {
  
  			// Level condition for terminating the evaluation
--- 585,590 ----
  		long lPriority = 1;
  
! 		int loopcount = vecInputs.size();
! 		for ( int i = 0 ; i < loopcount && ! bStopEvaluation ; i++ ) {
  
  			// Level condition for terminating the evaluation

Index: OCLFeatureImplementation.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/OCLFeatureImplementation.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** OCLFeatureImplementation.h	27 Nov 2002 15:50:00 -0000	1.3
--- OCLFeatureImplementation.h	30 Apr 2004 21:08:48 -0000	1.4
***************
*** 10,13 ****
--- 10,14 ----
  
  #include "OCLCommon.h"
+ #include "OclViolation.h"
  #include "OCLObject.h"
  #include "OCLException.h"
***************
*** 229,232 ****
--- 230,235 ----
  		public :
  			virtual 	void Finalize() { Feature::Finalize(); TypeableFeature::Finalize(); ParametralFeature::Finalize(); }
+ 			virtual		OclTree::ViolationVector GetViolations() {OclTree::ViolationVector vec; return vec;}
+ 
  	};
  

Index: ConstraintManager.dsp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/ConstraintManager.dsp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ConstraintManager.dsp	23 Apr 2004 19:10:13 -0000	1.17
--- ConstraintManager.dsp	30 Apr 2004 21:08:48 -0000	1.18
***************
*** 521,524 ****
--- 521,528 ----
  # Begin Source File
  
+ SOURCE=.\OclViolation.h
+ # End Source File
+ # Begin Source File
+ 
  SOURCE=.\Regexp.h
  # End Source File



More information about the GME-commit mailing list