[GME-commit] GMESRC/Paradigms/MetaGME/BonExtension/Rep Sheet.cpp,1.10,1.11 Sheet.h,1.9,1.10

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu Nov 3 19:36:01 CST 2005


Update of /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Rep
In directory escher:/tmp/cvs-serv14892/Rep

Modified Files:
	Sheet.cpp Sheet.h 
Log Message:
Bug when handling metamodels with implementation or interface inheritance.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: Sheet.h
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Sheet.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Sheet.h	21 Oct 2004 02:04:34 -0000	1.9
--- Sheet.h	3 Nov 2005 19:35:59 -0000	1.10
***************
*** 57,62 ****
  protected:
  	std::vector< FCO *> Sheet::sortBasedOnLevels();
! 	int m_numberOfCliques; // stores the number of cliques from inheritance point of view
! 
  	typedef std::vector<FCO*>::iterator FCO_Iterator;
  	typedef std::vector<Any*>::iterator Any_Iterator;
--- 57,62 ----
  protected:
  	std::vector< FCO *> Sheet::sortBasedOnLevels();
! 	int m_numberOfCliques[FCO::INHERITANCE_TYPE::NUMBER_OF_INHERITANCES]; // stores the number of cliques from inheritance point of view
! 	                                                                      // this may be different from INTERFACE and IMPLEMENTATION point of view
  	typedef std::vector<FCO*>::iterator FCO_Iterator;
  	typedef std::vector<Any*>::iterator Any_Iterator;

Index: Sheet.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Sheet.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Sheet.cpp	21 Oct 2004 02:04:34 -0000	1.10
--- Sheet.cpp	3 Nov 2005 19:35:59 -0000	1.11
***************
*** 25,28 ****
--- 25,30 ----
  	m_attributeList()
  {
+ 	for( unsigned int i = 0; i < FCO::INHERITANCE_TYPE::NUMBER_OF_INHERITANCES; ++i)
+ 		m_numberOfCliques[ i ] = 0;
  }
  
***************
*** 30,33 ****
--- 32,37 ----
  Sheet::~Sheet()
  {
+ 	for( unsigned int i = 0; i < FCO::INHERITANCE_TYPE::NUMBER_OF_INHERITANCES; ++i)
+ 		m_numberOfCliques[ i ] = 0;
  	m_theOnlyInstance = 0;
  	
***************
*** 595,599 ****
  	std::vector<unsigned int> dupl_temp;
  
! 	m_numberOfCliques = howManyCliques( clique_vec);
  
  	for( i = 0; i < node_vec.size(); ++i)
--- 599,603 ----
  	std::vector<unsigned int> dupl_temp;
  
! 	m_numberOfCliques[ inh_type] = howManyCliques( clique_vec);
  
  	for( i = 0; i < node_vec.size(); ++i)
***************
*** 604,608 ****
  		}
  
! 	if (elements.size() < m_numberOfCliques) // because from each clique there must be at least 1 root
  	{
  		TO("Circle found in model");
--- 608,612 ----
  		}
  
! 	if (elements.size() < m_numberOfCliques[ inh_type]) // because from each clique there must be at least 1 root
  	{
  		TO("Circle found in model");
***************
*** 700,704 ****
  			{
  				descendants[ancestors_of_id[k]].push_back(id);
! 				std::string m1 = node_vec[ancestors_of_id[k]]->getName() + " has desc " + node_vec[id]->getName();
  			//TO( m1);
  			}
--- 704,708 ----
  			{
  				descendants[ancestors_of_id[k]].push_back(id);
! 				//std::string m1 = node_vec[ancestors_of_id[k]]->getName() + " has desc " + node_vec[id]->getName();
  			//TO( m1);
  			}
***************
*** 709,718 ****
  	for( i = 0; i < node_vec.size(); ++i)
  	{
! 		std::string mmma, mmmd, mmm;
  		std::vector< FCO*> anc_list, desc_list;
  		for ( unsigned int k = 0; k < ancestors[i].size(); ++k)
  		{
  			anc_list.push_back( node_vec[ancestors[i][k]]);
! 			mmma += node_vec[ancestors[i][k]]->getName() + " ";
  		}
  
--- 713,722 ----
  	for( i = 0; i < node_vec.size(); ++i)
  	{
! 		//std::string mmma, mmmd, mmm;
  		std::vector< FCO*> anc_list, desc_list;
  		for ( unsigned int k = 0; k < ancestors[i].size(); ++k)
  		{
  			anc_list.push_back( node_vec[ancestors[i][k]]);
! 			//mmma += node_vec[ancestors[i][k]]->getName() + " ";
  		}
  
***************
*** 720,726 ****
  		{
  			desc_list.push_back( node_vec[descendants[i][l]]);
! 			mmmd += node_vec[descendants[i][l]]->getName() + " ";
  		}
! 		mmm = node_vec[i]->getName() + std::string( (inh_type==FCO::INTERFACE)?" INTERFACE":(inh_type==FCO::IMPLEMENTATION)?" IMPLEMENTATION":" OTHER");
  		//TO ( mmm + "\nanc:\n" + mmma + "\ndesc:\n" + mmmd);
  		node_vec[i]->setAncestors( inh_type, anc_list);
--- 724,730 ----
  		{
  			desc_list.push_back( node_vec[descendants[i][l]]);
! 			//mmmd += node_vec[descendants[i][l]]->getName() + " ";
  		}
! 		//mmm = node_vec[i]->getName() + std::string( (inh_type==FCO::INTERFACE)?" INTERFACE":(inh_type==FCO::IMPLEMENTATION)?" IMPLEMENTATION":" OTHER");
  		//TO ( mmm + "\nanc:\n" + mmma + "\ndesc:\n" + mmmd);
  		node_vec[i]->setAncestors( inh_type, anc_list);
***************
*** 761,765 ****
  	// important init step: there will be cliques with no models, so the following step
  	// will overwrite the values for the cliques (the keys) the models are part of
! 	for( int clique_index0 = 1; clique_index0 <= m_numberOfCliques; ++clique_index0)
  		how_many_models_in_clique[ clique_index0] = 0;
  
--- 765,769 ----
  	// important init step: there will be cliques with no models, so the following step
  	// will overwrite the values for the cliques (the keys) the models are part of
! 	for( int clique_index0 = 1; clique_index0 <= m_numberOfCliques[ type]; ++clique_index0)
  		how_many_models_in_clique[ clique_index0] = 0;
  
***************
*** 775,779 ****
  		how_many_inverse[ hmmic_ind->second].push_back( hmmic_ind->first);
  	// we have and ascending order of cliques based on the number of models contained
! 	
  	std::map<unsigned int, std::list<unsigned int> >::reverse_iterator hminv_ind = how_many_inverse.rbegin();
  	//for( int clique_index = 1; clique_index <= m_numberOfCliques; ++clique_index)
--- 779,783 ----
  		how_many_inverse[ hmmic_ind->second].push_back( hmmic_ind->first);
  	// we have and ascending order of cliques based on the number of models contained
! 
  	std::map<unsigned int, std::list<unsigned int> >::reverse_iterator hminv_ind = how_many_inverse.rbegin();
  	//for( int clique_index = 1; clique_index <= m_numberOfCliques; ++clique_index)



More information about the GME-commit mailing list