[GME-commit] GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep Any.cpp,1.6,1.7 Any.h,1.4,1.5 AspectRep.cpp,1.4,1.5 Broker.cpp,1.4,1.5 Broker.h,1.3,1.4 ConnJoint.cpp,1.5,1.6 ConnJoint.h,1.1,1.2 ConnectionRep.cpp,1.3,1.4 ConnectionRep.h,1.1,1.2 Dumper.cpp,1.13,1.14 Dumper.h,1.4,1.5 FCO.cpp,1.6,1.7 FCO.h,1.2,1.3 FolderRep.cpp,1.4,1.5 FolderRep.h,1.2,1.3 ModelRep.cpp,1.7,1.8 ModelRep.h,1.3,1.4 ReferenceRep.cpp,1.6,1.7 ReferenceRep.h,1.3,1.4 Sheet.cpp,1.3,1.4

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Tue Mar 9 20:36:31 CST 2004


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

Modified Files:
	Any.cpp Any.h AspectRep.cpp Broker.cpp Broker.h ConnJoint.cpp 
	ConnJoint.h ConnectionRep.cpp ConnectionRep.h Dumper.cpp 
	Dumper.h FCO.cpp FCO.h FolderRep.cpp FolderRep.h ModelRep.cpp 
	ModelRep.h ReferenceRep.cpp ReferenceRep.h Sheet.cpp 
Log Message:
-Aspect ordering taken into account during the drop-down list
-Aspect ordering moved ahead
-Registry logic changed
-ConnJoint appending correction (new owner has to set in m_connPtr)
-ConnJoint::intInherit corrected: roles of References to be used
-ConnJoint::intInherit corrected: transitive references not dumped
-ESML paradigm/import xml error: orphan attributes must not be dumped along with global attributes
-ReferenceRep::finalize modified not to calculate m_allReferences (transitive)

Modified Files:
 	BON2Component.cpp Asp/AspectSpecDlg.cpp Rep/Any.cpp Rep/Any.h 
 	Rep/AspectRep.cpp Rep/Broker.cpp Rep/Broker.h 
 	Rep/ConnJoint.cpp Rep/ConnJoint.h Rep/ConnectionRep.cpp 
 	Rep/ConnectionRep.h Rep/Dumper.cpp Rep/Dumper.h Rep/FCO.cpp 
 	Rep/FCO.h Rep/FolderRep.cpp Rep/FolderRep.h Rep/ModelRep.cpp 
 	Rep/ModelRep.h Rep/ReferenceRep.cpp Rep/ReferenceRep.h 
 	Rep/Sheet.cpp 


CVS User: zolmol

Index: Any.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Any.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Any.cpp	8 Mar 2004 22:22:59 -0000	1.6
--- Any.cpp	10 Mar 2004 02:36:28 -0000	1.7
***************
*** 39,50 ****
  
  
  bool Any::getAttribute( const std::string & val, bool& is_it)
  {
  	is_it = m_ptr->getAttribute(val)->getBooleanValue();
! 	return true;
  }
  
  
! bool Any::isFCO()
  {
  	bool fco = false;
--- 39,65 ----
  
  
+ Any::Any( BON::FCO& ptr)
+ 	: m_ptr( ptr)
+ 	, m_initialConstraintList()
+ 	, m_finalConstraintList()
+ { 
+ }
+ 
+ 
+ Any::~Any() 
+ { 
+ 	m_initialConstraintList.clear();
+ 	m_finalConstraintList.clear();
+ }
+ 
+ 
  bool Any::getAttribute( const std::string & val, bool& is_it)
  {
  	is_it = m_ptr->getAttribute(val)->getBooleanValue();
! 	return is_it;
  }
  
  
! bool Any::isFCO() const
  {
  	bool fco = false;
***************
*** 59,100 ****
  
  
- void Any::addInitialConstraintRep( ConstraintRep * constraint)
- {
- 	ConstraintRepPtrList_ConstIterator it = 
- 		std::find( m_initialConstraintList.begin(), m_initialConstraintList.end(), constraint);
- 
- 	if ( it == m_initialConstraintList.end())
- 		m_initialConstraintList.push_back( constraint);
- 	else
- 		global_vars.err << constraint->getName() << " constraint owned by " << getName() << " twice\n";
- }
- 
- 
- const Any::ConstraintRepPtrList& Any::getInitialConstraintRepPtrList() const
- {
- 	return m_initialConstraintList;
- }
- 
- 
- void Any::addFinalConstraint( ConstraintRep * constraint)
- {
- 	ConstraintRepPtrList_ConstIterator c_it = 
- 		std::find( m_finalConstraintList.begin(), m_finalConstraintList.end(), constraint);
- 
- 	if ( c_it == m_finalConstraintList.end())
- 		m_finalConstraintList.push_back( constraint);
- 	/*else - because of multiple inheritance this can happen easily
- 		global_vars.err << constraint->getName() << " inherited constraint owned by " << getName() << " twice\n";*/
- }
- 
- 
- void Any::addFinalConstraintList( const ConstraintRepPtrList & list)
- {
- 	ConstraintRepPtrList_ConstIterator it = list.begin();
- 	for( ; it != list.end(); ++it)
- 		addFinalConstraint( *it);
- }
- 
- 
  std::string Any::getName() const
  {
--- 74,77 ----
***************
*** 117,140 ****
  
  
- std::string Any::dumpConstraints()
- {
- 	std::string mmm = "";
- 
- 	AnyLexicographicSort lex;
- 	std::string last_name = "";
- 	std::sort( m_finalConstraintList.begin(), m_finalConstraintList.end(), lex );
- 
- 	ConstraintRepPtrList_ConstIterator c_i = m_finalConstraintList.begin();
- 	for( ; c_i != m_finalConstraintList.end(); ++c_i)
- 	{
- 		mmm += ( *c_i)->doDump();
- 		if ( last_name != "" && last_name == (*c_i)->getName())
- 			global_vars.err << "Error: Duplicate constraint name " << (*c_i)->getName() << " found for " << getName() << "\n";
- 		last_name = (*c_i)->getName();
- 	}
- 	return mmm;
- }
- 
- 
  std::string Any::dumpDispName() const
  {
--- 94,97 ----
***************
*** 147,150 ****
--- 104,113 ----
  
  
+ std::string Any::getMyKindStr() const
+ {
+ 	return KIND_TYPE_STR[ getMyKind()];
+ }
+ 
+ 
  std::string Any::getMyPrefix() const
  {
***************
*** 189,198 ****
  }
  
- std::string Any::getMyKindStr() const
- {
- 	return KIND_TYPE_STR[ getMyKind()];
- }
- 
- 
  std::string Any::askMetaRef(const std::string& in_token /* = "" */) const
  {
--- 152,155 ----
***************
*** 240,241 ****
--- 197,258 ----
  	return "NullPtrError";
  }
+ 
+ 
+ void Any::addInitialConstraintRep( ConstraintRep * constraint)
+ {
+ 	ConstraintRepPtrList_ConstIterator it = 
+ 		std::find( m_initialConstraintList.begin(), m_initialConstraintList.end(), constraint);
+ 
+ 	if ( it == m_initialConstraintList.end())
+ 		m_initialConstraintList.push_back( constraint);
+ 	else
+ 		global_vars.err << constraint->getName() << " constraint owned by " << getName() << " twice\n";
+ }
+ 
+ 
+ const Any::ConstraintRepPtrList& Any::getInitialConstraintRepPtrList() const
+ {
+ 	return m_initialConstraintList;
+ }
+ 
+ 
+ void Any::addFinalConstraint( ConstraintRep * constraint)
+ {
+ 	ConstraintRepPtrList_ConstIterator c_it = 
+ 		std::find( m_finalConstraintList.begin(), m_finalConstraintList.end(), constraint);
+ 
+ 	if ( c_it == m_finalConstraintList.end())
+ 		m_finalConstraintList.push_back( constraint);
+ 	/*else - because of multiple inheritance this can happen easily
+ 		global_vars.err << constraint->getName() << " inherited constraint owned by " << getName() << " twice\n";*/
+ }
+ 
+ 
+ void Any::addFinalConstraintList( const ConstraintRepPtrList & list)
+ {
+ 	ConstraintRepPtrList_ConstIterator it = list.begin();
+ 	for( ; it != list.end(); ++it)
+ 		addFinalConstraint( *it);
+ }
+ 
+ 
+ std::string Any::dumpConstraints()
+ {
+ 	std::string mmm = "";
+ 
+ 	AnyLexicographicSort lex;
+ 	std::string last_name = "";
+ 	std::sort( m_finalConstraintList.begin(), m_finalConstraintList.end(), lex );
+ 
+ 	ConstraintRepPtrList_ConstIterator c_i = m_finalConstraintList.begin();
+ 	for( ; c_i != m_finalConstraintList.end(); ++c_i)
+ 	{
+ 		mmm += ( *c_i)->doDump();
+ 		if ( last_name != "" && last_name == (*c_i)->getName())
+ 			global_vars.err << "Error: Duplicate constraint name " << (*c_i)->getName() << " found for " << getName() << "\n";
+ 		last_name = (*c_i)->getName();
+ 	}
+ 	return mmm;
+ }
+ 
+ 

Index: Any.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Any.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Any.h	8 Mar 2004 22:22:59 -0000	1.4
--- Any.h	10 Mar 2004 02:36:28 -0000	1.5
***************
*** 57,70 ****
  
  public:
! 	Any( BON::FCO& ptr): m_ptr( ptr)
! 	{ 
! 		m_initialConstraintList.clear();
! 		m_finalConstraintList.clear();
! 	}
! 	virtual ~Any() 
! 	{ 
! 		m_initialConstraintList.clear();
! 		m_finalConstraintList.clear();
! 	}
  
  public:	
--- 57,62 ----
  
  public:
! 	Any( BON::FCO& ptr);
! 	virtual ~Any();
  
  public:	
***************
*** 79,82 ****
--- 71,75 ----
  
  	BON::FCO getPtr() const { return m_ptr; }
+ 
  	bool getAttribute( const std::string & val, bool& is_it);
  
***************
*** 88,92 ****
  	BON::RegistryNode getMyRegistryOld() const;
  
! 	bool isFCO();
  	std::string askMetaRef(const std::string & tok = "") const;
  
--- 81,85 ----
  	BON::RegistryNode getMyRegistryOld() const;
  
! 	bool isFCO() const;
  	std::string askMetaRef(const std::string & tok = "") const;
  

Index: AspectRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/AspectRep.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AspectRep.cpp	8 Mar 2004 22:22:59 -0000	1.4
--- AspectRep.cpp	10 Mar 2004 02:36:28 -0000	1.5
***************
*** 34,40 ****
  
  AspectRep::AspectRep( BON::FCO& ptr, BON::FCO& resp_ptr)
! : Any( ptr),
! 	m_priority( 0),
! 	m_respPointer( resp_ptr)
  { 
  	m_fcoInitialList.clear();
--- 34,40 ----
  
  AspectRep::AspectRep( BON::FCO& ptr, BON::FCO& resp_ptr)
! 	: Any( ptr)
! 	, m_priority( 0)
! 	, m_respPointer( resp_ptr)
  { 
  	m_fcoInitialList.clear();
***************
*** 54,61 ****
  }
  
  std::string AspectRep::doDump() { return ""; }
  
- Any::KIND_TYPE AspectRep::getMyKind() const { return Any::ASPECT; }
  
  
  
--- 54,62 ----
  }
  
+ 
  std::string AspectRep::doDump() { return ""; }
  
  
+ Any::KIND_TYPE AspectRep::getMyKind() const { return Any::ASPECT; }
  
  

Index: Broker.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Broker.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Broker.cpp	8 Mar 2004 22:22:59 -0000	1.4
--- Broker.cpp	10 Mar 2004 02:36:28 -0000	1.5
***************
*** 16,19 ****
--- 16,30 ----
  
  
+ /*This method resets all static variables of Broker. Called by the Dumper::~Dumper*/
+ void Broker::reset()
+ {
+ 	m_metaRefDB.clear();
+ 	m_firstFree = INITIAL_METAREF;
+ 
+ 	m_constraintId = 0;
+ 	m_metaRefId = INITIAL_METAREF;
+ }
+ 
+ 
  void Broker::init()
  {

Index: Broker.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Broker.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Broker.h	2 Mar 2004 19:21:12 -0000	1.3
--- Broker.h	10 Mar 2004 02:36:28 -0000	1.4
***************
*** 25,28 ****
--- 25,29 ----
  	};
  
+ 	static void reset();
  	static void init();
  	static int getNextConstraintId();

Index: ConnJoint.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ConnJoint.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ConnJoint.cpp	2 Mar 2004 19:21:12 -0000	1.5
--- ConnJoint.cpp	10 Mar 2004 02:36:28 -0000	1.6
***************
*** 32,66 ****
  		std::string card2 /*= ""*/
  	)
! 	: m_connPtr( ptr),
! 
! 		m_oper1( op1), 
! 		m_oper2( op2),
! 		
! 		m_oper1TargetMap(),
! 		m_oper2TargetMap(),
! 
! 		m_bidirect( bidirect),
  
! 		m_oper1Card( card1),
! 		m_oper2Card( card2)
  {
- 	/*m_oper1TargetMap.clear();
- 	m_oper2TargetMap.clear();*/
  }
  
  
! ConnJoint::ConnJoint( const ConnJoint& peer):
! 	m_connPtr( peer.m_connPtr),
! 
! 	m_oper1( peer.m_oper1), 
! 	m_oper2( peer.m_oper2),
! 
! 	m_oper1TargetMap( peer.m_oper1TargetMap),
! 	m_oper2TargetMap( peer.m_oper2TargetMap),
! 
! 	m_bidirect( peer.m_bidirect),
! 
! 	m_oper1Card( peer.m_oper1Card),
! 	m_oper2Card( peer.m_oper2Card)
  { 
  }
--- 32,64 ----
  		std::string card2 /*= ""*/
  	)
! 	: m_connPtr( ptr)
! 	
! 	, m_oper1( op1)
! 	, m_oper2( op2)
! 	
! 	, m_oper1TargetMap()
! 	, m_oper2TargetMap()
! 	
! 	, m_bidirect( bidirect)
  
! 	, m_oper1Card( card1)
! 	, m_oper2Card( card2)
  {
  }
  
  
! ConnJoint::ConnJoint( const ConnJoint& peer)
! 	: m_connPtr( peer.m_connPtr)
! 	
! 	, m_oper1( peer.m_oper1)
! 	, m_oper2( peer.m_oper2)
! 	
! 	, m_oper1TargetMap( peer.m_oper1TargetMap)
! 	, m_oper2TargetMap( peer.m_oper2TargetMap)
! 	
! 	, m_bidirect( peer.m_bidirect)
! 	
! 	, m_oper1Card( peer.m_oper1Card)
! 	, m_oper2Card( peer.m_oper2Card)
  { 
  }
***************
*** 89,92 ****
--- 87,92 ----
  ConnJoint::~ConnJoint() 
  {
+ 	m_connPtr = 0;
+ 	
  	m_oper1.clear();
  	m_oper2.clear();
***************
*** 97,100 ****
--- 97,107 ----
  
  
+ // to be used upon copying
+ void ConnJoint::setConnectionPtr( ConnectionRep * conn_ptr)
+ {
+ 	m_connPtr = conn_ptr;
+ }
+ 
+ 
  const ConnJoint::SDList& ConnJoint::getOp1() const { return m_oper1; }
  const ConnJoint::SDList& ConnJoint::getOp2() const { return m_oper2; }
***************
*** 138,142 ****
  	std::string mod_name = mod_ptr->getName(); //t
  
! 	TargetMap * target_map[] = { &m_oper1TargetMap, &m_oper2TargetMap };
  
  	std::vector<ModelRep*> inner_models1 = mod_ptr->getInnerModelsFinal();
--- 145,150 ----
  	std::string mod_name = mod_ptr->getName(); //t
  
! 	const int number_of_endpoints = 2;
! 	TargetMap * target_map[ number_of_endpoints] = { &m_oper1TargetMap, &m_oper2TargetMap };
  
  	std::vector<ModelRep*> inner_models1 = mod_ptr->getInnerModelsFinal();
***************
*** 150,155 ****
  	{
  		std::string m_r_n = (*model_ref_it)->getName();//t
- 		/*const ModelRep * c_mod_ptr = (*model_ref_it)->getModelRef();
- 		inner_models.push_back( c_mod_ptr); replced by */
  		std::vector<const ModelRep *> models_ref_refers = (*model_ref_it)->getModelRefVector(); // all models the reference refers to
  		std::vector<const ModelRep *>::iterator ref_model_it = models_ref_refers.begin();
--- 158,161 ----
***************
*** 162,169 ****
  	}
  	// inner_models now contains all inner models and all models the inner references refer to
  
! 	SDList* targets[] = { &m_oper1, &m_oper2 };
  	// for each target (src and dst)
! 	for( int i = 0; i < 2; ++i)
  	{
  		SDList_Iterator op_it = targets[i]->begin();
--- 168,177 ----
  	}
  	// inner_models now contains all inner models and all models the inner references refer to
+ 	// why? because the inner references may look like the model they refer to, so if a port is
+ 	// visible on a model then that port is visible on all references (to that model)
  
! 	SDList* targets[ number_of_endpoints] = { &m_oper1, &m_oper2 };
  	// for each target (src and dst)
! 	for( int i = 0; i < number_of_endpoints; ++i)
  	{
  		SDList_Iterator op_it = targets[i]->begin();
***************
*** 211,215 ****
  							RoleRep sub_role = *r_it;	//TOF("    pe sub_role: " + sub_role.getSmartRoleName() + " in " + sub_model->getName());
  							//check if any role is port
! 							if ( sub_role.isPort()) // this role may appear as a port of sub_model
  							{
  								if ( sub_model->getMyKind() == Any::MODEL && !sub_model->isAbstract())
--- 219,223 ----
  							RoleRep sub_role = *r_it;	//TOF("    pe sub_role: " + sub_role.getSmartRoleName() + " in " + sub_model->getName());
  							//check if any role is port
! 							if ( sub_role.isPort()) // this role may appear as a port of sub_model (and/or may appear as a port of a reference to this submodel too)
  							{
  								if ( sub_model->getMyKind() == Any::MODEL && !sub_model->isAbstract())
***************
*** 217,221 ****
  									// fetch all roles of sub_model_desc in model
  									RoleRep::RoleRepSeries sub_model_roles_in_model;
! 									bool has_some_subm = mod_ptr->getFinalRoles( sub_model, sub_model_roles_in_model );
  									RoleRep::RoleRepSeries_ConstIterator r_it_sm = sub_model_roles_in_model.begin();
  									for( ; has_some_subm && r_it_sm != sub_model_roles_in_model.end(); ++r_it_sm )
--- 225,229 ----
  									// fetch all roles of sub_model_desc in model
  									RoleRep::RoleRepSeries sub_model_roles_in_model;
! 									bool has_some_subm = mod_ptr->getFinalRoles( sub_model, sub_model_roles_in_model ); // if the model contains sub_model with some roles
  									RoleRep::RoleRepSeries_ConstIterator r_it_sm = sub_model_roles_in_model.begin();
  									for( ; has_some_subm && r_it_sm != sub_model_roles_in_model.end(); ++r_it_sm )
***************
*** 225,237 ****
  										this->addTargetItem( i, mod_ptr, item);
  									}
! 									// take a look on the references to sub_model -> maybe worthless, useless <!>
! 									const FCO::ReferenceRepList &ref_list = sub_model->getAllMyReferences();
  									FCO::ReferenceRepList_ConstIterator ref_it = ref_list.begin();
  									for( ; ref_it != ref_list.end(); ++ref_it)
  									{
! 										if( !(*ref_it)->isAbstract() && (*ref_it)->amIPartOfFinal( mod_ptr) ) // <!>
  										{
! 											PointerItem item = (*ref_it)->getName() + " " + sub_role.getSmartRoleName();
! 											this->addTargetItem( i, mod_ptr, item);
  										}
  									}
--- 233,254 ----
  										this->addTargetItem( i, mod_ptr, item);
  									}
! 									// take a look on the references to sub_model
! 									const FCO::ReferenceRepList &ref_list = sub_model->getFinalReferences();//<!> use if getTransitiveReferencesToMe(); if you allow conns for transitive references //references may point to submodel
  									FCO::ReferenceRepList_ConstIterator ref_it = ref_list.begin();
  									for( ; ref_it != ref_list.end(); ++ref_it)
  									{
! 										if( !(*ref_it)->isAbstract() && (*ref_it)->amIPartOfFinal( mod_ptr) ) // if model may contain the reference
  										{
! 											RoleRep::RoleRepSeries sub_ref_roles_in_model;
! 											bool ref_has_roles = mod_ptr->getFinalRoles( *ref_it, sub_ref_roles_in_model ); // if the model contains reference with some roles
! 											RoleRep::RoleRepSeries_ConstIterator r_it_ref = sub_ref_roles_in_model.begin();
! 											for( ; ref_has_roles && r_it_ref != sub_ref_roles_in_model.end(); ++r_it_ref )
! 											{
! 												std::string desc_sub_ref_role_name = r_it_ref->getSmartRoleName();
! 												PointerItem item = desc_sub_ref_role_name + " " + sub_role.getSmartRoleName();
! 												this->addTargetItem( i, mod_ptr, item);
! 											}
! 											/*PointerItem item = (*ref_it)->getName() + " " + sub_role.getSmartRoleName();
! 											this->addTargetItem( i, mod_ptr, item);*/
  										}
  									}

Index: ConnJoint.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ConnJoint.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ConnJoint.h	4 Dec 2003 16:45:27 -0000	1.1
--- ConnJoint.h	10 Mar 2004 02:36:29 -0000	1.2
***************
*** 12,16 ****
  #include "list"
  
! class ConnJoint {
  public: // types
  	typedef std::vector< FCO *> SDList;
--- 12,17 ----
  #include "list"
  
! class ConnJoint 
! {
  public: // types
  	typedef std::vector< FCO *> SDList;
***************
*** 38,41 ****
--- 39,44 ----
  	~ConnJoint();
  
+ 	void setConnectionPtr( ConnectionRep * conn_ptr);
+ 
  	const SDList& getOp1() const;
  	const SDList& getOp2() const;
***************
*** 56,65 ****
  protected:
  
!   // pointer to the container Connection, this ConnJoint is part of
  	ConnectionRep * m_connPtr;
  
  	// initial 
  	SDList m_oper1;
!   SDList m_oper2; 
  	
  	// final
--- 59,69 ----
  protected:
  
! 	// pointer to the container Connection, this ConnJoint is part of
! 	// beware: when copied during implementation inheritance the owner may change
  	ConnectionRep * m_connPtr;
  
  	// initial 
  	SDList m_oper1;
! 	SDList m_oper2; 
  	
  	// final
***************
*** 67,71 ****
  	TargetMap m_oper2TargetMap;
  
!   // if label1 == label2
  	bool m_bidirect;
  
--- 71,75 ----
  	TargetMap m_oper2TargetMap;
  
! 	// if label1 == label2
  	bool m_bidirect;
  

Index: ConnectionRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ConnectionRep.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ConnectionRep.cpp	2 Mar 2004 19:21:12 -0000	1.3
--- ConnectionRep.cpp	10 Mar 2004 02:36:29 -0000	1.4
***************
*** 30,35 ****
  
  
! void ConnectionRep::appendJointElements( ConnJoint & joint)
  {
  	if (m_jointList.empty())
  		m_jointList.push_back( joint);
--- 30,38 ----
  
  
! void ConnectionRep::appendJointElements( const ConnJoint & old_joint)
  {
+ 	ConnJoint joint( old_joint); // create a copy of the old joint
+ 	joint.setConnectionPtr( this); // set the new container connection
+ 
  	if (m_jointList.empty())
  		m_jointList.push_back( joint);
***************
*** 41,51 ****
  void ConnectionRep::inherit()
  {
- 	std::vector<FCO*> conn_descendants;
- 	this->getImpDescendants( conn_descendants);
- 	//conn_descendants.push_back( this); nn because the owner will be first filled
- 	std::vector<FCO*>::iterator conn_it = conn_descendants.begin();
- 
  	ModelRepPtrList models = this->modelsIAmPartOfFinal();
  	
  	ModelRepPtrList_Iterator mod_it = models.begin();
  	// for all models i am part of
--- 44,50 ----
  void ConnectionRep::inherit()
  {
  	ModelRepPtrList models = this->modelsIAmPartOfFinal();
  	
+ 	// interface inheritance
  	ModelRepPtrList_Iterator mod_it = models.begin();
  	// for all models i am part of
***************
*** 62,65 ****
--- 61,70 ----
  	}
  
+ 	// implementation inheritance
+ 	std::vector<FCO*> conn_descendants;
+ 	this->getImpDescendants( conn_descendants);
+ 	//conn_descendants.push_back( this); nn because the owner will be first filled
+ 
+ 	std::vector<FCO*>::iterator conn_it = conn_descendants.begin();
  	for( ; conn_it != conn_descendants.end(); ++conn_it)
  	{
***************
*** 67,71 ****
  		for( ; joint_it != m_jointList.end(); ++joint_it )
  		{
- 			
  			ConnectionRep * conn_rep = 0;
  			if ( (*conn_it)->getMyKind() == Any::CONN)
--- 72,75 ----

Index: ConnectionRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ConnectionRep.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ConnectionRep.h	4 Dec 2003 16:45:27 -0000	1.1
--- ConnectionRep.h	10 Mar 2004 02:36:29 -0000	1.2
***************
*** 16,20 ****
  	inline Any::KIND_TYPE getMyKind() const { return Any::CONN; }
  	void addJoint( ConnJoint & joint);
! 	void appendJointElements( ConnJoint & joint);
  	void inherit();
  	bool checkConnectionTargets();
--- 16,20 ----
  	inline Any::KIND_TYPE getMyKind() const { return Any::CONN; }
  	void addJoint( ConnJoint & joint);
! 	void appendJointElements( const ConnJoint & joint);
  	void inherit();
  	bool checkConnectionTargets();

Index: Dumper.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Dumper.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Dumper.cpp	8 Mar 2004 22:22:59 -0000	1.13
--- Dumper.cpp	10 Mar 2004 02:36:29 -0000	1.14
***************
*** 34,38 ****
  Dumper::~Dumper()
  { 
! 	Broker::init();
  }
  
--- 34,38 ----
  Dumper::~Dumper()
  { 
! 	Broker::reset();
  }
  
***************
*** 303,306 ****
--- 303,307 ----
  
  
+ // returns false in severe error cases only: aspect selection impossible for modelreference
  bool Dumper::am()
  {
***************
*** 319,323 ****
  	{
  		global_vars.err << "ERROR: Aspect Dialogue cannot be created\n";
! 		return false;
  	}
  
--- 320,324 ----
  	{
  		global_vars.err << "ERROR: Aspect Dialogue cannot be created\n";
! 		return true;
  	}
  
***************
*** 454,461 ****
  						std::string regVal;
  						// inquiring the registry for the primary asp value
- 						//BON::FCO bon_ptr = part.getFCOPtr()->getPtr();
  						std::string old_regVal1 = part.getFCOPtr()->getPtr()->getRegistry()->getValueByPath( primary_reg_path);
  						std::string old_regVal2 = part.getFCOPtr()->getMyRegistryOld()->getValueByPath( primary_reg_path);
! 						regVal = part.getFCOPtr()->getMyRegistry()->getValueByPath( primary_reg_path);//<!>
  						if (regVal.empty() && ( !old_regVal1.empty() || !old_regVal2.empty()))
  						{
--- 455,461 ----
  						std::string regVal;
  						// inquiring the registry for the primary asp value
  						std::string old_regVal1 = part.getFCOPtr()->getPtr()->getRegistry()->getValueByPath( primary_reg_path);
  						std::string old_regVal2 = part.getFCOPtr()->getMyRegistryOld()->getValueByPath( primary_reg_path);
! 						regVal = part.getFCOPtr()->getMyRegistry()->getValueByPath( primary_reg_path);
  						if (regVal.empty() && ( !old_regVal1.empty() || !old_regVal2.empty()))
  						{
***************
*** 532,536 ****
  						std::string old_regVal1 = part.getFCOPtr()->getPtr()->getRegistry()->getValueByPath( kindasp_reg_path);
  						std::string old_regVal2 = part.getFCOPtr()->getMyRegistryOld()->getValueByPath( kindasp_reg_path);
! 						regVal = part.getFCOPtr()->getMyRegistry()->getValueByPath( kindasp_reg_path);//<!>
  						if ( regVal.empty() && ( !old_regVal1.empty() || !old_regVal2.empty()))
  						{
--- 532,536 ----
  						std::string old_regVal1 = part.getFCOPtr()->getPtr()->getRegistry()->getValueByPath( kindasp_reg_path);
  						std::string old_regVal2 = part.getFCOPtr()->getMyRegistryOld()->getValueByPath( kindasp_reg_path);
! 						regVal = part.getFCOPtr()->getMyRegistry()->getValueByPath( kindasp_reg_path);
  						if ( regVal.empty() && ( !old_regVal1.empty() || !old_regVal2.empty()))
  						{
***************
*** 847,851 ****
  		AttributeRep_Iterator it = m_attributeList.begin();
  		for( ; it != m_attributeList.end(); ++it)
! 			if ((*it)->hasAnyOwner() < 1) // it means is a global variable
  			{
  				//if ((*it)->isViewable())
--- 847,852 ----
  		AttributeRep_Iterator it = m_attributeList.begin();
  		for( ; it != m_attributeList.end(); ++it)
! 			//if ((*it)->hasAnyOwner() < 1) // it means is a global variable: wrong, it may be local without owner!!
! 			if((*it)->isGlobal()) // thus not dumping orphan attributes
  			{
  				//if ((*it)->isViewable())
***************
*** 1380,1384 ****
  		TO("Please check the log file!");
  		wait.Restore();
! 		success = false;
  	}
  
--- 1381,1385 ----
  		TO("Please check the log file!");
  		wait.Restore();
! 		//success = false;
  	}
  

Index: Dumper.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Dumper.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Dumper.h	2 Mar 2004 19:21:12 -0000	1.4
--- Dumper.h	10 Mar 2004 02:36:29 -0000	1.5
***************
*** 17,20 ****
--- 17,23 ----
  	bool build();
  
+ 
+ 	static int selectOutputFiles( const std::string& proj_name);
+ 	static void registerIt( const std::string& f_name);
  	static bool doParseCardinality
  		(const std::string& cardinality, 
***************
*** 23,28 ****
  		std::string &expr);
  	
! 	static int selectOutputFiles( const std::string& proj_name);
! 	static void registerIt( const std::string& f_name);
  protected:
  
--- 26,30 ----
  		std::string &expr);
  	
! 
  protected:
  
***************
*** 36,40 ****
  	
  	void doDump();
- 	//void bonb();
  	bool sortPtrs();
  	bool aspectOrderSel(); // aspect Order Selection
--- 38,41 ----
***************
*** 51,58 ****
  
  	void inheritConstraintsAndAttributes( FCO * ptr, FCO * c_ptr);
- 	//void addToRootFolder( Any * elem);
- 	//bool isInRootFolder( Any * elem);
  	std::vector<AspectRep *> findAspectBasedOnName(const std::string & name_to_find) const;
  };
  
! #endif //SHEET_H
--- 52,57 ----
  
  	void inheritConstraintsAndAttributes( FCO * ptr, FCO * c_ptr);
  	std::vector<AspectRep *> findAspectBasedOnName(const std::string & name_to_find) const;
  };
  
! #endif //DUMPER_H

Index: FCO.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/FCO.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** FCO.cpp	2 Mar 2004 19:21:12 -0000	1.6
--- FCO.cpp	10 Mar 2004 02:36:29 -0000	1.7
***************
*** 15,27 ****
  
  
- 
  FCO::FCO( BON::FCO& ptr)
! 	: Any( ptr), 
! 	m_isAbstract( false),
! 	m_references(),
! 	m_partOf(),
! 	m_partOfFinal(),
! 	m_initialAttributeList(),
! 	m_finalAttributeList()
  { 
  	for ( int i = 0; i < NUMBER_OF_INHERITANCES; ++i)
--- 15,26 ----
  
  
  FCO::FCO( BON::FCO& ptr)
! 	: Any( ptr)
! 	, m_isAbstract( false)
! 	, m_references()
! 	, m_partOf()
! 	, m_partOfFinal()
! 	, m_initialAttributeList()
! 	, m_finalAttributeList()
  { 
  	for ( int i = 0; i < NUMBER_OF_INHERITANCES; ++i)
***************
*** 186,195 ****
  }
  
  /*
  dealing with the case when R1->R2->R3->M. They all have similar aspects
  ->currently GME doesn't support this, though it shows in a way it could support!!!
  <!>
  */
! FCO::ReferenceRepList FCO::getAllMyReferences() const
  {
  	ReferenceRepList multiple_refs = this->getFinalReferences();
--- 185,197 ----
  }
  
+ 
  /*
  dealing with the case when R1->R2->R3->M. They all have similar aspects
  ->currently GME doesn't support this, though it shows in a way it could support!!!
  <!>
+ 		it should have a name like: getTransitiveReferencesToMe // <!>
+ 		previously named getAllMyReferences
  */
! FCO::ReferenceRepList FCO::getTransitiveReferencesToMe() const
  {
  	ReferenceRepList multiple_refs = this->getFinalReferences();
***************
*** 199,210 ****
  	while ( !ref_list.empty())
  	{
! 		ReferenceRep * r = *ref_list.begin();
  		ref_list.pop_front();
! 		std::vector< ReferenceRep *> temp = r->getFinalReferences();
  
  		std::vector<ReferenceRep *>::iterator temp_it = temp.begin();
  		for( ; temp_it != temp.end(); ++temp_it)
  		{
! 			if( std::find( multiple_refs.begin(), multiple_refs.end(), *temp_it) == multiple_refs.end()) // not found
  			{
  				multiple_refs.push_back( *temp_it); // multiple_refs is growing
--- 201,212 ----
  	while ( !ref_list.empty())
  	{
! 		ReferenceRep * r = *ref_list.begin(); // take a ref from the final references to me
  		ref_list.pop_front();
! 		std::vector< ReferenceRep *> temp = r->getFinalReferences(); // take its references
  
  		std::vector<ReferenceRep *>::iterator temp_it = temp.begin();
  		for( ; temp_it != temp.end(); ++temp_it)
  		{
! 			if( std::find( multiple_refs.begin(), multiple_refs.end(), *temp_it) == multiple_refs.end()) // not found a ref in the current transitive ref list
  			{
  				multiple_refs.push_back( *temp_it); // multiple_refs is growing
***************
*** 290,293 ****
--- 292,296 ----
  void FCO::setAncestors( INHERITANCE_TYPE type, const std::vector<FCO*> &anc_list)
  {
+ 	ASSERT( type != REGULAR);
  	//global_vars.err << getName() << " . # of ancest: " << anc_list.size() << " with type: "<< type << "\n";
  
***************
*** 299,303 ****
  void FCO::setDescendants( INHERITANCE_TYPE type, const std::vector<FCO*> &desc_list)
  {
! 	//if ( getName() == "ScriptBase")
  	//global_vars.err << getName() << " . # of desc: " << desc_list.size() << " with type: "<< type << "\n";
  
--- 302,306 ----
  void FCO::setDescendants( INHERITANCE_TYPE type, const std::vector<FCO*> &desc_list)
  {
! 	ASSERT( type != REGULAR);
  	//global_vars.err << getName() << " . # of desc: " << desc_list.size() << " with type: "<< type << "\n";
  

Index: FCO.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/FCO.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FCO.h	2 Mar 2004 19:21:12 -0000	1.2
--- FCO.h	10 Mar 2004 02:36:29 -0000	1.3
***************
*** 57,61 ****
  
  	// return all references (even those which are references to reference to "this")
! 	ReferenceRepList getAllMyReferences() const;
  	
  	// stores the information that this is part of a ModelRep
--- 57,61 ----
  
  	// return all references (even those which are references to reference to "this")
! 	ReferenceRepList getTransitiveReferencesToMe() const;
  	
  	// stores the information that this is part of a ModelRep
***************
*** 94,100 ****
  	void setDescendants( INHERITANCE_TYPE type, const std::vector<FCO*> &);
  
- 	// finds out if "this" has "par" as a "type" parent
- 	bool hasParent( const FCO * par, INHERITANCE_TYPE type) const;
- 
  	// the desc's/ancest's who share the same intface (REGULAR and INTERFACE combined)
  	void getIntDescendants( std::vector<FCO*> & descendants) const;
--- 94,97 ----
***************
*** 105,108 ****
--- 102,108 ----
  	void getImpAncestors( std::vector<FCO*> & ancestors) const;
  
+ 	// finds out if "this" has "par" as a "type" parent
+ 	bool hasParent( const FCO * par, INHERITANCE_TYPE type) const;
+ 
  	// attributes of "this"
  	void addInitialAttribute( AttributeRep * attr);
***************
*** 152,159 ****
  	std::vector<FCO *> m_parentList[ NUMBER_OF_INHERITANCES ];
  
! 	// stores all ancestors : currently REGULAR is empty
  	std::vector<FCO*> m_ancestors[ NUMBER_OF_INHERITANCES ];
  
! 	// stores all descendants : currently REGULAR is empty
  	std::vector<FCO*> m_descendants[ NUMBER_OF_INHERITANCES ];
  
--- 152,159 ----
  	std::vector<FCO *> m_parentList[ NUMBER_OF_INHERITANCES ];
  
! 	// stores all ancestors : currently REGULAR is empty, using it causes assertion
  	std::vector<FCO*> m_ancestors[ NUMBER_OF_INHERITANCES ];
  
! 	// stores all descendants : currently REGULAR is empty, using it causes assertion
  	std::vector<FCO*> m_descendants[ NUMBER_OF_INHERITANCES ];
  

Index: FolderRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/FolderRep.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FolderRep.cpp	2 Mar 2004 19:21:12 -0000	1.4
--- FolderRep.cpp	10 Mar 2004 02:36:29 -0000	1.5
***************
*** 12,15 ****
--- 12,36 ----
  
  
+ FolderRep::FolderRep( BON::FCO& ptr, BON::FCO& resp_ptr) 
+ 	: Any( ptr)
+ 	, m_fcoList()
+ 	, m_fcoCardList()
+ 	, m_subFolderList()
+ 	, m_subCardList()
+ 	, m_respPointer( resp_ptr)
+ { 
+ }
+ 
+ 
+ FolderRep::~FolderRep() 
+ { 
+ 	m_fcoList.clear();
+ 	m_fcoCardList.clear();
+ 	m_subFolderList.clear();
+ 	m_subCardList.clear();
+ 	m_respPointer = BON::FCO();
+ }
+ 
+ 	
  std::string FolderRep::getName() const
  {

Index: FolderRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/FolderRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FolderRep.h	28 Jan 2004 00:19:31 -0000	1.2
--- FolderRep.h	10 Mar 2004 02:36:29 -0000	1.3
***************
*** 45,63 ****
  That is why a folder has to redefine the getName, getDispName operations
  */
! 	FolderRep( BON::FCO& ptr, BON::FCO& resp_ptr) 
! 		: Any( ptr), 
! 		m_fcoList(), m_fcoCardList(),
! 		m_subFolderList(), m_subCardList(),
! 		m_respPointer( resp_ptr)
! 	{ 
! 	}
! 
! 	~FolderRep() 
! 	{ 
! 		m_fcoList.clear();
! 		m_fcoCardList.clear();
! 		m_subFolderList.clear();
! 		m_subCardList.clear();
! 	}
  
  	/*virtual*/ Any::KIND_TYPE getMyKind() const { return Any::FOLDER; }
--- 45,50 ----
  That is why a folder has to redefine the getName, getDispName operations
  */
! 	FolderRep( BON::FCO& ptr, BON::FCO& resp_ptr);
! 	~FolderRep();
  
  	/*virtual*/ Any::KIND_TYPE getMyKind() const { return Any::FOLDER; }

Index: ModelRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ModelRep.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ModelRep.cpp	8 Mar 2004 22:22:59 -0000	1.7
--- ModelRep.cpp	10 Mar 2004 02:36:29 -0000	1.8
***************
*** 6,12 ****
  #include "ReferenceRep.h"
  #include "ModelRep.h"
- #include "logger.h"
  #include "Dumper.h"
  #include "Broker.h"
  #include "algorithm"
  
--- 6,13 ----
  #include "ReferenceRep.h"
  #include "ModelRep.h"
  #include "Dumper.h"
  #include "Broker.h"
+ 
+ #include "logger.h"
  #include "algorithm"
  
***************
*** 15,18 ****
--- 16,38 ----
  
  
+ ModelRep::ModelRep( BON::FCO& ptr)
+ 	: FCO( ptr)
+ 	, m_initialRoleMap()
+ 	, m_finalRoleMap()
+ 	, m_initialAspectList()
+ 	, m_finalAspectList()
+ { 
+ }
+ 
+ 
+ ModelRep::~ModelRep()
+ {
+ 	m_initialRoleMap.clear();
+ 	m_finalRoleMap.clear();
+ 	m_initialAspectList.clear();
+ 	m_finalAspectList.clear();
+ }
+ 
+ 	
  void ModelRep::addRole( FCO* whose, RoleSeriesValue& role) 
  { 
***************
*** 70,73 ****
--- 90,94 ----
  }
  
+ 
  bool ModelRep::getRoles( FCO * ptr, RoleMapValue& map_val) const
  {
***************
*** 441,445 ****
  how many of my aspects contain FCO as an aspect member
  */
! int ModelRep::searchMyAspectsForFCO( const FCO* asp_element) const // <!> should be changed to part search
  {
  	throw 1;
--- 462,466 ----
  how many of my aspects contain FCO as an aspect member
  */
! /*int ModelRep::searchMyAspectsForFCO( const FCO* asp_element) const // should be changed to part search
  {
  	throw 1;
***************
*** 453,457 ****
  	}
  	return count;
! }
  
  
--- 474,478 ----
  	}
  	return count;
! }*/
  
  

Index: ModelRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ModelRep.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ModelRep.h	8 Mar 2004 22:22:59 -0000	1.3
--- ModelRep.h	10 Mar 2004 02:36:29 -0000	1.4
***************
*** 34,51 ****
  
  public:
! 	ModelRep( BON::FCO& ptr): FCO( ptr)
! 	{ 
! 		m_initialRoleMap.clear();
! 		m_finalRoleMap.clear();
! 		m_initialAspectList.clear();
! 		m_finalAspectList.clear();
! 	}
! 	~ModelRep()
! 	{
! 		m_initialRoleMap.clear();
! 		m_finalRoleMap.clear();
! 		m_initialAspectList.clear();
! 		m_finalAspectList.clear();
! 	}
  
  	inline Any::KIND_TYPE getMyKind() const { return Any::MODEL; }
--- 34,39 ----
  
  public:
! 	ModelRep( BON::FCO& ptr);
! 	~ModelRep();
  
  	inline Any::KIND_TYPE getMyKind() const { return Any::MODEL; }
***************
*** 55,65 ****
  	void addRole( RoleMapKey whose, RoleRep& role);
  	void initRoles();
! 	bool getRoles( FCO * ptr, RoleMapValue& map_val) const;
! 	//const RoleMapValue& getRoles( FCO * ptr);
  	// Final roles
  	void addFinalRole( RoleMapKey whose, RoleRep& role);
! 	bool getFinalRoles( const FCO * ptr, RoleMapValue& map_val) const;
! 	//const RoleMapValue& getFinalRoles( FCO * ptr);
! 
  
  	// inner models
--- 43,51 ----
  	void addRole( RoleMapKey whose, RoleRep& role);
  	void initRoles();
! 	bool getRoles( FCO * ptr, RoleMapValue& ) const;
! 
  	// Final roles
  	void addFinalRole( RoleMapKey whose, RoleRep& role);
! 	bool getFinalRoles( const FCO * ptr, RoleMapValue& ) const;
  
  	// inner models

Index: ReferenceRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ReferenceRep.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ReferenceRep.cpp	8 Mar 2004 22:22:59 -0000	1.6
--- ReferenceRep.cpp	10 Mar 2004 02:36:29 -0000	1.7
***************
*** 14,21 ****
  
  ReferenceRep::ReferenceRep( BON::FCO& ptr)
! : FCO( ptr),
! 	m_initialReferees(),
! 	m_finalReferees(),
! 	m_allReferees()
  {
  }
--- 14,21 ----
  
  ReferenceRep::ReferenceRep( BON::FCO& ptr)
! 	: FCO( ptr)
! 	, m_initialReferees()
! 	, m_finalReferees()
! 	, m_allReferees()
  {
  }
***************
*** 99,107 ****
  
  /*
  Should return a ModelRep * if pointToModels is true
  Returns non abstract models only !!! (see ESML paradigm)
  */
  // see getModelRefVector() too
! const ModelRep * ReferenceRep::getModelRef() const
  {
  	unsigned int i = 0;
--- 99,130 ----
  
  /*
+ Should return vector<ModelRep *> if pointToModels is true
+ Returns non abstract models only !!! (see ESML paradigm)
+ */
+ std::vector<const ModelRep *> ReferenceRep::getModelRefVector() const
+ {
+ 	std::vector<const ModelRep *> models;
+ 	unsigned int i = 0;
+ 	while( i < m_allReferees.size()) 
+ 	{
+ 		if ( m_allReferees[i]->getMyKind() == Any::MODEL && !m_allReferees[i]->isAbstract())
+ 		{
+ 			const ModelRep * c_m = static_cast<const ModelRep*>( m_allReferees[i]);
+ 			if ( std::find( models.begin(), models.end(), c_m) == models.end())
+ 				models.push_back( c_m);
+ 		}
+ 		++i;
+ 	}
+ 
+ 	return models;
+ }
+ 
+ 
+ /* -- obsolete
  Should return a ModelRep * if pointToModels is true
  Returns non abstract models only !!! (see ESML paradigm)
  */
  // see getModelRefVector() too
! /*const ModelRep * ReferenceRep::getModelRef() const
  {
  	unsigned int i = 0;
***************
*** 131,228 ****
  		return static_cast<const ModelRep*>( m_allReferees[i]);
  	}
! }
! 
! std::vector<const ModelRep *> ReferenceRep::getModelRefVector() const
! {
! 	std::vector<const ModelRep *> models;
! 	unsigned int i = 0;
! 	while( i < m_allReferees.size()) 
! 	{
! 		if ( m_allReferees[i]->getMyKind() == Any::MODEL && !m_allReferees[i]->isAbstract())
! 		{
! 			const ModelRep * c_m = static_cast<const ModelRep*>( m_allReferees[i]);
! 			if ( std::find( models.begin(), models.end(), c_m) == models.end())
! 				models.push_back( c_m);
! 		}
! 		++i;
! 	}
! 
! 	return models;
! }
! 
! 
! int ReferenceRep::howManyAspectsAmongModelRefs() const
! {
! 	ModelRep::AspectRepPtrList intersection_of_asps = getAspectsIntersection();
! 	return (int) intersection_of_asps.size(); 
! }
! 
! 
! AspectRep * ReferenceRep::getFirstAspectFromIntersection() const
! {
! 	ModelRep::AspectRepPtrList intersection_of_asps = getAspectsIntersection();
! 
! 	AspectRep * lowest_asp = 0;
! 
! 	ModelRep::AspectRepPtrList::iterator asp_it = intersection_of_asps.begin();
! 	for( ; asp_it != intersection_of_asps.end(); ++asp_it)
! 	{
! 		if ( !lowest_asp) // is lowest_asp set?
! 			lowest_asp = *asp_it;
! 		else if ( !lowest_asp->lessThan( **asp_it)) // compare
! 			lowest_asp = *asp_it;
! 	}
! 
! 	return lowest_asp;
! }
! 
! 
! std::vector<AspectRep *> ReferenceRep::getAspectsIntersection() const
! {
! 	ModelRep::AspectRepPtrList intersection_of_asps;
! 	bool inited = false;
! 	std::vector<const ModelRep *> models = getModelRefVector();
! 	std::vector<const ModelRep *>::iterator it = models.begin();
! 	for( ; it != models.end(); ++it)
! 	{
! 		const ModelRep::AspectRepPtrList &asplist = (*it)->getFinalAspectRepPtrList();
! 		if ( !inited)
! 		{
! 			intersection_of_asps = asplist; // set the first vector as an initial value of the union
! 			inited = true;
! 		}
! 		else
! 		{
! 			ModelRep::AspectRepPtrList::iterator isect_it = intersection_of_asps.begin();
! 			while( isect_it != intersection_of_asps.end())
! 			{
! 				if ( std::find( asplist.begin(), asplist.end(), *isect_it) == asplist.end()) // element of union not found in asp set, so it should be deleted from the union
! 					isect_it = intersection_of_asps.erase( isect_it); // this moves the iterator ahead
! 				else
! 				 ++isect_it;
! 			}
! 		}
! 	}
! 	return intersection_of_asps;
! }
! 
! 
! /*out of date, out of use obsolete*/ //<!>
! AspectRep * ReferenceRep::getFirstAmongModelAspects() const
! {
! 	// the first aspects of the referred models to be compared and the best returned
! 	AspectRep * lowest_asp = 0;
! 	std::vector<const ModelRep *> models = getModelRefVector();
! 	std::vector<const ModelRep *>::iterator it = models.begin();
! 	for( ; it != models.end(); ++it)
! 	{
! 		AspectRep * min_asp = (*it)->getFirstAspect();
! 		if ( !lowest_asp) // is lowest_asp set?
! 			lowest_asp = min_asp;
! 		else if ( !lowest_asp->lessThan( *min_asp)) // compare
! 			lowest_asp = min_asp;
! 	}
! 	return lowest_asp;
! }
  
  
--- 154,158 ----
  		return static_cast<const ModelRep*>( m_allReferees[i]);
  	}
! }*/
  
  
***************
*** 245,249 ****
  	for( ; referee_it != referees.end(); ++referee_it)
  	{
- 		std::string ref_name = (*referee_it)->getName();
  		addFinalReferees( *referee_it);
  		(*referee_it)->addFinalRefersToMe( this);
--- 175,178 ----
***************
*** 286,289 ****
--- 215,222 ----
  bool ReferenceRep::finalize()
  {
+ 	m_allReferees = m_finalReferees;
+ 	return true; //<!>
+ 	// right now do not perform the calc
+ 
  	bool value_set = false;
  	bool same_kind = true;
***************
*** 423,424 ****
--- 356,434 ----
  	else return false;
  }
+ 
+ 
+ int ReferenceRep::howManyAspectsAmongModelRefs() const
+ {
+ 	ModelRep::AspectRepPtrList intersection_of_asps = getAspectsIntersection();
+ 	return (int) intersection_of_asps.size(); 
+ }
+ 
+ 
+ AspectRep * ReferenceRep::getFirstAspectFromIntersection() const
+ {
+ 	ModelRep::AspectRepPtrList intersection_of_asps = getAspectsIntersection();
+ 
+ 	AspectRep * lowest_asp = 0;
+ 
+ 	ModelRep::AspectRepPtrList::iterator asp_it = intersection_of_asps.begin();
+ 	for( ; asp_it != intersection_of_asps.end(); ++asp_it)
+ 	{
+ 		if ( !lowest_asp) // is lowest_asp set?
+ 			lowest_asp = *asp_it;
+ 		else if ( !lowest_asp->lessThan( **asp_it)) // compare
+ 			lowest_asp = *asp_it;
+ 	}
+ 
+ 	return lowest_asp;
+ }
+ 
+ 
+ std::vector<AspectRep *> ReferenceRep::getAspectsIntersection() const
+ {
+ 	ModelRep::AspectRepPtrList intersection_of_asps;
+ 	bool inited = false;
+ 	std::vector<const ModelRep *> models = getModelRefVector();
+ 	std::vector<const ModelRep *>::iterator it = models.begin();
+ 	for( ; it != models.end(); ++it)
+ 	{
+ 		const ModelRep::AspectRepPtrList &asplist = (*it)->getFinalAspectRepPtrList();
+ 		if ( !inited)
+ 		{
+ 			intersection_of_asps = asplist; // set the first vector as an initial value of the union
+ 			inited = true;
+ 		}
+ 		else
+ 		{
+ 			ModelRep::AspectRepPtrList::iterator isect_it = intersection_of_asps.begin();
+ 			while( isect_it != intersection_of_asps.end())
+ 			{
+ 				if ( std::find( asplist.begin(), asplist.end(), *isect_it) == asplist.end()) // element of union not found in asp set, so it should be deleted from the union
+ 					isect_it = intersection_of_asps.erase( isect_it); // this moves the iterator ahead
+ 				else
+ 				 ++isect_it;
+ 			}
+ 		}
+ 	}
+ 	return intersection_of_asps;
+ }
+ 
+ 
+ /*out of date, out of use obsolete*/
+ /*AspectRep * ReferenceRep::getFirstAmongModelAspects() const
+ {
+ 	// the first aspects of the referred models to be compared and the best returned
+ 	AspectRep * lowest_asp = 0;
+ 	std::vector<const ModelRep *> models = getModelRefVector();
+ 	std::vector<const ModelRep *>::iterator it = models.begin();
+ 	for( ; it != models.end(); ++it)
+ 	{
+ 		AspectRep * min_asp = (*it)->getFirstAspect();
+ 		if ( !lowest_asp) // is lowest_asp set?
+ 			lowest_asp = min_asp;
+ 		else if ( !lowest_asp->lessThan( *min_asp)) // compare
+ 			lowest_asp = min_asp;
+ 	}
+ 	return lowest_asp;
+ }*/
+ 
+ 

Index: ReferenceRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/ReferenceRep.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ReferenceRep.h	2 Mar 2004 19:21:12 -0000	1.3
--- ReferenceRep.h	10 Mar 2004 02:36:29 -0000	1.4
***************
*** 24,45 ****
  	const RefereeList& getInitialReferees() const;
  	
- 	const ModelRep * getModelRef() const;
- 	std::vector<const ModelRep *> getModelRefVector() const;
- 	int howManyAspectsAmongModelRefs() const;
- 	
- 	std::vector<AspectRep *> getAspectsIntersection() const;
- 	AspectRep * getFirstAspectFromIntersection() const;
- 	AspectRep * getFirstAmongModelAspects() const;
  	void addFinalReferees( FCO * referee);
  	void addFinalReferees( RefereeList & referees);
  	const RefereeList& getFinalReferees() const;
  
- 	bool pointsToModels() const; // true if points to models only
- 	void inherit();
  	bool finalize();
  
  	bool checkNotEmpty() const;
  	bool checkAllTheSameKind() const; 
  
  protected:
  	// initialy "this" refers to
--- 24,47 ----
  	const RefereeList& getInitialReferees() const;
  	
  	void addFinalReferees( FCO * referee);
  	void addFinalReferees( RefereeList & referees);
  	const RefereeList& getFinalReferees() const;
  
  	bool finalize();
+ 	void inherit();
+ 
+ 	bool pointsToModels() const; // true if points to models only
+ 	std::vector<const ModelRep *> getModelRefVector() const;
+ 	//const ModelRep * getModelRef() const; // obsolete
  
  	bool checkNotEmpty() const;
  	bool checkAllTheSameKind() const; 
  
+ 	// aspect related
+ 	int howManyAspectsAmongModelRefs() const;
+ 	std::vector<AspectRep *> getAspectsIntersection() const;
+ 	AspectRep * getFirstAspectFromIntersection() const;
+ 	//AspectRep * getFirstAmongModelAspects() const; //obsolete
+ 
  protected:
  	// initialy "this" refers to
***************
*** 48,51 ****
--- 50,57 ----
  	RefereeList m_finalReferees;
  	// member that contains all the referees (including multiple steps by referring to a reference)
+ 	// this reference may look like all of m_allReferees 
+ 	// i.e. ( ref1 -> ref2 -> model) ref1 looks like model
+ 	// plays role at connection dump
+ 	// it should be named m_transitiveReferences
  	RefereeList m_allReferees;
  

Index: Sheet.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Sheet.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Sheet.cpp	8 Mar 2004 22:22:59 -0000	1.3
--- Sheet.cpp	10 Mar 2004 02:36:29 -0000	1.4
***************
*** 29,63 ****
  }
  
- void Sheet::setProjName( const std::string& name)
- {
- 	m_projName = name;
- }
- 
- /*virtual*/ bool Sheet::finalize()
- {
- 	bool ret_val = false;
- 	if ( doInheritance( FCO::INTERFACE) 
- 		&& doInheritance( FCO::IMPLEMENTATION))
- 	{
- 		initRoleNames();
- 		ret_val = true;
- 	}
- 	else 
- 		global_vars.err << "Error: Inheritance problems\n";
- 
- 	return ret_val;	
- }
- 
- 
- void Sheet::initRoleNames()
- {
- 	ModelRep_Iterator jt1( m_modelList.begin());
- 	for( ; jt1 != m_modelList.end(); ++jt1)
- 	{
- 		ModelRep * mod_ptr = *jt1;
- 		mod_ptr->initRoles();
- 	}
- }
- 
  
  Sheet::~Sheet()
--- 29,32 ----
***************
*** 171,174 ****
--- 140,175 ----
  
  
+ void Sheet::setProjName( const std::string& name)
+ {
+ 	m_projName = name;
+ }
+ 
+ /*virtual*/ bool Sheet::finalize()
+ {
+ 	bool ret_val = false;
+ 	if ( doInheritance( FCO::INTERFACE) 
+ 		&& doInheritance( FCO::IMPLEMENTATION))
+ 	{
+ 		initRoleNames();
+ 		ret_val = true;
+ 	}
+ 	else 
+ 		global_vars.err << "Error: Inheritance problems\n";
+ 
+ 	return ret_val;	
+ }
+ 
+ 
+ void Sheet::initRoleNames()
+ {
+ 	ModelRep_Iterator jt1( m_modelList.begin());
+ 	for( ; jt1 != m_modelList.end(); ++jt1)
+ 	{
+ 		ModelRep * mod_ptr = *jt1;
+ 		mod_ptr->initRoles();
+ 	}
+ }
+ 
+ 
  FcoRep* Sheet::createFcoRep( BON::FCO& ptr)
  {
***************
*** 456,460 ****
  {
  	bool is_it;
- 
  	elem->getAttribute("InRootFolder", is_it);
  
--- 457,460 ----



More information about the GME-commit mailing list