[GME-commit] GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep Any.cpp,1.8,1.9 AspectRep.cpp,1.6,1.7 AspectRep.h,1.5,1.6 Dumper.cpp,1.16,1.17 ModelRep.cpp,1.10,1.11 ModelRep.h,1.5,1.6

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu May 13 20:51:36 CDT 2004


Update of /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep
In directory braindrain:/tmp/cvs-serv3507/Rep

Modified Files:
	Any.cpp AspectRep.cpp AspectRep.h Dumper.cpp ModelRep.cpp 
	ModelRep.h 
Log Message:
1Aspect ordering omitted if only one aspect defined.
2Dummy aspect having as name "Aspect" defined for aspectless models.
3End message changed.
 


CVS User: zolmol

Index: Any.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Any.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Any.cpp	26 Apr 2004 17:13:38 -0000	1.8
--- Any.cpp	14 May 2004 00:51:34 -0000	1.9
***************
*** 177,180 ****
--- 177,189 ----
  		return meta_ref;
  	}
+ 	else // added for dummy aspects
+ 	{
+ 		int meta_ref_int = Broker::getNextMetaRefId();
+ 		char n_meta_ref[64];
+ 		sprintf( n_meta_ref, "%d", meta_ref_int);
+ 		//getMyRegistry()->setValueByPath( token, n_meta_ref);
+ 		meta_ref = n_meta_ref;
+ 		return meta_ref;
+ 	}
  	return "NullPtrError";
  }

Index: AspectRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/AspectRep.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** AspectRep.cpp	26 Apr 2004 17:13:38 -0000	1.6
--- AspectRep.cpp	14 May 2004 00:51:34 -0000	1.7
***************
*** 63,66 ****
--- 63,67 ----
  std::string AspectRep::getName() const
  {
+ #if(0)
  	// using m_respPointer instead of m_ptr
  	if (m_respPointer == BON::FCO())
***************
*** 73,76 ****
--- 74,87 ----
  		return m_respPointer->getName();
  	}
+ #else
+ 	if( m_respPointer != BON::FCO())
+ 	{
+ 		return m_respPointer->getName();
+ 	}
+ 	else
+ 	{
+ 		return "Aspect";
+ 	}
+ #endif
  }
  
***************
*** 78,81 ****
--- 89,93 ----
  std::string AspectRep::getDispName() const
  {
+ #if(0)
  	if (m_respPointer == BON::FCO()) 
  	{
***************
*** 87,90 ****
--- 99,112 ----
  		return m_ptr->getAttribute("DisplayedName")->getStringValue(); //<!> modified from m_respPointer
  	}
+ #else
+ 	if( m_ptr != BON::FCO()) 
+ 	{
+ 		return m_ptr->getAttribute("DisplayedName")->getStringValue(); //<!> modified from m_respPointer
+ 	}
+ 	else
+ 	{
+ 		return "Aspect";	
+ 	}
+ #endif
  }
  
***************
*** 234,240 ****
  void AspectRep::getXY( unsigned int * x, unsigned int * y) const
  {
! 	BON::Point p = BON::Set( m_ptr)->getRegistry()->getLocation("Visualization");
! 	*x = p.first;
! 	*y = p.second;
  }
  
--- 256,269 ----
  void AspectRep::getXY( unsigned int * x, unsigned int * y) const
  {
! 	if( m_ptr != BON::FCO())
! 	{
! 		BON::Point p = BON::Set( m_ptr)->getRegistry()->getLocation("Visualization");
! 		*x = p.first;
! 		*y = p.second;
! 	}
! 	else // created aspect
! 	{
! 		*x = *y = 0;
! 	}
  }
  
***************
*** 249,251 ****
--- 278,286 ----
  {
  	return m_priority;
+ }
+ 
+ 
+ bool AspectRep::isDummy() const
+ {
+ 	return m_ptr == BON::FCO() && m_respPointer == BON::FCO();
  }

Index: AspectRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/AspectRep.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AspectRep.h	26 Apr 2004 17:13:38 -0000	1.5
--- AspectRep.h	14 May 2004 00:51:34 -0000	1.6
***************
*** 62,65 ****
--- 62,67 ----
  	void setPriority( int pr);
  	int getPriority() const;
+ 
+ 	bool isDummy() const;
  	
  	static const std::string m_aspectRegistryRoot;

Index: Dumper.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Dumper.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Dumper.cpp	26 Apr 2004 17:13:38 -0000	1.16
--- Dumper.cpp	14 May 2004 00:51:34 -0000	1.17
***************
*** 221,226 ****
  		for( ; child_it != children.end(); ++child_it )
  		{
! 			ModelRep * child_mod_ptr = static_cast<ModelRep *>( *child_it);
! 			if ( !child_mod_ptr) global_vars.err << "Internal error: after static cast - inheritAspConsAttr\n";
  
  			// inherit aspects
--- 221,226 ----
  		for( ; child_it != children.end(); ++child_it )
  		{
! 			ModelRep * child_mod_ptr = dynamic_cast<ModelRep *>( *child_it);
! 			if ( !child_mod_ptr) global_vars.err << "Internal error: after dynamic cast - inheritAspConsAttr\n";
  
  			// inherit aspects
***************
*** 1079,1083 ****
  
  
- //checks those elements which don't have parents
  bool Dumper::checkAllFCOs()
  {
--- 1079,1082 ----
***************
*** 1117,1122 ****
  		if (!(*it2)->checkInheritance())
  			res = false;
  		if (!(*it2)->isAbstract())
! 			res = res && (*it2)->check();
  		if (!(*it2)->isAbstract() && !(*it2)->checkIsPartOfFinal() && !m_rootFolder.isInRoot( *it2) && !findInFolders(*it2)) 
  		{ 
--- 1116,1123 ----
  		if (!(*it2)->checkInheritance())
  			res = false;
+ 
  		if (!(*it2)->isAbstract())
! 			res = res && (*it2)->checkMyAspects( this);
! 
  		if (!(*it2)->isAbstract() && !(*it2)->checkIsPartOfFinal() && !m_rootFolder.isInRoot( *it2) && !findInFolders(*it2)) 
  		{ 
***************
*** 1255,1259 ****
  bool Dumper::aspectOrderSel()
  {
! 	if ( m_aspectList.size() == 0) return false;
  
  	GlobalAspOrder g;
--- 1256,1262 ----
  bool Dumper::aspectOrderSel()
  {
! 	unsigned int sz = m_aspectList.size();
! 	if ( sz == 0) return false;
! 	else if ( sz == 1) return true; // if one aspect no need for ordering, introduced on 5/13/2004
  
  	GlobalAspOrder g;
***************
*** 1355,1359 ****
  
  	}
!   // sort the aspects based on the current information
  	AspectCompare asp_less_than2;
  	std::sort( m_aspectList.begin(), m_aspectList.end(), asp_less_than2);
--- 1358,1362 ----
  
  	}
! 	// sort the aspects based on the current information
  	AspectCompare asp_less_than2;
  	std::sort( m_aspectList.begin(), m_aspectList.end(), asp_less_than2);
***************
*** 1378,1382 ****
  	inheritAspConsAttr();				// hasAspect, hasConstraints, hasAttribute
  
! 	if ( !checkAll())
  	{
  		TO("Please check the log file!");
--- 1381,1385 ----
  	inheritAspConsAttr();				// hasAspect, hasConstraints, hasAttribute
  
! 	if ( !checkAll()) // creates dummy aspects if needed
  	{
  		TO("Please check the log file!");

Index: ModelRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ModelRep.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ModelRep.cpp	26 Apr 2004 17:13:38 -0000	1.10
--- ModelRep.cpp	14 May 2004 00:51:34 -0000	1.11
***************
*** 310,314 ****
  			if ( !fco_ptr->isAbstract())
  			{
! 				if ( (*asp_it)->findFinalFCO( fco_ptr))
  				{
  					// each role of fco is member of aspect
--- 310,314 ----
  			if ( !fco_ptr->isAbstract())
  			{
! 				if ( (*asp_it)->findFinalFCO( fco_ptr) || (*asp_it)->isDummy())
  				{
  					// each role of fco is member of aspect
***************
*** 654,662 ****
  
  
! bool ModelRep::check()
  {
  	bool no = (howManyAspects() >= 1);
  	if (!no) 
! 		global_vars.err << getName() + " model has no aspect\n";
  	return no;
  }
--- 654,667 ----
  
  
! bool ModelRep::checkMyAspects( Sheet * s)
  {
  	bool no = (howManyAspects() >= 1);
  	if (!no) 
! 	{
! 		global_vars.err << "Warning: Model \"" << getName() << "\" has no aspect defined.\n";
! 		AspectRep * asp = s->createAspectRep( BON::FCO(), BON::FCO());
! 		this->addFinalAspect( asp);
! 		no = true;
! 	}
  	return no;
  }

Index: ModelRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ModelRep.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ModelRep.h	26 Apr 2004 17:13:38 -0000	1.5
--- ModelRep.h	14 May 2004 00:51:34 -0000	1.6
***************
*** 74,78 ****
  	
  	void createConstraints( Sheet *);
! 	bool check();
  	void inherit();
  	
--- 74,78 ----
  	
  	void createConstraints( Sheet *);
! 	bool checkMyAspects( Sheet *);
  	void inherit();
  	



More information about the GME-commit mailing list