[GME-commit] GMESRC/Paradigms/MetaGME/BonExtension/Rep Any.cpp,1.4,1.5 Any.h,1.3,1.4 AtomRep.cpp,1.2,1.3 AtomRep.h,1.2,1.3 AttributeRep.cpp,1.4,1.5 AttributeRep.h,1.2,1.3 CodeGen.cpp,1.1,1.2 ConnJoint.cpp,1.4,1.5 ConnJoint.h,1.3,1.4 ConnectionRep.cpp,1.3,1.4 ConnectionRep.h,1.2,1.3 Dumper.cpp,1.6,1.7 Dumper.h,1.5,1.6 FCO.cpp,1.6,1.7 FCO.h,1.6,1.7 FcoRep.cpp,1.2,1.3 FcoRep.h,1.2,1.3 FolderRep.cpp,1.5,1.6 FolderRep.h,1.2,1.3 Method.cpp,1.3,1.4 ModelRep.cpp,1.7,1.8 ModelRep.h,1.3,1.4 PointerItem.h,1.1,1.2 ReferenceRep.cpp,1.4,1.5 ReferenceRep.h,1.2,1.3 RoleRep.h,1.2,1.3 RootFolder.cpp,1.1,1.2 RootFolder.h,1.1,1.2 SetRep.cpp,1.4,1.5 SetRep.h,1.2,1.3 Sheet.cpp,1.5,1.6 Sheet.h,1.4,1.5 AspectRep.cpp,1.3,NONE AspectRep.h,1.2,NONE ConstraintFuncRep.cpp,1.2,NONE ConstraintFuncRep.h,1.2,NONE ConstraintRep.cpp,1.2,NONE ConstraintRep.h,1.2,NONE PartRep.h,1.1,NONE

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


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

Modified Files:
	Any.cpp Any.h AtomRep.cpp AtomRep.h AttributeRep.cpp 
	AttributeRep.h CodeGen.cpp ConnJoint.cpp ConnJoint.h 
	ConnectionRep.cpp ConnectionRep.h Dumper.cpp Dumper.h FCO.cpp 
	FCO.h FcoRep.cpp FcoRep.h FolderRep.cpp FolderRep.h Method.cpp 
	ModelRep.cpp ModelRep.h PointerItem.h ReferenceRep.cpp 
	ReferenceRep.h RoleRep.h RootFolder.cpp RootFolder.h 
	SetRep.cpp SetRep.h Sheet.cpp Sheet.h 
Removed Files:
	AspectRep.cpp AspectRep.h ConstraintFuncRep.cpp 
	ConstraintFuncRep.h ConstraintRep.cpp ConstraintRep.h 
	PartRep.h 
Log Message:
Spring cleaning. Removed Aspects, Constraints, Parts
Made synched with MetaInt
Registry logic changed
Bugs: 
	connection inheritance ( m_connPtr changed during appendJoint)
	ReferencePort detection changed according to metainterpreter
Modified Files:
 	BON2Component.cpp BON2Component.h BonExt.dsp Gui/SelConf.cpp 
 	Rep/Any.cpp Rep/Any.h Rep/AtomRep.cpp Rep/AtomRep.h 
 	Rep/AttributeRep.cpp Rep/AttributeRep.h Rep/CodeGen.cpp 
	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/FcoRep.cpp Rep/FcoRep.h Rep/FolderRep.cpp 
 	Rep/FolderRep.h Rep/Method.cpp Rep/ModelRep.cpp Rep/ModelRep.h 
 	Rep/PointerItem.h Rep/ReferenceRep.cpp Rep/ReferenceRep.h 
 	Rep/RoleRep.h Rep/RootFolder.cpp Rep/RootFolder.h 
 	Rep/SetRep.cpp Rep/SetRep.h Rep/Sheet.cpp Rep/Sheet.h 
Removed Files:
 	TokenEx.cpp TokenEx.h Rep/AspectRep.cpp Rep/AspectRep.h 
 	Rep/ConstraintFuncRep.cpp Rep/ConstraintFuncRep.h 
 	Rep/ConstraintRep.cpp Rep/ConstraintRep.h Rep/PartRep.h 


CVS User: zolmol

Index: Any.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Any.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Any.cpp	26 Feb 2004 17:12:46 -0000	1.4
--- Any.cpp	10 Mar 2004 02:50:18 -0000	1.5
***************
*** 5,9 ****
  
  #include "Any.h"
- #include "ConstraintRep.h"
  #include "CodeGen.h"
  
--- 5,8 ----
***************
*** 21,27 ****
  	std::string s1 = op1->getName();
  	std::string s2 = op2->getName();
! 	return ( s1.compare(s2) < 0);
  }
  
  /*static*/ const std::string Any::KIND_TYPE_STR[] =
  {
--- 20,31 ----
  	std::string s1 = op1->getName();
  	std::string s2 = op2->getName();
! 	int k = s1.compare(s2);
! 
! 	return ( k < 0);
  }
  
+ /*
+ These names must be valid BON2 class names (with the BON:: tag) so beware when changing it
+ */
  /*static*/ const std::string Any::KIND_TYPE_STR[] =
  {
***************
*** 33,37 ****
  	"FCO",
  	"ASPECT",
! 	"FOLDER",
  	"CONSTRAINT",
  	"CONSTRAINFUNC",
--- 37,41 ----
  	"FCO",
  	"ASPECT",
! 	"Folder",
  	"CONSTRAINT",
  	"CONSTRAINFUNC",
***************
*** 40,51 ****
  
  
! Any::Any( BON::FCO& ptr): 
! 		m_ptr( ptr),
! 		m_toD( true),
! 		m_globalHeader(),
! 		m_globalSource()
  {
- 	m_initialConstraintList.clear();
- 	m_finalConstraintList.clear();
  }
  
--- 44,53 ----
  
  
! Any::Any( BON::FCO& ptr)
! 		: m_ptr( ptr)
! 		, m_toEx( true)
! 		, m_globalHeader()
! 		, m_globalSource()
  {
  }
  
***************
*** 53,70 ****
  Any::~Any()
  { 
- 	m_initialConstraintList.clear();
- 	m_finalConstraintList.clear();
  }
  
  
! bool Any::isToBeD() const
  {
! 	return m_toD;
  }
  
  
! void Any::toBeD( bool t)
  {
! 	m_toD = t;
  }
  
--- 55,70 ----
  Any::~Any()
  { 
  }
  
  
! bool Any::isToBeEx() const
  {
! 	return m_toEx;
  }
  
  
! void Any::toBeEx( bool t)
  {
! 	m_toEx = t;
  }
  
***************
*** 72,82 ****
  bool Any::getAttribute( const std::string & val, bool& is_it)
  {
! 	BON::FCO bon_ptr( m_ptr);
! 	is_it = bon_ptr->getAttribute( val)->getBooleanValue();
  	return is_it;
  }
  
  
! bool Any::isFCO()
  {
  	bool fco = false;
--- 72,81 ----
  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;
***************
*** 91,138 ****
  
  
- 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
  {
  	if ( this->m_ptr)
  	{
! 		BON::FCO bon_ptr = static_cast<BON::FCO>( m_ptr);
! 		return bon_ptr->getName();
  	}
  	return "NullPtrError";
--- 90,98 ----
  
  
  std::string Any::getName() const
  {
  	if ( this->m_ptr)
  	{
! 		return m_ptr->getName();
  	}
  	return "NullPtrError";
***************
*** 144,149 ****
  	if ( this->m_ptr)
  	{
! 		BON::FCO bon_ptr = static_cast<BON::FCO>( m_ptr);
! 		return getName();// + "Ex"; mod 2/2/2004
  	}
  	return "NullPtrError";
--- 104,108 ----
  	if ( this->m_ptr)
  	{
! 		return getName();
  	}
  	return "NullPtrError";
***************
*** 157,212 ****
  
  
! std::string Any::dumpConstraints()
! {
! 	std::string mmm = "";
! 
! 	AnyLexicographicSort lex;
! 	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();
! 
! 	return mmm;
! }
! 
! std::string Any::dumpNamePosition() const
! {
! 	return "";
! }
! 
! 
! std::string Any::dumpDispName() const
! {
! 	return "";
! }
! 
! 
! std::string Any::getMyPrefix() const
  {
! 	if ( this->m_ptr)
! 	{
! 		std::string id = m_ptr->getID();
! 		std::string name = m_ptr->getName();
! 		return id + ":" + name;
! 	}
! 	throw "Error: inquiring prefix for a null object\n";
! 	return "Error\n";
  }
  
  
! BON::RegistryNode Any::getMyRegistry() const
  {
! 	if ( this->m_ptr && this->m_parentFolder)
! 	{
! 		return m_parentFolder->getRegistry()->getChild( getMyPrefix());
! 	}
! 	throw 1;
! }
! 
  
! std::string Any::askMetaRef(const std::string& token1) const
! {
! 	return "";
  }
  
--- 116,131 ----
  
  
! std::string Any::dumpMyRoles()
  {
! 	return Any::getName();
  }
  
  
! std::string Any::getMyKindStr() const
  {
! 	if ( isFCO() || getMyKind() == FOLDER)
! 		return KIND_TYPE_STR[ getMyKind()];
  
! 	throw "Error: inquireing getMyKindStr for non-fco, non-folder";
  }
  
***************
*** 272,288 ****
  
  
! void Any::dumpGlobals()
  {
! 	DMP_S( m_globalSource);
! 	DMP_H( m_globalHeader);
  }
  
  
! void Any::dumpMacros()
  {
  	std::string h, s;
  
  	h = "class " + getDispNameImpl() + ";";
! 	h += "\nDECLARE_BONEXTENSION( BON::" + getKindType() + ", " + getDispNameImpl() + ", " + getDispName()	+ " );\n";
  
  	s = "IMPLEMENT_BONEXTENSION( " + global_vars.m_namespace_name + "::" + getDispName() + ", \"" + dumpMyRoles() + "\" );\n";
--- 191,231 ----
  
  
! std::string Any::getMyPrefix() const
  {
! 	if ( this->m_ptr)
! 	{
! 		std::string kind = m_ptr->getObjectMeta().name();
! 		std::string name = m_ptr->getPath();
! 
! 		BON::ObjectPtr p = m_ptr->getObjectI();
! 		long relid = 0;
! 		COMTHROW( p->get_RelID(&relid));
! 		char t[16];
! 		sprintf( t, "%x", relid);
! 
! 		ASSERT( name.length() >= 1);
! 		std::string tmp = name.substr(1) + '-' + t + '-' + kind;
! 		
! 		return "BonExtender/" + tmp;
! 	}
! 	throw "Error: inquiring prefix for a null object\n";
  }
  
  
! BON::RegistryNode Any::getMyRegistry() const
! {
! 	if ( this->m_ptr && this->m_parentFolder)
! 		return m_parentFolder->getRegistry()->getChild( getMyPrefix());
! 
! 	throw 1;
! }
! 
! 
! void Any::prepareMacros()
  {
  	std::string h, s;
  
  	h = "class " + getDispNameImpl() + ";";
! 	h += "\nDECLARE_BONEXTENSION( BON::" + getMyKindStr() + ", " + getDispNameImpl() + ", " + getDispName()	+ " );\n";
  
  	s = "IMPLEMENT_BONEXTENSION( " + global_vars.m_namespace_name + "::" + getDispName() + ", \"" + dumpMyRoles() + "\" );\n";
***************
*** 293,328 ****
  
  
- 
  void Any::prepare()
  {
! 	dumpMacros();
! }
! 
! 
! std::string Any::dumpMyRoles()
! {
! 	return Any::getName();
  }
  
  
! std::string Any::getKindType()
  {
! 	KIND_TYPE r = getMyKind();
! 	if ( r == FCO_REP)
! 		return "FCO";
! 	if ( r == ATOM)
! 		return "Atom";
! 	if ( r == MODEL)
! 		return "Model";
! 	if ( r == CONN)
! 		return "Connection";
! 	if ( r == SET)
! 		return "Set";
! 	if ( r == REF)
! 		return "Reference";
! 	if ( r == FOLDER)
! 		return "Folder";
! 
! 	return "Error";
  }
  
--- 236,249 ----
  
  
  void Any::prepare()
  {
! 	prepareMacros();
  }
  
  
! void Any::dumpGlobals()
  {
! 	DMP_S( m_globalSource);
! 	DMP_H( m_globalHeader);
  }
  
***************
*** 358,362 ****
  	// to prevent confusing with predefinitions like "class X;"
  	// the canonical form is "class X :"
! 	return " :\n  public /*Ex*/ BON::" + getKindType() + "Impl\n";
  }
  
--- 279,283 ----
  	// to prevent confusing with predefinitions like "class X;"
  	// the canonical form is "class X :"
! 	return " :\n  public /*Ex*/ BON::" + getMyKindStr() + "Impl\n";
  }
  

Index: Any.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Any.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Any.h	26 Feb 2004 17:12:46 -0000	1.3
--- Any.h	10 Mar 2004 02:50:18 -0000	1.4
***************
*** 12,16 ****
  /** This class is the abstract base of all kinds of parts/FCOs that can occur during a modeling process. */
  class Any;
- class ConstraintRep;
  
  class AnyLexicographicSort
--- 12,15 ----
***************
*** 53,59 ****
  		};*/
  
- 	typedef std::vector< ConstraintRep* > ConstraintRepPtrList;
- 	typedef std::vector< ConstraintRep* >::const_iterator ConstraintRepPtrList_ConstIterator;
- 
  public:
  	Any( BON::FCO& ptr);
--- 52,55 ----
***************
*** 62,72 ****
  public:	
  	virtual KIND_TYPE getMyKind() const = 0;
  	virtual std::string doDump() = 0;
  	virtual std::string getName() const;
  	virtual std::string getDispName() const;
- 	virtual std::string dumpDispName() const;
  
- 	std::string dumpNamePosition() const;
- 	std::string dumpConstraints();
  
  	BON::FCO getPtr() const { return m_ptr; }
--- 58,66 ----
  public:	
  	virtual KIND_TYPE getMyKind() const = 0;
+ 	std::string getMyKindStr() const;
  	virtual std::string doDump() = 0;
  	virtual std::string getName() const;
  	virtual std::string getDispName() const;
  
  
  	BON::FCO getPtr() const { return m_ptr; }
***************
*** 78,99 ****
  	std::string getMyPrefix() const;
  	BON::RegistryNode getMyRegistry() const;
! 
! 	bool isFCO();
! 	std::string askMetaRef(const std::string & tok) const;
! 
! 	// constraints
! 	void addInitialConstraintRep( ConstraintRep * );
! 	const ConstraintRepPtrList& getInitialConstraintRepPtrList() const;
! 	void addFinalConstraint( ConstraintRep * constraint);
! 	void addFinalConstraintList( const ConstraintRepPtrList & list);
  
  	static void convertToValidName( std::string & p);
  	static bool checkIfValidName( const std::string & p);
  
- 	void dumpGlobals();
  	virtual void prepare();
! 	virtual void dumpMacros();
  
! 	std::string getKindType();
  	std::string dumpMyRoles();
  	std::string dumpOrnament( bool is_abstract = false);
--- 72,84 ----
  	std::string getMyPrefix() const;
  	BON::RegistryNode getMyRegistry() const;
! 	bool isFCO() const;
  
  	static void convertToValidName( std::string & p);
  	static bool checkIfValidName( const std::string & p);
  
  	virtual void prepare();
! 	virtual void prepareMacros();
  
! 	void dumpGlobals();
  	std::string dumpMyRoles();
  	std::string dumpOrnament( bool is_abstract = false);
***************
*** 106,111 ****
  	std::string getUserPart();
  
! 	bool isToBeD() const;
! 	void toBeD( bool t);
  
  public:
--- 91,96 ----
  	std::string getUserPart();
  
! 	bool isToBeEx() const;
! 	void toBeEx( bool t);
  
  public:
***************
*** 120,129 ****
  	BON::Folder m_parentFolder;
  
! 	// indicates if it is to be dumped or not
! 	bool m_toD;
! 
! 	// initial and final constraints
! 	ConstraintRepPtrList m_initialConstraintList;
! 	ConstraintRepPtrList m_finalConstraintList;
  
  	std::string m_globalHeader;
--- 105,110 ----
  	BON::Folder m_parentFolder;
  
! 	// indicates if it is to be extended or not
! 	bool m_toEx;
  
  	std::string m_globalHeader;

Index: AtomRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/AtomRep.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AtomRep.cpp	26 Feb 2004 17:12:46 -0000	1.2
--- AtomRep.cpp	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 6,11 ****
  #include "AtomRep.h"
  #include "logger.h"
- #include "ConstraintRep.h"
- #include "ConstraintFuncRep.h"
  
  AtomRep::AtomRep( BON::FCO& ptr): FCO( ptr)
--- 6,9 ----

Index: AtomRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/AtomRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AtomRep.h	26 Feb 2004 17:12:46 -0000	1.2
--- AtomRep.h	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 12,16 ****
  	inline Any::KIND_TYPE getMyKind() const { return Any::ATOM; }
  	std::string doDump();
- 	/*std::string hideAndExpose();*/
  
  private: // forbiding copy
--- 12,15 ----

Index: AttributeRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/AttributeRep.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AttributeRep.cpp	26 Feb 2004 17:12:46 -0000	1.4
--- AttributeRep.cpp	10 Mar 2004 02:50:18 -0000	1.5
***************
*** 69,83 ****
  
  
- std::string AttributeRep::getMetaRef(const std::string & owner)
- {
- 	std::string m_ref;
- 	std::string token = "MetaRef";
- 	if (!owner.empty()) token += "/" + owner;
- 	m_ref = askMetaRef(token);
- 
- 	return m_ref;
- }
- 
- 
  void AttributeRep::getXY( unsigned int * x, unsigned int * y) const
  {
--- 69,72 ----
***************
*** 228,255 ****
  
  
- std::string EnumAttributeRep::doDumpAttr(const std::string& owner)
- {
- 	if (m_noOfItems == 0) getMenuItems();
- 	std::string mmm = "";
- 
- 	std::string m_ref = getMetaRef( owner);
- 	mmm += indStr() + "<attrdef name=\"" + getName() + "\" metaref = \"" + m_ref +"\" valuetype = \"enum\" defvalue = \"";
- 	mmm += m_itemsVal[m_noOfDefault];
- 	mmm += "\">\n";
- 	
- 	++ind;
- 	mmm += indStr() + "<dispname>" + getPrompt() + "</dispname>\n";
- 	for(int i = 0; i < m_noOfItems; ++i)
- 	{
- 		mmm+= indStr() + "<enumitem dispname = \"" + m_items[i] + "\" value = \"" + m_itemsVal[i] + "\"></enumitem>\n";
- 	}
- 
- 	mmm += dumpHelp();
- 
- 	--ind;
- 	mmm += indStr() + "</attrdef>\n";
- 	return mmm;
- }
- 
  // obsolete -> really? question asked on 2/2/2004
  /*static*/ std::string EnumAttributeRep::enumTypeName( EnumAttributeRep * a)
--- 217,220 ----
***************
*** 309,313 ****
  
  	src = CodeGen::indent(0) + "{\n";
! 	src += CodeGen::indent(1) + "std::string val = getAttribute(\"" + getName() + "\")->getStringValue();\n";
  	for( i = 0; i < m_noOfItems; ++i)
  	{
--- 274,278 ----
  
  	src = CodeGen::indent(0) + "{\n";
! 	src += CodeGen::indent(1) + "std::string val = FCOImpl::getAttribute(\"" + getName() + "\")->getStringValue();\n";
  	for( i = 0; i < m_noOfItems; ++i)
  	{
***************
*** 362,390 ****
  }
  
- std::string BoolAttributeRep::doDumpAttr(const std::string& owner)
- {
- 	std::string mmm = "";
- 	bool on;
- 	BON::FCO bon_ptr = static_cast<BON::FCO>(this->m_ptr);
- 	on = bon_ptr->getAttribute("BooleanDefault")->getBooleanValue();
- 
- 	std::string m_ref = getMetaRef( owner);
- 
- 	mmm += indStr() + "<attrdef name=\"" + getName() + "\" metaref = \"" + m_ref + "\" valuetype = \"boolean\" defvalue = \"";
- 	if (on) mmm += "true";
- 	else mmm +="false";
- 	mmm += "\">\n";
- 	
- 	++ind;
- 	mmm += indStr() + "<dispname>" + getPrompt() + "</dispname>\n";
- 
- 	mmm += dumpHelp();
- 
- 	--ind;
- 	mmm += indStr() + "</attrdef>\n";
- 	return mmm;
- }
- 
- 
  /*virtual*/ std::string BoolAttributeRep::getMethodName()
  {
--- 327,330 ----
***************
*** 407,411 ****
  	//src =  "/*virtual*/ bool " + container->getNameImpl() + "::" + getMethodName() + "()\n";
  	src  = CodeGen::indent(0) + "{\n";
! 	src += CodeGen::indent(1) +   "return getAttribute(\"" + getName() + "\")->getBooleanValue();\n";
  	src += CodeGen::indent(0) + "}\n\n\n";
  
--- 347,351 ----
  	//src =  "/*virtual*/ bool " + container->getNameImpl() + "::" + getMethodName() + "()\n";
  	src  = CodeGen::indent(0) + "{\n";
! 	src += CodeGen::indent(1) +   "return FCOImpl::getAttribute(\"" + getName() + "\")->getBooleanValue();\n";
  	src += CodeGen::indent(0) + "}\n\n\n";
  
***************
*** 434,467 ****
  }
  
- std::string FieldAttributeRep::doDumpAttr(const std::string& owner)
- {
- 	std::string mmm = "";
- 	BON::FCO bon_ptr = static_cast<BON::FCO>(this->m_ptr);
- 
- 	std::string val_type = bon_ptr->getAttribute("DataType")->getStringValue();
- 	std::string def_val = bon_ptr->getAttribute("FieldDefault")->getStringValue();
- 	int multiline = bon_ptr->getAttribute("Multiline")->getIntegerValue();
- 
- 	std::string m_ref = getMetaRef( owner);
- 
- 	mmm += indStr() + "<attrdef name=\"" + getName() + "\" metaref = \"" + m_ref + "\" valuetype = \"" + val_type + "\" defvalue = \"" + def_val + "\">\n";
- 	
- 	++ind;
- 	mmm += indStr() + "<dispname>" + getPrompt() + "</dispname>\n";
- 	if( multiline > 1)
- 	{
- 		char mul[10];
- 		sprintf(mul, "%i", multiline);
- 		mmm += indStr() + "<regnode name=\"multiLine\" value = \"" + mul + "\"></regnode>\n";
- 	}
- 
- 	mmm += dumpHelp();
- 
- 	--ind;
- 	mmm += indStr() + "</attrdef>\n";
- 	return mmm;
- }
- 
- 
  /*virtual*/ std::string FieldAttributeRep::getMethodName()
  {
--- 374,377 ----
***************
*** 516,520 ****
  	//src =  "/*virtual*/ " + getTypeStr() + " " + container->getNameImpl() + "::" + getMethodName() + "()\n";
  	src  = CodeGen::indent(0) + "{\n";
! 	src += CodeGen::indent(1) +   "return getAttribute(\"" + getName() + "\")->get" + getMethodStr() + "Value();\n";
  	src += CodeGen::indent(0) + "}\n\n\n";
  
--- 426,430 ----
  	//src =  "/*virtual*/ " + getTypeStr() + " " + container->getNameImpl() + "::" + getMethodName() + "()\n";
  	src  = CodeGen::indent(0) + "{\n";
! 	src += CodeGen::indent(1) +   "return FCOImpl::getAttribute(\"" + getName() + "\")->get" + getMethodStr() + "Value();\n";
  	src += CodeGen::indent(0) + "}\n\n\n";
  

Index: AttributeRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/AttributeRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AttributeRep.h	26 Feb 2004 17:12:46 -0000	1.2
--- AttributeRep.h	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 20,30 ****
  	/*virtual*/ inline Any::KIND_TYPE  getMyKind() const { return Any::ATTRIBUTE; }
  	/*virtual*/ std::string doDump() { return ""; }
- 	//virtual std::string doDumpAttrHdr() = 0;
- 	//virtual std::string doDumpAttrSrc( FCO* ) = 0;
  	virtual Method createMethodForAttr( FCO* ) = 0;
  	virtual std::string doDumpErroneousAttrHdr() = 0;
  	virtual std::string doDumpErroneousAttrSrc( FCO*) = 0;
  
- 	virtual std::string doDumpAttr(const std::string& mm = "") = 0;
  	virtual ATTR_TYPE getType() = 0;
  
--- 20,27 ----
***************
*** 34,38 ****
  	std::string getNameToUse();
  	virtual std::string getMethodName() = 0;
- 	std::string getMetaRef(const std::string & owner);
  	std::string dumpHelp();
  	void getXY( unsigned int * x, unsigned int *y) const;
--- 31,34 ----
***************
*** 59,65 ****
  	ATTR_TYPE getType() { return ENUM; }
  	bool getMenuItems();
- 	/*virtual*/ std::string doDumpAttr(const std::string& mm = "");
- 	///*virtual*/ std::string doDumpAttrHdr();
- 	///*virtual*/ std::string doDumpAttrSrc( FCO*);
  	/*virtual*/ std::string doDumpErroneousAttrHdr();
  	/*virtual*/ std::string doDumpErroneousAttrSrc( FCO*);
--- 55,58 ----
***************
*** 80,86 ****
  	virtual ~BoolAttributeRep() { }
  	ATTR_TYPE getType() { return BOOL; }
- 	/*virtual*/ std::string doDumpAttr(const std::string& mm = "");
- 	///*virtual*/ std::string doDumpAttrHdr();
- 	///*virtual*/ std::string doDumpAttrSrc( FCO*);
  	/*virtual*/ std::string doDumpErroneousAttrHdr();
  	/*virtual*/ std::string doDumpErroneousAttrSrc( FCO*);
--- 73,76 ----
***************
*** 95,101 ****
  	virtual ~FieldAttributeRep() { }
  	ATTR_TYPE getType() { return FIELD; }
- 	/*virtual*/ std::string doDumpAttr(const std::string& mm = "");
- 	///*virtual*/ std::string doDumpAttrHdr();
- 	///*virtual*/ std::string doDumpAttrSrc( FCO*);
  	/*virtual*/ std::string doDumpErroneousAttrHdr();
  	/*virtual*/ std::string doDumpErroneousAttrSrc( FCO*);
--- 85,88 ----

Index: CodeGen.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/CodeGen.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CodeGen.cpp	26 Feb 2004 17:12:46 -0000	1.1
--- CodeGen.cpp	10 Mar 2004 02:50:18 -0000	1.2
***************
*** 4,13 ****
  /*static*/ std::string CodeGen::indent( int tabs /* = 0*/)
  {
! 	std::string res;
! 	for( int i = 0; i < tabs; ++i)
! 	{
! 		res += '\t';
! 	}
! 	return res;
  }
  
--- 4,8 ----
  /*static*/ std::string CodeGen::indent( int tabs /* = 0*/)
  {
! 	return std::string( (unsigned) tabs, '\t');
  }
  
***************
*** 15,24 ****
  /*static*/ std::string CodeGen::fill( int fill /* = 1*/)
  {
! 	std::string res;
! 	for( int i = 0; i < fill; ++i)
! 	{
! 		res += " ";
! 	}
! 	return res;
  }
  
--- 10,14 ----
  /*static*/ std::string CodeGen::fill( int fill /* = 1*/)
  {
! 	return std::string( (unsigned) fill, ' ');
  }
  
***************
*** 33,37 ****
  	std::string retval_folderkind, folderkind;
  	retval_folderkind = folderkind = sub->getDispName();
! 	if ( !sub->isToBeD())
  		retval_folderkind = "BON::Folder";
  
--- 23,27 ----
  	std::string retval_folderkind, folderkind;
  	retval_folderkind = folderkind = sub->getDispName();
! 	if ( !sub->isToBeEx())
  		retval_folderkind = "BON::Folder";
  
***************
*** 40,44 ****
  	//src = orn + "// getter for kind \"" + fco->getName() + "\"\n" + orn;
   	//src += "std::set<" + fco->getName() + "> " + cont->getNameImpl() + "::" + method_name + "()\n";
- 	comm = "// getter for kind \"" + sub->getName() + "\"";
  	src  = indent(0) + "{\n";
  	src += indent(1) +   "std::set<" + retval_folderkind + "> res;\n";
--- 30,33 ----
***************
*** 47,51 ****
  	src += indent(1) +   "{\n";
  	src += indent(2) +     retval_folderkind + " elem(*i);\n";
! 	if ( sub->isToBeD())
  		src += indent(2) +   "if (elem)\n";
  	else
--- 36,40 ----
  	src += indent(1) +   "{\n";
  	src += indent(2) +     retval_folderkind + " elem(*i);\n";
! 	if ( sub->isToBeEx())
  		src += indent(2) +   "if (elem)\n";
  	else
***************
*** 56,59 ****
--- 45,49 ----
  	src += indent(0) + "}\n\n\n";
  
+ 	comm = "// getter for kind \"" + sub->getName() + "\"";
  
  	Method m;
***************
*** 71,80 ****
  /*static*/ void CodeGen::dumpKindGetter( FCO* fco, FolderRep * cont)
  {
! 	std::string method_name = ModelRep::kindGetterMethodName( fco);
  	
  	std::string retval_kind, kind;
  	retval_kind = kind = fco->getDispName();
  
! 	if (!fco->isToBeD())
  		retval_kind = "BON::FCO";
  
--- 61,70 ----
  /*static*/ void CodeGen::dumpKindGetter( FCO* fco, FolderRep * cont)
  {
! 	std::string method_name = FolderRep::kindGetterMethodName( fco);
  	
  	std::string retval_kind, kind;
  	retval_kind = kind = fco->getDispName();
  
! 	if (!fco->isToBeEx())
  		retval_kind = "BON::FCO";
  
***************
*** 90,96 ****
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
! 			src += indent(1) +   "std::set<BON::Object> l = getChildObjects";
  			src +=               "(\"" + kind + "\");\n";
! 			src += indent(1) +   "for( std::set<BON::Object>::iterator i = l.begin(); i != l.end(); ++i)\n";
  			src += indent(1) +   "{\n";
  			src += indent(2) +     retval_kind + " elem(*i);\n";
--- 80,86 ----
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
! 			src += indent(1) +   "std::set<BON::Object> kinds = getChildObjects";
  			src +=               "(\"" + kind + "\");\n";
! 			src += indent(1) +   "for( std::set<BON::Object>::iterator i = kinds.begin(); i != kinds.end(); ++i)\n";
  			src += indent(1) +   "{\n";
  			src += indent(2) +     retval_kind + " elem(*i);\n";
***************
*** 130,138 ****
  			char len_s[10]; sprintf(len_s, "%i", len); std::string len_str( len_s);
  			
- 			comm = "// getter for kind \"" + kind + "\" and its desc's";
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
  			src += indent(1) +   "const int len = " + len_str + ";\n";
! 			src += indent(1) +   "std::set<BON::Object> l[ len];\n";
  			
  			for( int k = 0; k < r.size(); ++k)
--- 120,127 ----
  			char len_s[10]; sprintf(len_s, "%i", len); std::string len_str( len_s);
  			
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
  			src += indent(1) +   "const int len = " + len_str + ";\n";
! 			src += indent(1) +   "std::set<BON::Object> kinds_vec[ len];\n";
  			
  			for( int k = 0; k < r.size(); ++k)
***************
*** 141,150 ****
  				{
  					char k_s[10]; sprintf( k_s, "%i", k); std::string k_str( k_s);
! 					src += indent(1) + "l[" + k_str + "] = getChildObjects";
  					src += "(\"" + r[k]->getName() + "\");\n";
  				}
  			}
! 			src += indent(1) + "for( int j = 0; j < len; ++j)\n";
! 			src += indent(2) +   "for( std::set<BON::Object>::iterator i = l[j].begin(); i != l[j].end(); ++i)\n";
  			src += indent(2) +   "{\n";
  			src += indent(3) +     retval_kind + " elem(*i);\n";
--- 130,139 ----
  				{
  					char k_s[10]; sprintf( k_s, "%i", k); std::string k_str( k_s);
! 					src += indent(1) + "kinds_vec[" + k_str + "] = getChildObjects";
  					src += "(\"" + r[k]->getName() + "\");\n";
  				}
  			}
! 			src += indent(1) + "for( int k = 0; k < len; ++k)\n";
! 			src += indent(2) +   "for( std::set<BON::Object>::iterator i = kinds_vec[k].begin(); i != kinds_vec[k].end(); ++i)\n";
  			src += indent(2) +   "{\n";
  			src += indent(3) +     retval_kind + " elem(*i);\n";
***************
*** 155,158 ****
--- 144,149 ----
  			src += indent(0) + "}\n\n\n";	
  
+ 			comm = "// aggregated getter for kind \"" + kind + "\" and its descendants";
+ 
  			Method m;
  			m.m_container = cont;
***************
*** 227,240 ****
  			std::string inquire = role->getSmartRoleName();
  			std::string retval_kind = fco->getDispName();
! 			if ( !fco->isToBeD())
! 				retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
! 
! 			comm =  "getter for role \"" + role->getOnlyRoleName() + "\" among " + fco->getName() + "";
  
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
! 			src += indent(1) +   "std::set<BON::FCO> l = getChildFCOsAs";
  			src +=             "(\"" + inquire + "\");\n";
! 			src += indent(1) +   "for( std::set<BON::FCO>::iterator i = l.begin(); i != l.end(); ++i)\n";
  			src += indent(1) +   "{\n";
  			src += indent(2) +       retval_kind + " elem(*i);\n";
--- 218,235 ----
  			std::string inquire = role->getSmartRoleName();
  			std::string retval_kind = fco->getDispName();
! 			if ( !fco->isToBeEx())
! 			{
! 				FCO * ext_anc = fco->getExtedAnc();
! 				if ( ext_anc)
! 					retval_kind = ext_anc->getDispName();
! 				else
! 					retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
! 			}
  
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
! 			src += indent(1) +   "std::set<BON::FCO> roles = getChildFCOsAs";
  			src +=             "(\"" + inquire + "\");\n";
! 			src += indent(1) +   "for( std::set<BON::FCO>::iterator i = roles.begin(); i != roles.end(); ++i)\n";
  			src += indent(1) +   "{\n";
  			src += indent(2) +       retval_kind + " elem(*i);\n";
***************
*** 245,248 ****
--- 240,245 ----
  			src += indent(0) + "}\n\n\n";
  
+ 			comm =  "getter for role \"" + inquire + "\" among \"" + fco->getName() + "\"s";
+ 
  			Method m;
  			m.m_container = cont;
***************
*** 287,292 ****
  
  			std::string retval_kind = desc[k]->getDispName();
! 			if( !desc[k]->isToBeD())
! 				retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
  
  			// there is only one non-abstract, meaning that short role name must be used
--- 284,295 ----
  
  			std::string retval_kind = desc[k]->getDispName();
! 			if( !desc[k]->isToBeEx())
! 			{
! 				FCO * ext_anc = desc[k]->getExtedAnc();
! 				if ( ext_anc)
! 					retval_kind = ext_anc->getDispName();
! 				else
! 					retval_kind = "BON::" + Any::KIND_TYPE_STR[desc[k]->getMyKind()];
! 			}
  
  			// there is only one non-abstract, meaning that short role name must be used
***************
*** 295,305 ****
  			std::string inquire = role->getOnlyRoleName().empty()?desc[k]->getName():role->getOnlyRoleName();
  
- 			comm =  "getter for role \"" + inquire + "\" among " + fco->getName() + "";
- 
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
! 			src += indent(1) +   "std::set<BON::FCO> l = getChildFCOsAs";
  			src +=               "(\"" + inquire + "\");\n";
! 			src += indent(1) +   "for( std::set<BON::FCO>::iterator i = l.begin(); i != l.end(); ++i)\n";
  			src += indent(1) +   "{\n";
  			src += indent(2) +      retval_kind + " elem(*i);\n";
--- 298,306 ----
  			std::string inquire = role->getOnlyRoleName().empty()?desc[k]->getName():role->getOnlyRoleName();
  
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
! 			src += indent(1) +   "std::set<BON::FCO> roles = getChildFCOsAs";
  			src +=               "(\"" + inquire + "\");\n";
! 			src += indent(1) +   "for( std::set<BON::FCO>::iterator i = roles.begin(); i != roles.end(); ++i)\n";
  			src += indent(1) +   "{\n";
  			src += indent(2) +      retval_kind + " elem(*i);\n";
***************
*** 310,313 ****
--- 311,316 ----
  			src += indent(0) + "}\n\n\n";
  
+ 			comm =  "getter for role \"" + inquire + "\" among \"" + fco->getName() + "\"s";
+ 
  			Method m;
  			m.m_container = cont;
***************
*** 328,333 ****
  
  			std::string retval_kind = fco->getDispName();
! 			if ( !fco->isToBeD())
! 				retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
  
  			int len = count;
--- 331,342 ----
  
  			std::string retval_kind = fco->getDispName();
! 			if ( !fco->isToBeEx())
! 			{
! 				FCO * ext_anc = fco->getExtedAnc();
! 				if ( ext_anc)
! 					retval_kind = ext_anc->getDispName();
! 				else
! 					retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
! 			}
  
  			int len = count;
***************
*** 338,349 ****
  			//                          - contained fco (the role owner) is not abstract
  			if (role->getOnlyRoleName().empty() && !role->getFCOPtr()->isAbstract())
! 				in_case_of_name_conflict_str = "int dummy"; // differentiate two methods with adding to the second a dummy parameter
  			
- 			comm = "aggregated getter for role \"" + role->getOnlyRoleName() + "\" among " + fco->getName() + " and its desc's";
- 
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
  			src += indent(1) +   "const int len = " + len_str + ";\n";
! 			src += indent(1) +   "std::set<BON::FCO> l[ len];\n";
  			
  			int index = 0; // this is used in the cycle
--- 347,356 ----
  			//                          - contained fco (the role owner) is not abstract
  			if (role->getOnlyRoleName().empty() && !role->getFCOPtr()->isAbstract())
! 				in_case_of_name_conflict_str = "int dummy"; // differentiate two methods with adding to the second method a dummy parameter
  			
  			src  = indent(0) + "{\n";
  			src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
  			src += indent(1) +   "const int len = " + len_str + ";\n";
! 			src += indent(1) +   "std::set<BON::FCO> roles_vec[ len];\n";
  			
  			int index = 0; // this is used in the cycle
***************
*** 353,357 ****
  				{
  					char index_s[10]; sprintf( index_s, "%i", index); std::string index_str( index_s);
! 					src += indent(1) + "l[" + index_str + "] = getChildFCOsAs";
  					src += "(\"";
  					// mod on 2/2/2004
--- 360,364 ----
  				{
  					char index_s[10]; sprintf( index_s, "%i", index); std::string index_str( index_s);
! 					src += indent(1) + "roles_vec[" + index_str + "] = getChildFCOsAs";
  					src += "(\"";
  					// mod on 2/2/2004
***************
*** 362,367 ****
  				}
  			}
! 			src += indent(1) + "for( int j = 0; j < len; ++j)\n";
! 			src += indent(2) +   "for( std::set<BON::FCO>::iterator i = l[j].begin(); i != l[j].end(); ++i)\n";
  			src += indent(2) +   "{\n";
  			src += indent(3) +      retval_kind + " elem(*i);\n";
--- 369,374 ----
  				}
  			}
! 			src += indent(1) + "for( int k = 0; k < len; ++k)\n";
! 			src += indent(2) +   "for( std::set<BON::FCO>::iterator i = roles_vec[k].begin(); i != roles_vec[k].end(); ++i)\n";
  			src += indent(2) +   "{\n";
  			src += indent(3) +      retval_kind + " elem(*i);\n";
***************
*** 372,375 ****
--- 379,384 ----
  			src += indent(0) + "}\n\n\n";	
  
+ 			comm = "aggregated getter for role \"" + role->getOnlyRoleName() + "\" among \"" + fco->getName() + "\"s and its descendants";
+ 
  			Method m;
  			m.m_container = cont;
***************
*** 390,406 ****
  					method_name = ModelRep::roleGetterMethodName3( desc[k], role, false);// separate long form name for each 
  
- 					comm = "getter for role \"" + desc[k]->getName() + role->getOnlyRoleName() + "\" among " + fco->getName() + " and its desc's";
  
  					std::string retval_kind = desc[k]->getDispName();
! 					if ( !desc[k]->isToBeD())
! 						retval_kind = "BON::" + Any::KIND_TYPE_STR[ desc[k]->getMyKind()];
  
  					src  = indent(0) + "{\n";
  					src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
! 					src += indent(1) +   "std::set<BON::FCO> l = getChildFCOsAs";
  					src += "(\"";
  					src += desc[k]->getName() + role->getOnlyRoleName();
  					src += "\");\n";
! 					src += indent(1) +   "for( std::set<BON::FCO>::iterator i = l.begin(); i != l.end(); ++i)\n";
  					src += indent(1) +   "{\n";
  					src += indent(2) +     retval_kind + " elem(*i);\n";
--- 399,420 ----
  					method_name = ModelRep::roleGetterMethodName3( desc[k], role, false);// separate long form name for each 
  
  
  					std::string retval_kind = desc[k]->getDispName();
! 					if ( !desc[k]->isToBeEx())
! 					{
! 						FCO * ext_anc = desc[k]->getExtedAnc();
! 						if ( ext_anc)
! 							retval_kind = ext_anc->getDispName();
! 						else
! 							retval_kind = "BON::" + Any::KIND_TYPE_STR[ desc[k]->getMyKind()];
! 					}
  
  					src  = indent(0) + "{\n";
  					src += indent(1) +   "std::set<" + retval_kind + "> res;\n";
! 					src += indent(1) +   "std::set<BON::FCO> roles = getChildFCOsAs";
  					src += "(\"";
  					src += desc[k]->getName() + role->getOnlyRoleName();
  					src += "\");\n";
! 					src += indent(1) +   "for( std::set<BON::FCO>::iterator i = roles.begin(); i != roles.end(); ++i)\n";
  					src += indent(1) +   "{\n";
  					src += indent(2) +     retval_kind + " elem(*i);\n";
***************
*** 411,414 ****
--- 425,430 ----
  					src += indent(0) + "}\n\n\n";
  
+ 					comm = "getter for role \"" + desc[k]->getName() + role->getOnlyRoleName() + "\" among \"" + fco->getName() + "\"s and its descendants";
+ 
  					Method m;
  					m.m_container = cont;
***************
*** 422,426 ****
  				}
  			}
- 
  		}
  	}
--- 438,441 ----
***************
*** 439,443 ****
  	std::string retval_kind, kind; // the return value cannot be "Compound" if Compound is not extended
  	retval_kind = kind = fco->getDispName();
! 	if ( !fco->isToBeD()) retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
    std::string mmm;
    mmm  = indent(0) + "{\n";
--- 454,465 ----
  	std::string retval_kind, kind; // the return value cannot be "Compound" if Compound is not extended
  	retval_kind = kind = fco->getDispName();
! 	if ( !fco->isToBeEx()) 
! 	{
! 		FCO * ext_anc = fco->getExtedAnc();
! 		if ( ext_anc)
! 			retval_kind = ext_anc->getDispName();
! 		else
! 			retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
! 	}
    std::string mmm;
    mmm  = indent(0) + "{\n";
***************
*** 448,452 ****
    mmm += indent(1) +   "{\n";
    mmm += indent(2) +     retval_kind + " r( *elem);\n";
!   if( fco->isToBeD())
  		mmm += indent(2) +   "if ( r)\n";
  	else
--- 470,474 ----
    mmm += indent(1) +   "{\n";
    mmm += indent(2) +     retval_kind + " r( *elem);\n";
!   if( fco->isToBeEx() || fco->getExtedAnc())
  		mmm += indent(2) +   "if ( r)\n";
  	else
***************
*** 480,485 ****
  	{
  		retval_kind = kind = fco->getDispName();
! 		if ( !fco->isToBeD())
! 			retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
  	}
  	else
--- 502,513 ----
  	{
  		retval_kind = kind = fco->getDispName();
! 		if ( !fco->isToBeEx())
! 		{
! 			FCO * ext_anc = fco->getExtedAnc();
! 			if ( ext_anc)
! 				retval_kind = ext_anc->getDispName();
! 			else
! 				retval_kind = "BON::" + Any::KIND_TYPE_STR[fco->getMyKind()];
! 		}
  	}
  	else
***************
*** 758,763 ****
  	Method m;
  	std::string oper1_lcd;
! 	if (fco)
  		oper1_lcd = fco->getDispName();
  	else
  		oper1_lcd = "BON::FCO";
--- 786,793 ----
  	Method m;
  	std::string oper1_lcd;
! 	if (fco && fco->isToBeEx())
  		oper1_lcd = fco->getDispName();
+ 	else if ( fco && fco->getExtedAnc())
+ 		oper1_lcd = fco->getExtedAnc()->getDispName();
  	else
  		oper1_lcd = "BON::FCO";
***************
*** 765,769 ****
  	std::string mmm, nnn;
  
! 	if ( fco_may_be_refport || fco && !fco->isToBeD()) // if fco = 0 
  	{
  		nnn  = indent(0) + "{\n";
--- 795,799 ----
  	std::string mmm, nnn;
  
! 	if ( fco_may_be_refport || fco && !fco->isToBeEx()) // if fco = 0 
  	{
  		nnn  = indent(0) + "{\n";
***************
*** 803,808 ****
  	Method m;
  	std::string oper2_lcd;
! 	if (fco)
  		oper2_lcd = fco->getDispName();
  	else
  		oper2_lcd = "BON::FCO";
--- 833,840 ----
  	Method m;
  	std::string oper2_lcd;
! 	if (fco && fco->isToBeEx())
  		oper2_lcd = fco->getDispName();
+ 	else if ( fco && fco->getExtedAnc())
+ 		oper2_lcd = fco->getExtedAnc()->getDispName();
  	else
  		oper2_lcd = "BON::FCO";
***************
*** 810,814 ****
  	std::string mmm, nnn;
  
! 	if ( fco_may_be_refport || fco && !fco->isToBeD())
  	{
  		nnn  = indent(0) + "{\n";
--- 842,846 ----
  	std::string mmm, nnn;
  
! 	if ( fco_may_be_refport || fco && !fco->isToBeEx())
  	{
  		nnn  = indent(0) + "{\n";

Index: ConnJoint.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/ConnJoint.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ConnJoint.cpp	26 Feb 2004 17:12:46 -0000	1.4
--- ConnJoint.cpp	10 Mar 2004 02:50:18 -0000	1.5
***************
*** 10,14 ****
  #include "ModelRep.h"
  #include "ReferenceRep.h"
- #include "ConstraintRep.h"
  #include "Dumper.h"
  #include "CodeGen.h"
--- 10,13 ----
***************
*** 32,75 ****
  		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_srcLCD(),
! 		m_dstLCD(),
  
! 		m_oper1IsAnyReferencePort( false),
! 		m_oper2IsAnyReferencePort( false)
  { }
  
  
! 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),
! 		
! 	m_srcLCD( peer.m_srcLCD),
! 	m_dstLCD( peer.m_dstLCD),
! 
! 	m_oper1IsAnyReferencePort( peer.m_oper1IsAnyReferencePort),
! 	m_oper2IsAnyReferencePort( peer.m_oper2IsAnyReferencePort)
  { }
  
--- 31,74 ----
  		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_srcLCD()
! 	, m_dstLCD()
! 	
! 	, m_oper1IsAnyReferencePort( false)
! 	, m_oper2IsAnyReferencePort( false)
  { }
  
  
! 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)
! 	
! 	, m_srcLCD( peer.m_srcLCD)
! 	, m_dstLCD( peer.m_dstLCD)
! 	
! 	, m_oper1IsAnyReferencePort( peer.m_oper1IsAnyReferencePort)
! 	, m_oper2IsAnyReferencePort( peer.m_oper2IsAnyReferencePort)
  { }
  
***************
*** 103,106 ****
--- 102,107 ----
  ConnJoint::~ConnJoint() 
  {
+ 	m_connPtr = 0;
+ 
  	m_oper1.clear();
  	m_oper2.clear();
***************
*** 114,117 ****
--- 115,125 ----
  
  
+ // 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; }
***************
*** 178,191 ****
  then the C has to be extended with the M4 A1, M5 A1, M6 A1 targets
  */
- 
  void ConnJoint::intInherit( ModelRep * mod_ptr)
  {
  	const int number_of_endpoints = 2;
  	bool reference_ports_also[ number_of_endpoints] = { false, false }; 
  
! 	std::string mod_name = mod_ptr->getName(); //t
! 	TargetMap * target_map[] = { &m_oper1TargetMap, &m_oper2TargetMap };
! 	
! 	// prev. version: std::vector<ModelRep*> inner_models = mod_ptr->getInnerModelsFinal();
  
  	std::vector<ModelRep*> inner_models1 = mod_ptr->getInnerModelsFinal();
--- 186,198 ----
  then the C has to be extended with the M4 A1, M5 A1, M6 A1 targets
  */
  void ConnJoint::intInherit( ModelRep * mod_ptr)
  {
+ 	std::string con_name = m_connPtr->getName(); //t
+ 	std::string mod_name = mod_ptr->getName(); //t
+ 
  	const int number_of_endpoints = 2;
  	bool reference_ports_also[ number_of_endpoints] = { false, false }; 
  
! 	TargetMap * target_map[ number_of_endpoints] = { &m_oper1TargetMap, &m_oper2TargetMap };
  
  	std::vector<ModelRep*> inner_models1 = mod_ptr->getInnerModelsFinal();
***************
*** 198,207 ****
  	for( ; model_ref_it != inner_modelreferences.end(); ++model_ref_it)
  	{
! 		const ModelRep * c_mod_ptr = (*model_ref_it)->getModelRef();
! 		inner_models.push_back( c_mod_ptr);
  	}
  	// 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 < number_of_endpoints; ++i)
--- 205,224 ----
  	for( ; model_ref_it != inner_modelreferences.end(); ++model_ref_it)
  	{
! 		std::string m_r_n = (*model_ref_it)->getName();//t
! 
! 		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();
! 		for( ; ref_model_it != models_ref_refers.end(); ++ref_model_it)
! 		{
! 			std::string r_m_n = (*ref_model_it)->getName();
! 			if ( std::find( inner_models.begin(), inner_models.end(), *ref_model_it) == inner_models.end())
! 				inner_models.push_back( *ref_model_it);
! 		}
  	}
  	// 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)
***************
*** 231,236 ****
  					//const RoleRepSeries & series = fco_ptr->getMyRoles( mod_ptr);
  					RoleRep::RoleRepSeries series;
! 					mod_ptr->getFinalRoles( fco, series);
! 					if ( !series.empty()) 
  					{
  						// add the roles to the member list of the set ( in that model) 
--- 248,253 ----
  					//const RoleRepSeries & series = fco_ptr->getMyRoles( mod_ptr);
  					RoleRep::RoleRepSeries series;
! 					bool has_some = mod_ptr->getFinalRoles( fco, series);
! 					if ( has_some && !series.empty()) 
  					{
  						// add the roles to the member list of the set ( in that model) 
***************
*** 245,255 ****
  						// inquire the roles of fco in the sub_model
  						RoleRep::RoleRepSeries roles_in_sub_model;
! 						sub_model->getFinalRoles( fco, roles_in_sub_model);
! 						RoleRep::RoleRepSeries_ConstIterator/*std::vector< RoleRep>::const_iterator*/ r_it = roles_in_sub_model.begin();
! 						for( ; r_it != roles_in_sub_model.end(); ++r_it) // if (!roles_in_sub_model.empty())
  						{
  							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())
--- 262,272 ----
  						// inquire the roles of fco in the sub_model
  						RoleRep::RoleRepSeries roles_in_sub_model;
! 						bool has_some = sub_model->getFinalRoles( fco, roles_in_sub_model);
! 						RoleRep::RoleRepSeries_ConstIterator r_it = roles_in_sub_model.begin();
! 						for( ; has_some && r_it != roles_in_sub_model.end(); ++r_it) // if (!roles_in_sub_model.empty())
  						{
  							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())
***************
*** 257,263 ****
  									// fetch all roles of sub_model_desc in model
  									RoleRep::RoleRepSeries sub_model_roles_in_model;
! 									mod_ptr->getFinalRoles( sub_model, sub_model_roles_in_model);//(*desc_it)->getMyRoles( mod_ptr);
! 									RoleRep::RoleRepSeries_ConstIterator/*std::vector<RoleRep>::const_iterator*/ r_it_sm = sub_model_roles_in_model.begin();
! 									for( ; r_it_sm != sub_model_roles_in_model.end(); ++r_it_sm )
  									{
  										std::string desc_sub_model_role_name = r_it_sm->getSmartRoleName();
--- 274,280 ----
  									// 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 )
  									{
  										std::string desc_sub_model_role_name = r_it_sm->getSmartRoleName();
***************
*** 265,278 ****
  										this->addTargetItem( i, mod_ptr, item);
  									}
! 									// take a look on the references to *desc_it
! 									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);
  											reference_ports_also[i] = true; // this will indicate
  										}
  									}
--- 282,307 ----
  										this->addTargetItem( i, mod_ptr, item);
  									}
! 									// take a look on the references to sub_model
! 									const FCO::ReferenceRepList &ref_list = sub_model->getFinalReferences();//<!> getTransitiveReferencesToMe(); //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);
+ 												reference_ports_also[i] = true; // this will indicate
+ 											}
+ 											/* changed on 3/9/2004
  											PointerItem item = (*ref_it)->getName() + " " + sub_role.getSmartRoleName();
  											this->addTargetItem( i, mod_ptr, item);
  											reference_ports_also[i] = true; // this will indicate
+ 											*/
  										}
  									}
***************
*** 291,332 ****
  
  
- void ConnJoint::setIsItReferencePort()
- {
- /*	const int number_of_endpoints = 2;
- 	bool result[ number_of_endpoints] = { false, false }; 
- 	const SDList* lists [ number_of_endpoints]= {	&m_oper1, &m_oper2};
- 	for( int i = 0; i < number_of_endpoints; ++i)
- 	{
- 		SDList_ConstIterator fco_it = lists[i]->begin();
- 		// for all fcos of the src or dst lists
- 		for( ; fco_it != lists[i]->end(); ++fco_it)
- 		{
- 			FCO * conn_end_ptr = *fco_it;
- 			FCO::ModelRepPtrList cont_model = m_connPtr->modelsIAmPartOfFinal();
- 			FCO::ModelRepPtrList::iterator cont_model_it = cont_model.begin();
- 			for( ; cont_model_it != cont_model.end(); ++cont_model_it)
- 			{
- 				if (!(*cont_model_it)->getAllMyReferences().empty())
- 				{
- 					// the container model may have references
- 					// so we have to check if the conn_end_ptr
- 					// has any role in cont_model_it with isport = true
- 					// if yes, then m_oper12IsReferencePort = true
- 					RoleRep::RoleRepSeries roles;
- 					(*cont_model_it)->getFinalRoles( conn_end_ptr, roles);
- 					
- 					RoleRep::RoleRepSeries_ConstIterator r_it = roles.begin();
- 					for( ; r_it != roles.end(); ++r_it)
- 						if ( (*r_it).isPort()) // this role may appear as a port of model
- 						  result[i] = true;
- 				}
- 			}
- 		}
- 	}
- 	m_oper1IsReferencePort = result[0];
- 	m_oper2IsReferencePort = result[1];*/
- }
- 
- 
  bool ConnJoint::checkElements( std::string connection_name)
  {
--- 320,323 ----
***************
*** 350,354 ****
  			if ( !member_ptr->checkIsPartOfFinal() && !member_ptr->isAbstract())
  			{
! 				global_vars.err << "CHECK: \"" << member_ptr->getName() << "\" fco in connection " << connection_name << " has no parent.\n";
  				res = false;
  			}
--- 341,345 ----
  			if ( !member_ptr->checkIsPartOfFinal() && !member_ptr->isAbstract())
  			{
! 				global_vars.err << "CHECK: \"" << member_ptr->getName() << "\" fco in connection \"" << connection_name << "\" is not contained by any model.\n";
  				res = false;
  			}
***************
*** 359,373 ****
  
  
- std::string ConnJoint::dumpElements( FCO::ModelRepPtrList & model_list)
- {
- 	return "";
- }
- 
- 
- void ConnJoint::createConstraints( Sheet* s, const std::string& conn_name)
- {
- }
- 
- 
  bool ConnJoint::calcLCD()
  {
--- 350,353 ----
***************
*** 426,430 ****
  			for( ; op1_it != m_oper1.end(); ++op1_it)
  			{
! 				if ( (*op1_it)->isToBeD())
  				{
  					(*op1_it)->addConnMethod( CodeGen::dumpGetInConnectionLinks( *op1_it, m_connPtr));
--- 406,410 ----
  			for( ; op1_it != m_oper1.end(); ++op1_it)
  			{
! 				if ( (*op1_it)->isToBeEx())
  				{
  					(*op1_it)->addConnMethod( CodeGen::dumpGetInConnectionLinks( *op1_it, m_connPtr));
***************
*** 439,443 ****
  			for( ; op1_it != m_oper1.end(); ++op1_it)
  			{
! 				if ( (*op1_it)->isToBeD())
  				{
  					(*op1_it)->addConnMethod( CodeGen::dumpGetOutConnectionLinks( *op1_it, m_connPtr));
--- 419,423 ----
  			for( ; op1_it != m_oper1.end(); ++op1_it)
  			{
! 				if ( (*op1_it)->isToBeEx())
  				{
  					(*op1_it)->addConnMethod( CodeGen::dumpGetOutConnectionLinks( *op1_it, m_connPtr));
***************
*** 447,451 ****
  			for( ; op2_it != m_oper2.end(); ++op2_it)
  			{
! 				if ( (*op2_it)->isToBeD())
  				{
  					(*op2_it)->addConnMethod( CodeGen::dumpGetInConnectionLinks( *op2_it, m_connPtr));
--- 427,431 ----
  			for( ; op2_it != m_oper2.end(); ++op2_it)
  			{
! 				if ( (*op2_it)->isToBeEx())
  				{
  					(*op2_it)->addConnMethod( CodeGen::dumpGetInConnectionLinks( *op2_it, m_connPtr));
***************
*** 460,464 ****
  			SDList_Iterator op1_it = m_oper1.begin();
  			for( ; op1_it != m_oper1.end(); ++op1_it)
! 				if ( (*op1_it)->isToBeD())
  					(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionLinks( *op1_it, m_connPtr));
  		}
--- 440,444 ----
  			SDList_Iterator op1_it = m_oper1.begin();
  			for( ; op1_it != m_oper1.end(); ++op1_it)
! 				if ( (*op1_it)->isToBeEx())
  					(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionLinks( *op1_it, m_connPtr));
  		}
***************
*** 467,476 ****
  			SDList_Iterator op1_it = m_oper1.begin();
  			for( ; op1_it != m_oper1.end(); ++op1_it)
! 				if ( (*op1_it)->isToBeD())
  					(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionLinks( *op1_it, m_connPtr));
  
  			SDList_Iterator op2_it = m_oper2.begin();
  			for( ; op2_it != m_oper2.end(); ++op2_it)
! 				if ( (*op2_it)->isToBeD())
  					(*op2_it)->addConnMethod( CodeGen::dumpGetBothConnectionLinks( *op2_it, m_connPtr));
  		}
--- 447,456 ----
  			SDList_Iterator op1_it = m_oper1.begin();
  			for( ; op1_it != m_oper1.end(); ++op1_it)
! 				if ( (*op1_it)->isToBeEx())
  					(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionLinks( *op1_it, m_connPtr));
  
  			SDList_Iterator op2_it = m_oper2.begin();
  			for( ; op2_it != m_oper2.end(); ++op2_it)
! 				if ( (*op2_it)->isToBeEx())
  					(*op2_it)->addConnMethod( CodeGen::dumpGetBothConnectionLinks( *op2_it, m_connPtr));
  		}
***************
*** 480,483 ****
--- 460,464 ----
  	// 2nd task
  	// creating methods like Connection::getSrc() ; owned by the connection itself
+ 	// the m_connPtr is to be extended if reached this point
  	if ( !m_bidirect)
  	{
***************
*** 518,522 ****
  		for( ; op1_it != m_oper1.end(); ++op1_it) // for all src labeled FCOs
  		{
! 			if ( (*op1_it)->isToBeD())
  			{
  				if ( !m_dstLCD.empty())
--- 499,503 ----
  		for( ; op1_it != m_oper1.end(); ++op1_it) // for all src labeled FCOs
  		{
! 			if ( (*op1_it)->isToBeEx())
  			{
  				if ( !m_dstLCD.empty())
***************
*** 526,531 ****
  					{
  						FCO* peer_ptr = 0;
! 						if ( (*peer_it)->isToBeD()) // use peer name only if is to extended
  							peer_ptr = *peer_it;
  
  						(*op1_it)->addConnMethod( CodeGen::dumpGetOutConnectionEnd( *op1_it, peer_ptr, m_connPtr, m_oper2IsAnyReferencePort));
--- 507,514 ----
  					{
  						FCO* peer_ptr = 0;
! 						if ( (*peer_it)->isToBeEx()) // use peer name only if is to extended
  							peer_ptr = *peer_it;
+ 						else if ( (*peer_it)->getExtedAnc()) // if it has an extended ancestor
+ 							peer_ptr = (*peer_it)->getExtedAnc();
  
  						(*op1_it)->addConnMethod( CodeGen::dumpGetOutConnectionEnd( *op1_it, peer_ptr, m_connPtr, m_oper2IsAnyReferencePort));
***************
*** 540,544 ****
  		for( ; op2_it != m_oper2.end(); ++op2_it)
  		{
! 			if ( (*op2_it)->isToBeD())
  			{
  				if ( !m_srcLCD.empty())
--- 523,527 ----
  		for( ; op2_it != m_oper2.end(); ++op2_it)
  		{
! 			if ( (*op2_it)->isToBeEx())
  			{
  				if ( !m_srcLCD.empty())
***************
*** 548,553 ****
  					{
  						FCO* peer_ptr = 0;
! 						if ( (*peer_it)->isToBeD()) // use peer name only if is to extended
  							peer_ptr = *peer_it;
  
  						(*op2_it)->addConnMethod( CodeGen::dumpGetInConnectionEnd( *op2_it, peer_ptr, m_connPtr, m_oper1IsAnyReferencePort));
--- 531,538 ----
  					{
  						FCO* peer_ptr = 0;
! 						if ( (*peer_it)->isToBeEx()) // use peer name only if is to extended
  							peer_ptr = *peer_it;
+ 						else if ( (*peer_it)->getExtedAnc()) // if it has an extended ancestor
+ 							peer_ptr = (*peer_it)->getExtedAnc();
  
  						(*op2_it)->addConnMethod( CodeGen::dumpGetInConnectionEnd( *op2_it, peer_ptr, m_connPtr, m_oper1IsAnyReferencePort));
***************
*** 569,579 ****
  				{
  					FCO * peer_ptr = 0;
! 					if ( (*it)->isToBeD()) // use peer name only if is to extended
  						peer_ptr = *it;
  
  					SDList_Iterator op1_it = m_oper1.begin();
  					for( ; op1_it != m_oper1.end(); ++op1_it) // though bidirect, some elements are still source
  					{
! 						if ( (*op1_it)->isToBeD())
  						{
  							(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op1_it, peer_ptr, m_connPtr, m_oper1IsAnyReferencePort));
--- 554,566 ----
  				{
  					FCO * peer_ptr = 0;
! 					if ( (*it)->isToBeEx()) // use peer name only if is to extended
  						peer_ptr = *it;
+ 					else if ( (*it)->getExtedAnc()) // if it has an extended ancestor
+ 						peer_ptr = (*it)->getExtedAnc();
  
  					SDList_Iterator op1_it = m_oper1.begin();
  					for( ; op1_it != m_oper1.end(); ++op1_it) // though bidirect, some elements are still source
  					{
! 						if ( (*op1_it)->isToBeEx())
  						{
  							(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op1_it, peer_ptr, m_connPtr, m_oper1IsAnyReferencePort));
***************
*** 591,601 ****
  				{
  					FCO * peer_ptr = 0;
! 					if ( (*it)->isToBeD()) // use peer name only if is to extended
  						peer_ptr = *it;
  
  					SDList_Iterator op1_it = m_oper1.begin();
  					for( ; op1_it != m_oper1.end(); ++op1_it) // though bidirect, some elements are still source
  					{
! 						if ( (*op1_it)->isToBeD())
  						{
  							(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op1_it, peer_ptr, m_connPtr, m_oper2IsAnyReferencePort));
--- 578,590 ----
  				{
  					FCO * peer_ptr = 0;
! 					if ( (*it)->isToBeEx()) // use peer name only if is to extended
  						peer_ptr = *it;
+ 					else if ( (*it)->getExtedAnc()) // if it has an extended ancestor
+ 						peer_ptr = (*it)->getExtedAnc();
  
  					SDList_Iterator op1_it = m_oper1.begin();
  					for( ; op1_it != m_oper1.end(); ++op1_it) // though bidirect, some elements are still source
  					{
! 						if ( (*op1_it)->isToBeEx())
  						{
  							(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op1_it, peer_ptr, m_connPtr, m_oper2IsAnyReferencePort));
***************
*** 609,613 ****
  					for( ; op2_it != m_oper2.end(); ++op2_it) // though bidirect, some elements are still destination
  					{
! 						if ( (*op2_it)->isToBeD())
  						{
  							(*op2_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op2_it, peer_ptr, m_connPtr, m_oper1IsAnyReferencePort));
--- 598,602 ----
  					for( ; op2_it != m_oper2.end(); ++op2_it) // though bidirect, some elements are still destination
  					{
! 						if ( (*op2_it)->isToBeEx())
  						{
  							(*op2_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op2_it, peer_ptr, m_connPtr, m_oper1IsAnyReferencePort));
***************
*** 625,629 ****
  			for( ; op1_it != m_oper1.end(); ++op1_it)
  			{
! 				if ( (*op1_it)->isToBeD())
  				{
  					(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op1_it, 0, m_connPtr, m_oper2IsAnyReferencePort));
--- 614,618 ----
  			for( ; op1_it != m_oper1.end(); ++op1_it)
  			{
! 				if ( (*op1_it)->isToBeEx())
  				{
  					(*op1_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op1_it, 0, m_connPtr, m_oper2IsAnyReferencePort));
***************
*** 636,640 ****
  			for( ; op2_it != m_oper2.end(); ++op2_it)
  			{
! 				if ( (*op2_it)->isToBeD())
  				{
  					(*op2_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op2_it, 0, m_connPtr, m_oper1IsAnyReferencePort));
--- 625,629 ----
  			for( ; op2_it != m_oper2.end(); ++op2_it)
  			{
! 				if ( (*op2_it)->isToBeEx())
  				{
  					(*op2_it)->addConnMethod( CodeGen::dumpGetBothConnectionEnd( *op2_it, 0, m_connPtr, m_oper1IsAnyReferencePort));

Index: ConnJoint.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/ConnJoint.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ConnJoint.h	26 Feb 2004 17:12:46 -0000	1.3
--- ConnJoint.h	10 Mar 2004 02:50:18 -0000	1.4
***************
*** 40,43 ****
--- 40,45 ----
  	~ConnJoint();
  
+ 	void setConnectionPtr( ConnectionRep * conn_ptr);
+ 
  	const SDList& getOp1() const;
  	const SDList& getOp2() const;
***************
*** 45,49 ****
  
  	void intInherit( ModelRep * mod_ptr);
- 	void setIsItReferencePort();
  
  	// appends new role(s)
--- 47,50 ----
***************
*** 52,59 ****
  	void addTargetItem( int i, const ModelRep * model, const RoleRep::RoleRepSeries & new_role_series);
  
- 	std::string dumpElements( FCO::ModelRepPtrList & model_list);
- 
  	bool checkElements( std::string connection_name);
- 	void createConstraints( Sheet*, const std::string& conn_name);
  
  	bool calcLCD();
--- 53,57 ----
***************
*** 62,71 ****
  protected:
  
!   // pointer to the container Connection, this ConnJoint is part of
  	ConnectionRep * m_connPtr;
  
  	// initial 
  	SDList m_oper1;
!   SDList m_oper2; 
  	
  	// final
--- 60,70 ----
  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
***************
*** 73,77 ****
  	TargetMap m_oper2TargetMap;
  
!   // if label1 == label2
  	bool m_bidirect;
  
--- 72,76 ----
  	TargetMap m_oper2TargetMap;
  
! 	// if label1 == label2
  	bool m_bidirect;
  

Index: ConnectionRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/ConnectionRep.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ConnectionRep.cpp	26 Feb 2004 17:12:46 -0000	1.3
--- ConnectionRep.cpp	10 Mar 2004 02:50:18 -0000	1.4
***************
*** 31,36 ****
  
  
! void ConnectionRep::appendJointElements( ConnJoint & joint)
  {
  	if (m_jointList.empty())
  		m_jointList.push_back( joint);
--- 31,39 ----
  
  
! 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);
***************
*** 42,50 ****
  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();
  	
--- 45,48 ----
***************
*** 65,68 ****
--- 63,72 ----
  
  	// implementation inheritance
+ 	// not needed since the inheritance provides the needed functionality
+ 	/*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)
  	{
***************
*** 70,74 ****
  		for( ; joint_it != m_jointList.end(); ++joint_it )
  		{
- 			
  			ConnectionRep * conn_rep = 0;
  			if ( (*conn_it)->getMyKind() == Any::CONN)
--- 74,77 ----
***************
*** 77,95 ****
  				conn_rep->appendJointElements( *joint_it);
  		}
! 	}
! }
! 
! 
! void ConnectionRep::setReferencePorts()
! {
! 	/*std::list<ConnJoint>::iterator joint_it = m_jointList.begin();
! 	for( ; joint_it != m_jointList.end(); ++joint_it )
! 		joint_it->setIsItReferencePort();*/
! }
! 
! 
! std::string ConnectionRep::dumpConnDetails()
! {
! 	return "";
  }
  
--- 80,84 ----
  				conn_rep->appendJointElements( *joint_it);
  		}
! 	}*/
  }
  
***************
*** 137,149 ****
  	return res;
  }
- 
- 
- void ConnectionRep::createConstraints(Sheet * s)
- {
- 	std::list<ConnJoint>::iterator joint_it = m_jointList.begin();
- 	for( ; joint_it != m_jointList.end(); ++joint_it )
- 		joint_it->createConstraints(s, getName());
- }
- 
  
  
--- 126,129 ----

Index: ConnectionRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/ConnectionRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ConnectionRep.h	26 Feb 2004 17:12:46 -0000	1.2
--- ConnectionRep.h	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 16,28 ****
  	inline Any::KIND_TYPE getMyKind() const { return Any::CONN; }
  	void addJoint( ConnJoint & joint);
! 	void appendJointElements( ConnJoint & joint);
  	
  	void inherit();
- 	void setReferencePorts();
  
  	bool checkConnectionTargets();
- 	void createConstraints( Sheet*);
  
- 	std::string dumpConnDetails();
  	std::string doDump();
  
--- 16,25 ----
  	inline Any::KIND_TYPE getMyKind() const { return Any::CONN; }
  	void addJoint( ConnJoint & joint);
! 	void appendJointElements( const ConnJoint & joint);
  	
  	void inherit();
  
  	bool checkConnectionTargets();
  
  	std::string doDump();
  

Index: Dumper.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Dumper.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Dumper.cpp	2 Mar 2004 19:21:11 -0000	1.6
--- Dumper.cpp	10 Mar 2004 02:50:18 -0000	1.7
***************
*** 3,7 ****
  #include "Dumper.h"
  #include "MakeVisitor.h"
- #include "TokenEx.h"
  
  #include "algorithm"
--- 3,6 ----
***************
*** 45,137 ****
  
  
! void Dumper::inheritMoReSeCoFolAsp() //doInheritance()
  {
- 	// propagates down the hierarchy 
- 	// -role,
- 	// -reference, ( has to be before Connection because of Ports) 
- 	// -setMember, 
- 	// -Connection, 
- 	// -FolderMember, 
- 	// -AspectMember relationship
- 
- 
- 	//
- 	// task 1
- 	// creating roles for each FCO __descendant__ which is present in the Containment relationship
- 	// and copying these roles to M2 and M3 also
- 	//
- 	// i.e.:
- 	//     FCO -----role-<>M1
- 	//      |              |
- 	//     /^\            /^\
- 	//   A1   A2        M2   M3
- 	// 
- 
- 
- 	//
- 	// task 2
- 	// expands the reference relation as above
- 	//
- 	// i.e.:
- 	//     FCO <-----------R1
- 	//      |              |
- 	//     /^\            /^\
- 	//   A1   A2        R2   R3
- 	//
- 	// as a result R1, R2 and R3 may point to an FCO, A1, A2
- 
- 
- 	//
- 	// task 3
- 	// connection
- 	//
- 	// i.e.
- 	//     FCOA -src------o-----dst- FCOB
- 	//      |             |            |
- 	//     /^\            C1          /^\
- 	//   A1   A2          |         B2   B3
- 	//                    |
- 	//                   /^\
- 	//                 C2   C3
- 	//
- 	// in this case C1, C2, C3 will have as src FCOA, A1, A2
- 	// and as destination FCOB, B2, B3
- 	//
- 
- 	//
- 	// task 4
- 	// expands set membership relation for each FCO __descendant__
- 	// i.e.:
- 	//     FCO ------<>S1
- 	//      |          |
- 	//     /^\        /^\
- 	//   A1   A2    S2   S3
- 	// 
- 	// produces A1, A2 as new (inherited) set members for S1, S2, S3
- 
- 	//
- 	// task 5
- 	// expands folder membership
- 	// no inheritance between folders !
- 	//
- 	//      FCOA -folder_member----FolderA
- 	//       |
- 	//      /^\
- 	//  FCOB   FCOC
- 	//
- 	// FolderA may contain FCOA, FCOB, FCOC
- 
- 
- 	//
- 	// task 6
- 	// expand aspect membership ( if FCOA is selected to appear in AspA)
- 	//      FCOA -set_member----AspA
- 	//       |
- 	//      /^\
- 	//  FCOB   FCOC
- 	//  
- 	//
- 	// if FCOA is member of AspA aspect, then FCOB and FCOC is also a member of AspA
- 
  	// task 1
  	ModelRep_Iterator mod_iter( m_modelList.begin());
--- 44,49 ----
  
  
! void Dumper::inheritMoReSeCoFolAsp()
  {
  	// task 1
  	ModelRep_Iterator mod_iter( m_modelList.begin());
***************
*** 157,297 ****
  		(*conn_iter)->inherit();
  
- 	// task 4 - for all sets on the sheet
- 	SetRep_Iterator set_iter( m_setList.begin());
- 	for( ; set_iter != m_setList.end(); ++set_iter)
- 		(*set_iter)->inherit();
- 
- 	// task 5: folder element hierarchies
- 	std::vector<FolderRep*>::iterator folder_iter( m_folderList.begin());
- 	for( ; folder_iter != m_folderList.end(); ++folder_iter)
- 		(*folder_iter)->extendMembership();
- 
- 	// task 6
- 	std::vector<AspectRep*>::iterator asp_iter( m_aspectList.begin());
- 	for( ; asp_iter != m_aspectList.end(); ++asp_iter)
- 		(*asp_iter)->extendAspectWithDescendants();
- }
- 
- 
- void Dumper::inheritConstraintsAndAttributes(FCO * ptr, FCO * c_ptr)
- {
- 	// adding constraints
- 	c_ptr->addFinalConstraintList( ptr->getInitialConstraintRepPtrList());
- 
- 	// adding attributes
- 	c_ptr->addFinalAttributeList( ptr->getInitialAttributeRepPtrList());
- }
- 
- 
- void Dumper::inheritAspConsAttr()
- {
- 	{FcoRep_Iterator it0( m_fcoRepList.begin());
- 	for( ; it0 != m_fcoRepList.end(); ++it0 )
- 	{
- 		std::vector<FCO*> children;
- 		(*it0)->getImpDescendants( children);
- 		children.push_back( *it0);
- 
- 		std::vector<FCO*>::iterator child_it = children.begin();
- 		for( ; child_it != children.end(); ++child_it )
- 			inheritConstraintsAndAttributes( *it0, *child_it);
- 
- 	}}
- 
- 	{AtomRep_Iterator it1 = m_atomList.begin();
- 	for( ; it1 != m_atomList.end(); ++it1 )
- 	{
- 		std::vector<FCO*> children;
- 		(*it1)->getImpDescendants( children);
- 		children.push_back( *it1);
- 
- 		std::vector<FCO*>::iterator child_it = children.begin();
- 		for( ; child_it != children.end(); ++child_it )
- 			inheritConstraintsAndAttributes( *it1, *child_it);
- 	}}
- 
- 	{ModelRep_Iterator it2 = m_modelList.begin();
- 	for( ; it2 != m_modelList.end(); ++it2 )
- 	{
- 		std::vector<FCO*> children;
- 		(*it2)->getImpDescendants( children);
- 		children.push_back( *it2);
- 
- 		std::vector<FCO*>::iterator child_it = children.begin();
- 		for( ; child_it != children.end(); ++child_it )
- 		{
- 			ModelRep * child_mod_ptr = static_cast<ModelRep *>( *child_it);
- 			if ( !child_mod_ptr) TO("Error after static cast - doInheritance");
- 
- 			// inherit aspects
- 			const ModelRep::AspectRepPtrList &asp_list = (*it2)->getAspectRepPtrList();
- 			child_mod_ptr->addFinalAspectList( asp_list);
- 
- 			inheritConstraintsAndAttributes( *it2, *child_it);
- 		}
- 	}}
- 
- 	{ConnectionRep_Iterator it3 = m_connList.begin();
- 	for( ; it3 != m_connList.end(); ++it3 )
- 	{
- 		std::vector<FCO*> children;
- 		(*it3)->getImpDescendants( children);
- 		children.push_back( *it3);
- 
- 		std::vector<FCO*>::iterator child_it = children.begin();
- 		for( ; child_it != children.end(); ++child_it )
- 			inheritConstraintsAndAttributes( *it3, *child_it);
- 	}}
- 
- 	{SetRep_Iterator it4 = m_setList.begin();
- 	for( ; it4 != m_setList.end(); ++it4 )
- 	{
- 		std::vector<FCO*> children;
- 		(*it4)->getImpDescendants( children);
- 		children.push_back( *it4);
- 
- 		std::vector<FCO*>::iterator child_it = children.begin();
- 		for( ; child_it != children.end(); ++child_it )
- 		{
- 			inheritConstraintsAndAttributes( *it4, *child_it);
- 		}
- 	}}
- 
- 	{ReferenceRep_Iterator it5 = m_refList.begin();
- 	for( ; it5 != m_refList.end(); ++it5 )
- 	{
- 		std::vector<FCO*> children;
- 		(*it5)->getImpDescendants( children);
- 		children.push_back( *it5);
- 
- 		std::vector<FCO*>::iterator child_it = children.begin();
- 		for( ; child_it != children.end(); ++child_it )
- 			inheritConstraintsAndAttributes( *it5, *child_it);
- 	}}
- 
- 	{// since folders don't inherit, the constraint list will not be changing
- 	FolderRep_Iterator folder_iter( m_folderList.begin());
- 	for( ; folder_iter != m_folderList.end(); ++folder_iter)
- 		(*folder_iter)->addFinalConstraintList( (*folder_iter)->getInitialConstraintRepPtrList());
- 	}
- }
- 
- 
- void Dumper::setReferencePorts()
- {
- 	ConnectionRep_Iterator conn_iter( m_connList.begin());
- 	for( ; conn_iter != m_connList.end(); ++conn_iter)
- 		(*conn_iter)->setReferencePorts();
- }
- 
- 
- void Dumper::doAspectPartsMap()
- {
- }
- 
- 
- const AspectRep * Dumper::findAspectBasedOnName(const std::string & name_to_find) const
- {
- 	return 0;
  }
  
--- 69,72 ----
***************
*** 305,309 ****
  
  
! void Dumper::prepareDump()
  {
  	std::string t = m_projName;
--- 80,84 ----
  
  
! void Dumper::createMethods()
  {
  	std::string t = m_projName;
***************
*** 318,322 ****
  		for( it_cn = m_connList.begin() ; it_cn != m_connList.end(); ++it_cn)
  		{
! 			if ( (*it_cn)->isToBeD())
  			{
  				(*it_cn)->createEndGetters();
--- 93,97 ----
  		for( it_cn = m_connList.begin() ; it_cn != m_connList.end(); ++it_cn)
  		{
! 			if ( (*it_cn)->isToBeEx())
  			{
  				(*it_cn)->createEndGetters();
***************
*** 335,339 ****
  		for( ; it_b != m_folderList.end(); ++it_b)
  		{
! 			if ( (*it_b)->isToBeD())
  			{
  				(*it_b)->prepare();
--- 110,114 ----
  		for( ; it_b != m_folderList.end(); ++it_b)
  		{
! 			if ( (*it_b)->isToBeEx())
  			{
  				(*it_b)->prepare();
***************
*** 350,354 ****
  		for( ; it_b != m_fcoRepList.end(); ++it_b)
  		{
! 			if ( (*it_b)->isToBeD())
  			{
  				(*it_b)->prepare();
--- 125,129 ----
  		for( ; it_b != m_fcoRepList.end(); ++it_b)
  		{
! 			if ( (*it_b)->isToBeEx())
  			{
  				(*it_b)->prepare();
***************
*** 366,370 ****
  		for( ; it_b != m_atomList.end(); ++it_b)
  		{
! 			if ( (*it_b)->isToBeD())
  			{
  
--- 141,145 ----
  		for( ; it_b != m_atomList.end(); ++it_b)
  		{
! 			if ( (*it_b)->isToBeEx())
  			{
  
***************
*** 383,387 ****
  		for( ; it_c != m_setList.end(); ++it_c)
  		{
! 			if ( (*it_c)->isToBeD())
  			{
  				(*it_c)->prepare();
--- 158,162 ----
  		for( ; it_c != m_setList.end(); ++it_c)
  		{
! 			if ( (*it_c)->isToBeEx())
  			{
  				(*it_c)->prepare();
***************
*** 400,404 ****
  		for( ; it_ref != m_refList.end(); ++it_ref)
  		{
! 			if ( (*it_ref)->isToBeD())
  			{
  				(*it_ref)->prepare();
--- 175,179 ----
  		for( ; it_ref != m_refList.end(); ++it_ref)
  		{
! 			if ( (*it_ref)->isToBeEx())
  			{
  				(*it_ref)->prepare();
***************
*** 417,421 ****
  		for( ; it_m != m_modelList.end(); ++it_m)
  		{
! 			if ( (*it_m)->isToBeD())
  			{
  				(*it_m)->prepare();
--- 192,196 ----
  		for( ; it_m != m_modelList.end(); ++it_m)
  		{
! 			if ( (*it_m)->isToBeEx())
  			{
  				(*it_m)->prepare();
***************
*** 447,451 ****
  	std::vector<FolderRep*>::const_iterator it_b = m_folderList.begin();
  	for( ; it_b != m_folderList.end(); ++it_b)
! 		if ( (*it_b)->isToBeD())
  			(*it_b)->dumpGlobals();
  	}
--- 222,226 ----
  	std::vector<FolderRep*>::const_iterator it_b = m_folderList.begin();
  	for( ; it_b != m_folderList.end(); ++it_b)
! 		if ( (*it_b)->isToBeEx())
  			(*it_b)->dumpGlobals();
  	}
***************
*** 454,458 ****
  	for( ; it != s.end(); ++it)
  	{
! 		if ( (*it)->isToBeD())
  			(*it)->dumpGlobals();
  	}
--- 229,233 ----
  	for( ; it != s.end(); ++it)
  	{
! 		if ( (*it)->isToBeEx())
  			(*it)->dumpGlobals();
  	}
***************
*** 467,471 ****
  	if ( it_b != m_folderList.end())
  		for( ; it_b != m_folderList.end(); ++it_b)
! 			if ( (*it_b)->isToBeD())
  				(*it_b)->doDump();
  	}
--- 242,246 ----
  	if ( it_b != m_folderList.end())
  		for( ; it_b != m_folderList.end(); ++it_b)
! 			if ( (*it_b)->isToBeEx())
  				(*it_b)->doDump();
  	}
***************
*** 474,478 ****
  	for( ; it != s.end(); ++it)
  	{
! 		if ( (*it)->isToBeD())
  			(*it)->doDump();
  	}
--- 249,253 ----
  	for( ; it != s.end(); ++it)
  	{
! 		if ( (*it)->isToBeEx())
  			(*it)->doDump();
  	}
***************
*** 520,524 ****
  	CWaitCursor w;
  
! 	prepareDump();
  	dumpGlobals( sorted);
  
--- 295,299 ----
  	CWaitCursor w;
  
! 	createMethods();
  	dumpGlobals( sorted);
  
***************
*** 537,627 ****
  }
  
! 
! /*static*/ void Dumper::getGlobalUserParts( std::string& up1, std::string& up2)
! {
! 	std::ifstream old_xmp_file;
! 	std::string old_f_name;
! 	old_f_name = global_vars.header_backup_name;
! 	if ( old_f_name.empty()) // means that no previous version existed or the user selected not to parse the old file
! 	{
! 		up1 = "// add your include files here\n";
! 		up2 = "// add your additional class definitions here\n";
! 		return;
! 	}
! 
! 	old_xmp_file.open( old_f_name.c_str() ,std::ios_base::in);
! 	if ( !old_xmp_file.is_open())
! 	{
! 		up1 = "// ERROR accessing file\n";
! 		up2 = "// ERROR accessing file\n";
! 		return;
! 	}
! 
! 	std::string line;
! 	while( !old_xmp_file.eof() && line.substr(0, Any::m_startUPToken.length()) != Any::m_startUPToken) 
! 	{
! 		std::getline( old_xmp_file, line);
! 	}
! 	if ( !old_xmp_file.eof()) // found the start token starting at 1st character
! 	{
! 		std::getline( old_xmp_file, line);
! 		while( !old_xmp_file.eof() && line.substr( 0, Any::m_endUPToken.length()) != Any::m_endUPToken) 
! 		{
! 			up1 += line + "\n";
! 			std::getline( old_xmp_file, line);
! 		}
! 		if ( !old_xmp_file.eof()) // found the end token
! 		{
! 		}
! 		else
! 		{
! 			old_xmp_file.close();
! 			up1 = "// Ending token (" + Any::m_endUPToken + ") for first global user part not found\n";
! 			up2 = "// Error in first global user part\n";
! 			return;
! 		}
! 	}
! 	else
! 	{
! 		old_xmp_file.close();
! 		up1 = "// Starting token (" + Any::m_startUPToken + ") for first global user part not found\n";
! 		up2 = "// Error in first global user part\n";
! 		return; 
! 	}
! 
! 	while( !old_xmp_file.eof() && line.substr(0, Any::m_startUPToken.length()) != Any::m_startUPToken) 
! 	{
! 		std::getline( old_xmp_file, line);
! 	}
! 	if ( !old_xmp_file.eof()) // found the start token starting at 1st character
! 	{
! 		std::getline( old_xmp_file, line);
! 		while( !old_xmp_file.eof() && line.substr( 0, Any::m_endUPToken.length()) != Any::m_endUPToken) 
! 		{
! 			up2 += line + "\n";
! 			std::getline( old_xmp_file, line);
! 		}
! 		if ( !old_xmp_file.eof()) // found the end token
! 		{
! 		}
! 		else
! 		{
! 			old_xmp_file.close();
! 			up2 = "// Ending token (" + Any::m_endUPToken + ") for second global user part not found\n";
! 			return;
! 		}
! 	}
! 	else
! 	{
! 		old_xmp_file.close();
! 		up2 = "// Starting token (" + Any::m_startUPToken + ") for second global user part not found\n";
! 		return; 
! 	}
! 
! 	old_xmp_file.close();
! 	return;
! }
! 
! 
  bool Dumper::checkAll()
  {
--- 312,316 ----
  }
  
! #if(0)
  bool Dumper::checkAll()
  {
***************
*** 752,760 ****
    return res;
  }
! 
! 
! void Dumper::findMaxOfMetaRefs()
! {
! }
  
  
--- 441,445 ----
    return res;
  }
! #endif
  
  
***************
*** 801,805 ****
  void Dumper::fetchConfigurationNames( std::vector< std::string>& res)
  {
! 	BON::RegistryNode rn = this->m_projectRootFolder->getRegistry()->getChild("SavedConfigurations");
  	if ( rn)
  	{
--- 486,490 ----
  void Dumper::fetchConfigurationNames( std::vector< std::string>& res)
  {
! 	BON::RegistryNode rn = this->m_BON_Project_Root_Folder->getRegistry()->getChild("BonExtender/SavedConfigurations");
  	if ( rn)
  	{
***************
*** 860,895 ****
  		if ( sc.m_currSelConfigStr != "Default")
  		{
! 			std::string path = "/SavedConfigurations/" + sc.m_currSelConfigStr;
! 			this->m_projectRootFolder->getRegistry()->setValueByPath( path, "1");
  		}
! 		/*std::string regPath = "/Configs/" + sc.m_currSelConfigStr, regVal;
! 		for( int i = 0; i < last_id; ++i)
  		{
! 			CString r;
! 			bool doit;
! 			const void * ptr;
! 			bool res = sc.getEntry( i, r, doit, ptr);
! 			if ( res)
  			{
! 				Any * any_ptr = const_cast<Any *>( static_cast<const Any *>(ptr));
! 				if ( any_ptr)
  				{
! 					any_ptr->toBeD( doit); // == doit
! 					if (doit)	regVal = "true"; else regVal = "false";
! 					any_ptr->getMyRegistry()->setValueByPath( regPath, regVal);
  				}
  			}
! 		}*/
! 	} else
! 	{
! 		// should not be done since the toBeD is affected only if the 
! 		// OnOk has been run
! 		/*for( std::vector<FolderRep*>::const_iterator it_b = m_folderList.begin(); it_b != m_folderList.end(); ++it_b)
! 			(*it_b)->toBeD( true);
! 		
! 		for( std::vector< FCO *>::iterator it = s.begin(); it != s.end(); ++it)
! 			(*it)->toBeD( true);*/
! 	}
! 	
  }
  
--- 545,578 ----
  		if ( sc.m_currSelConfigStr != "Default")
  		{
! 			std::string path = "/BonExtender/SavedConfigurations/" + sc.m_currSelConfigStr;
! 			this->m_BON_Project_Root_Folder->getRegistry()->setValueByPath( path, "1");
  		}
! 		// try to select extedAnc for each non to be extended fco
! 		for( std::vector< FCO *>::iterator it = s.begin(); it != s.end(); ++it)
  		{
! 			if ( !(*it)->isToBeEx() && (*it)->isFCO())
  			{
! 				int my_level = (*it)->getLevel( FCO::INTERFACE);
! 				int closest_to_my_level = -1;
! 				FCO * selected_extended_anc = 0;
! 				std::vector< FCO*> ancestors;
! 				(*it)->getIntAncestors( ancestors);
! 				std::vector< FCO*>::iterator anc_it = ancestors.begin();
! 				for( ; anc_it != ancestors.end(); ++anc_it)
  				{
! 					int level_of_ancestor = (*anc_it)->getLevel( FCO::INTERFACE);
! 					if ( (*anc_it)->isToBeEx() && // it is extended
! 						level_of_ancestor < my_level && // it is above the *it
! 						level_of_ancestor > closest_to_my_level ) // better than others
! 					{
! 						closest_to_my_level = level_of_ancestor;
! 						selected_extended_anc = *anc_it;
! 					}
  				}
+ 				if ( closest_to_my_level != -1 && selected_extended_anc != 0)
+ 					(*it)->setExtedAnc( selected_extended_anc);
  			}
! 		}
! 	}	
  }
  
***************
*** 897,902 ****
  {
  	inheritMoReSeCoFolAsp();		// models, references, set, connections, folder and aspect membership
- 	inheritAspConsAttr();				// hasAspect, hasConstraints, hasAttribute
- 	//setReferencePorts();
  	//showMultipleInheritance();
  
--- 580,583 ----
***************
*** 907,1008 ****
  
  
- /*static*/ bool Dumper::doParseCardinality(const std::string& cardinality_c, const std::string &target_c, const std::string &contextDesc_c, std::string &expr_c)
- {
- 	const CString cardinality = cardinality_c.c_str();
- 	const CString target = target_c.c_str();
- 	const CString contextDesc = contextDesc_c.c_str();
- 
- 	CString expr = expr_c.c_str();
- 	expr = "";
- 
- 	CString card(cardinality);
- 	card.Remove(_T('\t'));
- 	card.Remove(_T('\n'));
- 	card.Remove(_T(' '));
- 
- 	bool berr = false;
- 	CStringArray ORs;
- 	CTokenEx	tok;
- 	tok.Split(card, ",", ORs);
- 	for (int i = 0; i < ORs.GetSize(); i++) {
- 		CStringArray bounds;
- 		tok.Split(ORs[i], "..", bounds);
- 
- 		CString orexpr;
- 
- 		if (bounds.GetSize() == 1) {
- 			int multip;
- 			if(sscanf((LPCTSTR)bounds[0],"%d",&multip) != 1) {
- 				berr = true;
- 				break;
- 			}
- 			else {
- 				if (multip < 0) {
- 					AfxMessageBox("Multiplicity is negative: " + contextDesc, MB_ICONEXCLAMATION);
- 				}
- 				orexpr.Format("(%s = %d)", target, multip);
- 			}
- 		}
- 		else if (bounds.GetSize() == 2) {
- 			int multipmin, multipmax;
- 			CString andexpr1, andexpr2;
- 
- 			if(sscanf((LPCTSTR)bounds[0],"%d",&multipmin) != 1) {
- 				berr = true;
- 				break;
- 			}
- 			else {
- 				if (multipmin < 0) {
- 					AfxMessageBox("Minimum multiplicity is negative: " + contextDesc, MB_ICONEXCLAMATION);
- 				}
- 				if (multipmin > 0) {
- 					andexpr1.Format("(%s >= %d)", target, multipmin);
- 				}
- 			}
- 
- 			if(sscanf((LPCTSTR)bounds[1],"%d",&multipmax) != 1) {
- 				if (bounds[1] != "*") {
- 					berr = true;
- 					break;
- 				}
- 			}
- 			else {
- 				andexpr2.Format("(%s <= %d)", target, multipmax);
- 				if (multipmax < 0) {
- 					AfxMessageBox("Maximum multiplicity is negative: " + contextDesc, MB_ICONEXCLAMATION);
- 				}
- 				if (multipmax < multipmin) {
- 					AfxMessageBox("Minimum multiplicity > Maximum multiplicity : " + contextDesc, MB_ICONEXCLAMATION);
- 				}
- 			}
- 
- 			if ((!andexpr1.IsEmpty()) && (!andexpr2.IsEmpty())) {
- 				orexpr.Format("( %s and %s )", andexpr1, andexpr2);
- 			}
- 			else if (!andexpr1.IsEmpty()) {
- 				orexpr = andexpr1;
- 			}
- 			else if (!andexpr2.IsEmpty()) {
- 				orexpr = andexpr2;
- 			}
- 		}
- 
- 		if (!orexpr.IsEmpty()) {
- 			if (!expr.IsEmpty()) {
- 				expr += " or ";
- 			}
- 			expr += orexpr;
- 		}
- 	}
- 
- 	if (berr) {
- 		expr = "";
- 	}
- 
- 	expr_c = (LPCTSTR) expr;
- 	return berr;
- }
- 
- 
  /*static*/ int Dumper::selectOutputFiles( const std::string& proj_name_to_be_checked)
  {
--- 588,591 ----
***************
*** 1169,1171 ****
--- 752,841 ----
  	return 1;
  }
+ 
+ 
+ /*static*/ void Dumper::getGlobalUserParts( std::string& up1, std::string& up2)
+ {
+ 	std::ifstream old_xmp_file;
+ 	std::string old_f_name;
+ 	old_f_name = global_vars.header_backup_name;
+ 	if ( old_f_name.empty()) // means that no previous version existed or the user selected not to parse the old file
+ 	{
+ 		up1 = "// add your include files here\n";
+ 		up2 = "// add your additional class definitions here\n";
+ 		return;
+ 	}
+ 
+ 	old_xmp_file.open( old_f_name.c_str() ,std::ios_base::in);
+ 	if ( !old_xmp_file.is_open())
+ 	{
+ 		up1 = "// ERROR accessing file\n";
+ 		up2 = "// ERROR accessing file\n";
+ 		return;
+ 	}
+ 
+ 	std::string line;
+ 	while( !old_xmp_file.eof() && line.substr(0, Any::m_startUPToken.length()) != Any::m_startUPToken) 
+ 	{
+ 		std::getline( old_xmp_file, line);
+ 	}
+ 	if ( !old_xmp_file.eof()) // found the start token starting at 1st character
+ 	{
+ 		std::getline( old_xmp_file, line);
+ 		while( !old_xmp_file.eof() && line.substr( 0, Any::m_endUPToken.length()) != Any::m_endUPToken) 
+ 		{
+ 			up1 += line + "\n";
+ 			std::getline( old_xmp_file, line);
+ 		}
+ 		if ( !old_xmp_file.eof()) // found the end token
+ 		{
+ 		}
+ 		else
+ 		{
+ 			old_xmp_file.close();
+ 			up1 = "// Ending token (" + Any::m_endUPToken + ") for first global user part not found\n";
+ 			up2 = "// Error in first global user part\n";
+ 			return;
+ 		}
+ 	}
+ 	else
+ 	{
+ 		old_xmp_file.close();
+ 		up1 = "// Starting token (" + Any::m_startUPToken + ") for first global user part not found\n";
+ 		up2 = "// Error in first global user part\n";
+ 		return; 
+ 	}
+ 
+ 	while( !old_xmp_file.eof() && line.substr(0, Any::m_startUPToken.length()) != Any::m_startUPToken) 
+ 	{
+ 		std::getline( old_xmp_file, line);
+ 	}
+ 	if ( !old_xmp_file.eof()) // found the start token starting at 1st character
+ 	{
+ 		std::getline( old_xmp_file, line);
+ 		while( !old_xmp_file.eof() && line.substr( 0, Any::m_endUPToken.length()) != Any::m_endUPToken) 
+ 		{
+ 			up2 += line + "\n";
+ 			std::getline( old_xmp_file, line);
+ 		}
+ 		if ( !old_xmp_file.eof()) // found the end token
+ 		{
+ 		}
+ 		else
+ 		{
+ 			old_xmp_file.close();
+ 			up2 = "// Ending token (" + Any::m_endUPToken + ") for second global user part not found\n";
+ 			return;
+ 		}
+ 	}
+ 	else
+ 	{
+ 		old_xmp_file.close();
+ 		up2 = "// Starting token (" + Any::m_startUPToken + ") for second global user part not found\n";
+ 		return; 
+ 	}
+ 
+ 	old_xmp_file.close();
+ 	return;
+ }
+ 
  

Index: Dumper.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Dumper.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Dumper.h	26 Feb 2004 17:12:46 -0000	1.5
--- Dumper.h	10 Mar 2004 02:50:18 -0000	1.6
***************
*** 6,13 ****
  #include "Sheet.h"
  
- template <class T>
- std::vector<T>
- sort_based_on_age( std::vector<T>& input);
- 
  class Dumper : public Sheet {
  
--- 6,9 ----
***************
*** 21,46 ****
  	bool build();
  
- 	static bool doParseCardinality
- 		(const std::string& cardinality, 
- 		const std::string &target, 
- 		const std::string &contextDesc, 
- 		std::string &expr);
- 
- 	static void getGlobalUserParts( std::string& up1, std::string& up2);
  	static int selectOutputFiles( const std::string& proj_name);
  
  protected:
  
  	void inheritMoReSeCoFolAsp();
- 	void inheritAspConsAttr();
- 	void setReferencePorts();
  
  	void showMultipleInheritance();
- 	void doAspectPartsMap();
- 	// creates elements from element hierarchies
  
  	void selConf( std::vector<FCO*>& s);
  
! 	void prepareDump();
  	void dumpGlobals( std::vector<FCO*>& s);
  	void dumpMain( std::vector<FCO*>& s);
--- 17,32 ----
  	bool build();
  
  	static int selectOutputFiles( const std::string& proj_name);
+ 	static void getGlobalUserParts( std::string& up1, std::string& up2);
  
  protected:
  
  	void inheritMoReSeCoFolAsp();
  
  	void showMultipleInheritance();
  
  	void selConf( std::vector<FCO*>& s);
  
! 	void createMethods();
  	void dumpGlobals( std::vector<FCO*>& s);
  	void dumpMain( std::vector<FCO*>& s);
***************
*** 51,126 ****
  	bool checkOrphanAttributes();
  	bool findInFolders( FCO * fco);
- 	void findMaxOfMetaRefs();
  
  	std::string getNamespaceName();
  
  protected:
- 	void inheritConstraintsAndAttributes( FCO * ptr, FCO * c_ptr);
- 	//void addToRootFolder( Any * elem);
- 	//bool isInRootFolder( Any * elem);
- 	const AspectRep * findAspectBasedOnName(const std::string & name_to_find) const;
  	void fetchConfigurationNames( std::vector< std::string>& res);
  };
  
  
! 
! template <class T>
! std::vector<T>
! sort_based_on_age( std::vector<T>& input)
! {
! 	std::vector<T> res;
! 	std::vector<T>::iterator it = input.begin();
! 	for ( ; it != input.end(); ++it)
! 		if ( (*it)->isATopMostObject())
! 		{
! 			res.push_back( *it);
! 			std::string m = (*it)->getName();
! 		}
! 
! 	int orig_size = input.size();
! 	int start = 0, end = res.size(), k;
! 	while ( orig_size != res.size() && start != end)
! 	{
! 		for( k = start; k != end; ++k)
! 		{
! 			T act = res[k];
! 			std::string m = act->getName();
! 			std::vector<FCO *> ch = act->getAllChildren();
! 			std::vector<FCO *>::iterator ch_it = ch.begin();
! 			for( ; ch_it != ch.end(); ++ch_it)
! 			{
! 				if ( act->getMyKind() == (*ch_it)->getMyKind())
! 				{
! 					T elem = static_cast<T>( *ch_it);
! 					if ( res.end() == std::find( res.begin(), res.end(), elem))
! 						res.push_back( elem);
! 				}
! 			}
! 		}
! 		start = end;
! 		end = res.size();
! 	}
! 
! 	if ( orig_size != res.size()) // means that start == end was fulfilled, 
! 		// the atoms have no more children 
! 		// the fcos must be the missing parents
! 	{
! 		std::vector<T>::iterator it2 = input.begin();
! 		for ( ; it2 != input.end(); ++it2)
! 		{
! 			if ( std::find( res.begin(), res.end(), *it2) == res.end()) 
! 				res.push_back( *it2);
! 		}
! 	}
! 	if ( orig_size != res.size())
! 		{
! 		}
! 	else
! 		{
! 		}
! 	return res;
! }
! 
! 
! 
! #endif //SHEET_H
--- 37,47 ----
  	bool checkOrphanAttributes();
  	bool findInFolders( FCO * fco);
  
  	std::string getNamespaceName();
  
  protected:
  	void fetchConfigurationNames( std::vector< std::string>& res);
  };
  
  
! #endif //DUMPER_H

Index: FCO.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/FCO.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** FCO.cpp	26 Feb 2004 17:12:46 -0000	1.6
--- FCO.cpp	10 Mar 2004 02:50:18 -0000	1.7
***************
*** 8,12 ****
  #include "CodeGen.h"
  #include "logger.h"
- #include "TokenEx.h"
  #include "list"
  #include "algorithm"
--- 8,11 ----
***************
*** 17,27 ****
  
  FCO::FCO( BON::FCO& ptr)
[...974 lines suppressed...]
! 
! 	return hdr;
! }
  
  /*static*/ std::vector<FCO *> FCO::intersect( const std::vector<FCO*>& in1, const std::vector<FCO*>& in2)
--- 936,940 ----
  
  
! /**********STATICS**************/
  
  /*static*/ std::vector<FCO *> FCO::intersect( const std::vector<FCO*>& in1, const std::vector<FCO*>& in2)
***************
*** 1207,1212 ****
  	return out;
  }
- 
- 
  
  
--- 948,951 ----

Index: FCO.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/FCO.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** FCO.h	26 Feb 2004 17:12:46 -0000	1.6
--- FCO.h	10 Mar 2004 02:50:18 -0000	1.7
***************
*** 42,46 ****
  	virtual ~FCO(); 
  	virtual KIND_TYPE getMyKind() const = 0;
- 	/*virtual*/ /*std::string getName() const;*/
  
  	// abstract
--- 42,45 ----
***************
*** 53,58 ****
  	const ReferenceRepList& getReferences() const;
  	
  	// 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
--- 52,62 ----
  	const ReferenceRepList& getReferences() const;
  	
+ 	// stores the final references that refer to "this"
+ 	void addFinalRefersToMe( ReferenceRep * ref_obj);
+ 	// gives back the final reference list
+ 	const ReferenceRepList& getFinalReferences() const;
+ 
  	// 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
***************
*** 83,89 ****
  	void addChild( INHERITANCE_TYPE type,  FCO * ptr);
  	// get all parents
! 	const std::vector<FCO *>&  getParents( INHERITANCE_TYPE type);
  	// get all children
! 	const std::vector<FCO *>& getChildren( INHERITANCE_TYPE type);
  
  	// sets the Ancestors and Descendants lists (currently only the INTERFACE and IMPLEMENTATION)
--- 87,93 ----
  	void addChild( INHERITANCE_TYPE type,  FCO * ptr);
  	// get all parents
! 	const std::vector<FCO *>&  getParents( INHERITANCE_TYPE type) const;
  	// get all children
! 	const std::vector<FCO *>& getChildren( INHERITANCE_TYPE type) const;
  
  	// sets the Ancestors and Descendants lists (currently only the INTERFACE and IMPLEMENTATION)
***************
*** 91,94 ****
--- 95,117 ----
  	void setDescendants( INHERITANCE_TYPE type, const std::vector<FCO*> &);
  
+ 	// the desc's/ancest's who share the same intface (REGULAR and INTERFACE combined)
+ 	void getIntDescendants( std::vector<FCO*> & descendants) const;
+ 	void getIntAncestors( std::vector<FCO*> & ancestors) const;
+ 
+ 	// the desc's/ancest's who should have the same constraints and attributes (REGULAR and IMPLEMENTATION combined)
+ 	void getImpDescendants( std::vector<FCO*> & descendants) const;
+ 	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;
+ 	// finds out the same, but in strict sense ( no combining of REGULAR and other)
+ 	bool hasExactParent( const FCO * par, INHERITANCE_TYPE type) const;
+ 
+ 	std::vector<FCO *> getAllChildren() const;
+ 	std::vector<FCO *> getAllParents() const;
+ 
+ 	std::vector<FCO *> getAllAncestors() const;
+ 	std::vector<FCO *> getAllDescendants() const;
+ 
  	// which level in the hierarchy (INT or IMP only!!!)
  	void setLevel( INHERITANCE_TYPE type, int);
***************
*** 99,112 ****
  	int getCliqueId( INHERITANCE_TYPE type);
  
! 	// finds out if "this" has "par" as a "type" parent
! 	bool hasParent( const FCO * par, INHERITANCE_TYPE type) const;
! 
! 	bool hasExactParent( const FCO * par, INHERITANCE_TYPE type) const;
! 	std::vector<FCO *> getAllChildren();
! 	std::vector<FCO *> getAllParents();
! 
! 	std::vector<FCO *> getAllAncestors();
! 	std::vector<FCO *> getAllDescendants();
  
  	bool multipleInheritanceStep1();
  	bool multipleInheritanceStep2();
--- 122,130 ----
  	int getCliqueId( INHERITANCE_TYPE type);
  
! 	// sgets the closest extended ancestor
! 	void setExtedAnc( FCO * ptr);
! 	FCO * getExtedAnc() const;
  
+ 	// multiple and virtual inheritance detectors
  	bool multipleInheritanceStep1();
  	bool multipleInheritanceStep2();
***************
*** 120,131 ****
  	void addVirtualBaseClasses( const std::vector<FCO *>& );
  
- 	// the desc's/ancest's who share the same intface (REGULAR and INTERFACE combined)
- 	void getIntDescendants( std::vector<FCO*> & descendants);
- 	void getIntAncestors( std::vector<FCO*> & ancestors);
- 
- 	// the desc's/ancest's who should have the same constraints and attributes (REGULAR and IMPLEMENTATION combined)
- 	void getImpDescendants( std::vector<FCO*> & descendants);
- 	void getImpAncestors( std::vector<FCO*> & ancestors);
- 
  	// attributes of "this"
  	void addInitialAttribute( AttributeRep * attr);
--- 138,141 ----
***************
*** 136,165 ****
  	bool findFinalAttributeBasedOnName( const std::string & name);
  
! 	std::string dumpAttributes();
! 	std::string dumpAttributeList( bool check_viewable = false);
! 	std::string dumpIcon();
! 	std::string dumpPortIcon();
! 	std::string dumpDecorator();
! 	std::string dumpHotspotEnabled();
! 	std::string dumpTypeDisplayed();
! 	std::string dumpGeneralPref();
! 
! 
! 	static std::vector<FCO *> intersect( const std::vector<FCO*>&, const std::vector<FCO*>&);
! 	static std::vector<FCO *> lcdIntersect( const std::vector<FCO*>&);
! 	static bool equal( std::vector<FCO*>&, std::vector<FCO*>&);
  
  	/*virtual*/ void prepare();
! 	/*virtual*/ void dumpMacros();
  	void prepareAttributes();
  
- 	bool isATopMostObject();
- 	std::string attributesHideExpose();
- 	std::string dumpAttrUsing();
- 	std::string dumpAttrUsingLine( AttributeRep * a);
- 
  	void addClassGlobal( const std::string& m) { m_classGlobalPart += m; }
  	void addConnMethod( Method& m) { m_connectionMethods.push_back( m); }
- 	//void addAttrMethod( Method& m) { m_attributeMethods.push_back( m); }
  	void dumpConnMethods( std::string & h_file, std::string & c_file);
  	void dumpAttrMethods( std::string & h_file, std::string & c_file);
--- 146,157 ----
  	bool findFinalAttributeBasedOnName( const std::string & name);
  
! 	// dumpers
  
  	/*virtual*/ void prepare();
! 	/*virtual*/ void prepareMacros();
  	void prepareAttributes();
  
  	void addClassGlobal( const std::string& m) { m_classGlobalPart += m; }
  	void addConnMethod( Method& m) { m_connectionMethods.push_back( m); }
  	void dumpConnMethods( std::string & h_file, std::string & c_file);
  	void dumpAttrMethods( std::string & h_file, std::string & c_file);
***************
*** 170,187 ****
  
  	virtual std::string hideAndExpose();
! 	virtual std::string expose();
! 	virtual std::string hide();
  
  protected:
- 	std::string methodsToExpose();
- 	std::string exposeConnMethods();
- 	std::string exposeAttrMethods();
- 	std::string methodsToHide();
- 	std::string hideConnMethods();
- 	std::string hideAttrMethods();
- 	
- 	std::vector<Method> m_connectionMethods;
- 	std::vector<Method> m_attributeMethods;
- 	
  	// the IsAbstract attribute value
  	bool m_isAbstract;
--- 162,173 ----
  
  	virtual std::string hideAndExpose();
! 	virtual std::string expose(); //specialize this in the ModelRep, SetRep, ReferenceRep
! 	virtual std::string hide(); //specialize this in the ModelRep, SetRep, ReferenceRep
! 
! 	static std::vector<FCO *> intersect( const std::vector<FCO*>&, const std::vector<FCO*>&);
! 	static std::vector<FCO *> lcdIntersect( const std::vector<FCO*>&);
! 	static bool equal( std::vector<FCO*>&, std::vector<FCO*>&);
  
  protected:
  	// the IsAbstract attribute value
  	bool m_isAbstract;
***************
*** 189,192 ****
--- 175,180 ----
  	// store the list of references which refer to this
  	std::vector<ReferenceRep *> m_references;
+ 	// store the list of references which refer to this and to ancestors
+ 	std::vector<ReferenceRep *> m_finalReferences;
  
  	// models this FCO is Part OF (Containment)
***************
*** 205,212 ****
  	std::vector<FCO *> m_parentList[ NUMBER_OF_INHERITANCES ];
  
! 	// stores all ancestors : currently REGULAR is empty, using causes an assertion
  	std::vector<FCO*> m_ancestors[ NUMBER_OF_INHERITANCES ];
  
! 	// stores all descendants : currently REGULAR is empty, using causes an assertion
  	std::vector<FCO*> m_descendants[ NUMBER_OF_INHERITANCES ];
  
--- 193,200 ----
  	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 ];
  
***************
*** 243,250 ****
  	
  	std::vector<FCO*> m_multipleBaseClasses;
- 
  	std::vector<FCO*> m_virtualBaseClasses;
  
  	std::string m_classGlobalPart;
  
  private: // forbiding copy
--- 231,249 ----
  	
  	std::vector<FCO*> m_multipleBaseClasses;
  	std::vector<FCO*> m_virtualBaseClasses;
  
  	std::string m_classGlobalPart;
+ 
+ 	std::vector<Method> m_connectionMethods;
+ 	std::vector<Method> m_attributeMethods;
+ 
+ 	FCO * m_extedAnc;
+ 
+ 	// protected methods
+ 	std::string exposeConnMethods();
+ 	std::string exposeAttrMethods();
+ 	std::string hideConnMethods();
+ 	std::string hideAttrMethods();
+ 	
  
  private: // forbiding copy

Index: FcoRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/FcoRep.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FcoRep.cpp	26 Feb 2004 17:12:46 -0000	1.2
--- FcoRep.cpp	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 6,11 ****
  #include "FcoRep.h"
  #include "logger.h"
- #include "ConstraintRep.h"
- #include "ConstraintFuncRep.h"
  
  FcoRep::FcoRep( BON::FCO& ptr): FCO( ptr)
--- 6,9 ----
***************
*** 31,63 ****
  }
  
- /*std::string FcoRep::hideAndExpose()
- {
- 	std::string hdr, public_part, private_part;
- 	std::vector<FCO *>::iterator imp_it = m_parentList[ IMPLEMENTATION ].begin();
- 	for( ; imp_it != m_parentList[ IMPLEMENTATION ].end(); ++imp_it)
- 	{
- 		public_part += (*imp_it)->methodsExposed();
- 	}
- 
- 	std::vector<FCO *>::iterator int_it = m_parentList[ INTERFACE ].begin();
- 	for( ; int_it != m_parentList[ INTERFACE ].end(); ++int_it)
- 	{
- 		private_part += (*int_it)->methodsHidden();
- 	}
- 
- 	if ( !private_part.empty())
- 		hdr += "private: // hide members\n" + private_part;
- 	if ( !public_part.empty())
- 		hdr += "public: // expose members\n" + public_part;
- 
- 
- 	imp_it = m_parentList[ IMPLEMENTATION ].begin();
- 	for( ; imp_it != m_parentList[ IMPLEMENTATION ].end(); ++imp_it)
- 	{
- 		FcoRep * s = static_cast<FcoRep*>( *imp_it);
- 		hdr += s->hideAndExpose();
- 	}
- 	
- 
- 	return hdr;
- }*/
--- 29,30 ----

Index: FcoRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/FcoRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FcoRep.h	26 Feb 2004 17:12:46 -0000	1.2
--- FcoRep.h	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 13,17 ****
  	Any::KIND_TYPE getMyKind() const { return Any::FCO_REP; }
  	std::string doDump();
- 	/*std::string hideAndExpose();*/
  
  private: // forbiding copy
--- 13,16 ----

Index: FolderRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/FolderRep.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** FolderRep.cpp	26 Feb 2004 17:12:46 -0000	1.5
--- FolderRep.cpp	10 Mar 2004 02:50:18 -0000	1.6
***************
*** 10,19 ****
  
  
  std::string FolderRep::getName() const
  {
  	if (m_respPointer == BON::FCO())
  		return std::string("Null pointer error in getFolderName");
! 	BON::FCO bon_ptr( this->m_respPointer);
! 	return bon_ptr->getName();
  }
  
--- 10,43 ----
  
  
+ FolderRep::FolderRep( BON::FCO& ptr, BON::FCO& resp_ptr) 
+ 	: Any( ptr)
+ 	, m_fcoList()
+ 	, m_fcoCardList()
+ 	, m_subFolderList()
+ 	, m_subCardList()
+ 	, m_respPointer( resp_ptr)
+ 	, m_methods()
+ { 
+ }
+ 
+ FolderRep::~FolderRep() 
+ { 
+ 	m_fcoList.clear();
+ 	m_fcoCardList.clear();
+ 	m_subFolderList.clear();
+ 	m_subCardList.clear();
+ 	m_respPointer = BON::FCO();
+ 	m_methods.clear();
+ }
+ 
+ 	
  std::string FolderRep::getName() const
  {
  	if (m_respPointer == BON::FCO())
+ 	{
+ 		global_vars.err << "Null pointer error in getFolderName\n";
  		return std::string("Null pointer error in getFolderName");
! 	}
! 	return m_respPointer->getName();
  }
  
***************
*** 56,93 ****
  
  
- void FolderRep::extendMembership()
- {
- 	std::vector<FCO *> temp_list;
- 	FCO_Iterator fco_it = m_fcoList.begin();
- 	for( ; fco_it != m_fcoList.end(); ++fco_it)
- 	{
- 		FCO * fco_ptr = *fco_it;
- 		std::vector<FCO*> descendants;
- 		fco_ptr->getIntDescendants( descendants);
- 		std::vector<FCO*>::iterator desc_it = descendants.begin();
- 		for( ; desc_it != descendants.end(); ++desc_it)
- 		{
- 			FCO * new_member = *desc_it;
- 			if ( temp_list.end() == 
- 				std::find( temp_list.begin(), temp_list.end(), new_member)) // not found
- 				temp_list.push_back( new_member);
- 		}
- 	}
- 	// append the temp_list to the end of the fco_list
- 	m_fcoList.insert( m_fcoList.end(), temp_list.begin(), temp_list.end());
- }
- 
- 
- /*
- This function must be called before the extend(), because the cardinalities 
- are consistent till that point
- 
- Presumption: m_fcoList[i] has m_fcoCardList[i] cardinality
- */
- void FolderRep::createConstraints( Sheet * s)
- {
- }
- 
- 
  void FolderRep::createMethods()
  {
--- 80,83 ----
***************
*** 106,119 ****
  
  
- /*static*/ std::string FolderRep::subFolderGetterMethodName(FolderRep * fold)
- {
- #if(LONG_NAMES)
- 	return "get_Sub_" + fold->getName();
- #else
- 	return "get" + fold->getName();
- #endif
- }
- 
- 
  std::string FolderRep::doDump()
  {
--- 96,99 ----
***************
*** 142,143 ****
--- 122,145 ----
  	return "";
  }
+ 
+ 
+ /*static*/ std::string FolderRep::subFolderGetterMethodName(FolderRep * fold)
+ {
+ #if(LONG_NAMES)
+ 	return "get_Sub_" + fold->getName();
+ #else
+ 	return "get" + fold->getName();
+ #endif
+ }
+ 
+ 
+ /*static*/ std::string FolderRep::kindGetterMethodName(FCO * fco)
+ {
+ #if(LONG_NAMES)
+ 	return "get_Kind_" + fco->getName();
+ #else
+ 	return "get" + fco->getName();
+ #endif
+ }
+ 
+ 

Index: FolderRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/FolderRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FolderRep.h	26 Feb 2004 17:12:46 -0000	1.2
--- FolderRep.h	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 3,9 ****
  
  #include "Any.h"
- #include "PartRep.h"
  #include "FCO.h"
- #include "ConstraintFuncRep.h"
  #include "FolderRep.h"
  #include "ModelRep.h"
--- 3,7 ----
***************
*** 44,62 ****
  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; }
--- 42,47 ----
  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; }
***************
*** 70,78 ****
  	std::string doDump();
  
! 	void extendMembership();
! 	void createConstraints( Sheet * s);
  	void createMethods();
  	static std::string subFolderGetterMethodName(FolderRep * fold);
! 	void addMethod(Method& m) { m_methods.push_back( m); }
  
  protected:
--- 55,63 ----
  	std::string doDump();
  
! 	void addMethod(Method& m) { m_methods.push_back( m); }
  	void createMethods();
+ 
  	static std::string subFolderGetterMethodName(FolderRep * fold);
! 	static std::string kindGetterMethodName( FCO * fco);
  
  protected:

Index: Method.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Method.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Method.cpp	26 Feb 2004 17:12:46 -0000	1.3
--- Method.cpp	10 Mar 2004 02:50:18 -0000	1.4
***************
*** 27,31 ****
  {
  	std::string ret_val = (m_virtual?"virtual ":"") + m_returnValue;
! 	int fill_size = (ret_val.size() < 20)? 20 - ret_val.size(): ret_val.size() < 40? 40-ret_val.size():1;
  	return CodeGen::indent(1) + ret_val + CodeGen::fill( fill_size) + m_signature + ";";
  }
--- 27,31 ----
  {
  	std::string ret_val = (m_virtual?"virtual ":"") + m_returnValue;
! 	int fill_size = ret_val.size() < 20? 20 - ret_val.size(): ret_val.size() < 32? 32-ret_val.size(): ret_val.size() < 44? 44-ret_val.size():1;
  	return CodeGen::indent(1) + ret_val + CodeGen::fill( fill_size) + m_signature + ";";
  }

Index: ModelRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/ModelRep.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ModelRep.cpp	26 Feb 2004 17:12:46 -0000	1.7
--- ModelRep.cpp	10 Mar 2004 02:50:18 -0000	1.8
***************
*** 16,19 ****
--- 16,36 ----
  
  
+ ModelRep::ModelRep( BON::FCO& ptr)
+ 	: FCO( ptr)
+ 	, m_initialRoleMap()
+ 	, m_finalRoleMap()
+ 	, m_methods()
+ { 
+ }
+ 
+ 
+ ModelRep::~ModelRep()
+ {
+ 	m_initialRoleMap.clear();
+ 	m_finalRoleMap.clear();
+ 	m_methods.clear();
+ }
+ 
+ 	
  void ModelRep::addRole( FCO* whose, RoleSeriesValue& role) 
  { 
***************
*** 33,37 ****
  void ModelRep::initRoles()
  {
- 	
  	RoleMap_Iterator it = m_initialRoleMap.begin();
  	for( ; it != m_initialRoleMap.end(); ++it)
--- 50,53 ----
***************
*** 103,124 ****
  
  
- void ModelRep::addAspect( AspectRep * asp_ptr)
- {
- 	std::vector<AspectRep*>::iterator ii = 
- 		std::find( m_initialAspectList.begin(), m_initialAspectList.end(), asp_ptr);
- 
- 	if (ii == m_initialAspectList.end()) // not found
- 		m_initialAspectList.push_back(asp_ptr);
- 	else
- 		global_vars.err << "CHECK: Model \"" << getName() << "\" has aspect \"" << asp_ptr->getName() << "\" associated twice\n";
- }
- 
- 
- const ModelRep::AspectRepPtrList& ModelRep::getAspectRepPtrList() const
- {
- 	return m_initialAspectList;
- }
- 
- 
  /*------------------------------------------------------------*/
  
--- 119,122 ----
***************
*** 217,222 ****
  	
  	RoleMap temp_map;
! 	std::vector<FCO*> model_descendants;//= getAllDescendants();
! 	//this->getImpDescendants( model_descendants);*/
  	model_descendants.push_back( this);
  
--- 215,220 ----
  	
  	RoleMap temp_map;
! 	std::vector<FCO*> model_descendants;
! 	this->getImpDescendants( model_descendants); // needed because of complexity
  	model_descendants.push_back( this);
  
***************
*** 236,240 ****
  		{ 
  			RoleMapKey fco_ptr = fco_it->first;
! 			std::vector<FCO*> children; /*= getAllDescendants();*/
  			
  			fco_ptr->getIntDescendants( children);
--- 234,238 ----
  		{ 
  			RoleMapKey fco_ptr = fco_it->first;
! 			std::vector<FCO*> children;
  			
  			fco_ptr->getIntDescendants( children);
***************
*** 261,265 ****
  						*desc_it,
  						mod_desc_ptr,//role_it->getModelRepPtr(), // = this
- 						//role_it->getOwnerModelRepPtr(),
  						role_it->isPort(),
  						role_it->getCardinality(),
--- 259,262 ----
***************
*** 277,425 ****
  
  
- void ModelRep::createPartsInModelAspects()
- {
- 	RoleMap_Iterator role_it = m_finalRoleMap.begin();
- 	// for all roles in this model
- 	for( ; role_it != m_finalRoleMap.end(); ++role_it)
- 	{
- 		std::vector<AspectRep*>::iterator asp_it( m_finalAspectList.begin());
- 		// for all my aspects 
- 		for( ; asp_it != m_finalAspectList.end(); ++asp_it)
- 		{
- 			// the fco which owns the roles
- 			RoleMapKey fco_ptr = role_it->first;
- 			// if part (fco) is intended to be in the aspect
- 			if ( !fco_ptr->isAbstract() && (*asp_it)->findFinalFCO( fco_ptr))
- 			{
- 				RoleSeries_Iterator jt = role_it->second.begin();
- 				// for each role of fco
- 				for( ; jt != role_it->second.end() ; ++jt)
- 				{
- 					PartRep pr( *jt, *asp_it, 0, 1, 1);
- 					// create parts in the aspect
- 					(*asp_it)->addPart2Map( this, pr);
- 				}
- 			}
- 		}
- 	}
- }
- 
- 
- const ModelRep::AspectRepPtrList& ModelRep::getFinalAspectRepPtrList() const
- {
- 	return m_finalAspectList;
- }
- 
- 
- void ModelRep::addFinalAspect( AspectRep * asp_ptr)
- {
- 	std::vector<AspectRep*>::iterator ii = 
- 		std::find( m_finalAspectList.begin(), m_finalAspectList.end(), asp_ptr);
- 
- 	if (ii == m_finalAspectList.end()) // not found
- 		m_finalAspectList.push_back(asp_ptr);
- 	/*else Not an error because of multiple inheritance
- 		global_vars.err << getName() << " has aspect " << asp_ptr->getName() << " associated twice\n";*/
- }
- 
- 
- void ModelRep::addFinalAspectList(const AspectRepPtrList& l)
- {
- 	std::vector<AspectRep*>::const_iterator ii = l.begin();
- 	for( ; ii != l.end(); ++ii)
- 		addFinalAspect(*ii);
- }
- 
- 
- int ModelRep::howManyAspects() const
- {
- 	return m_finalAspectList.size();
- }
- 
- 
- AspectRep * ModelRep::getFirstAspect() const
- {
- 	unsigned int i;
- 	unsigned int min_y = 5000, min_x = 5000, sel_i = -1;
- 	for( i = 0; i < m_finalAspectList.size(); ++i)
- 	{
- 		AspectRep * asp_ptr = m_finalAspectList[i];
- 		unsigned int t_min_x = min_x, t_min_y = min_y;
- 		asp_ptr->getXY( &t_min_x, &t_min_y);
- 		if ( (min_y > t_min_y) || (min_y == t_min_y && min_x > t_min_x ))
- 		{
- 			min_y = t_min_y;
- 			min_x = t_min_x;
- 			sel_i = i;
- 		}
- 	}
- 	if ( sel_i != -1) return m_finalAspectList[sel_i];
- 	else return 0;
- }
- 
- 
- bool ModelRep::findAspect( const AspectRep * one_asp) const
- {
- 	std::vector<AspectRep*>::const_iterator ii = 
- 		std::find( m_finalAspectList.begin(), m_finalAspectList.end(), one_asp);
- 
- 	return ii != m_finalAspectList.end(); // found
- }
- 
- 
- /* 
- how many of my aspects contain FCO as an aspect member
- */
- int ModelRep::searchMyAspectsForFCO( const FCO* asp_element) const
- {
- 	unsigned int i = 0;
- 	int count = 0;
- 	while ( i < m_finalAspectList.size())
- 	{
- 		if ( m_finalAspectList[i]->findFinalFCO( asp_element))
- 			++count;
- 		++i;
- 	}
- 	return count;
- }
- 
- 
- void ModelRep::getAspectNames(CStringList &list) const
- {
- 	unsigned int i = 0;
- 	while ( i < m_finalAspectList.size())
- 	{
- 		list.AddTail(m_finalAspectList[i]->getName().c_str());
- 		++i;
- 	}
- }
- 
- 
  bool ModelRep::check()
  {
! 	bool no = (howManyAspects() >= 1);
! 	if (!no) 
! 		global_vars.err << getName() + " model has no aspect\n";
! 	return no;
! }
! 
! 
! /*static*/ std::string ModelRep::kindGetterMethodName(FCO * fco)
! {
! #if(LONG_NAMES)
! 	return "get_Kind_" + fco->getName();
! #else
! 	return "get" + fco->getName();
! #endif
! }
! 
! 
! /*static*/ std::string ModelRep::roleGetterMethodName(FCO * fco, const std::string& role, bool use_fco_name)
! {
! #if(LONG_NAMES)
! 	return "get_Role_" + (role.empty()?"ERN":role);
! #else
! 	return "get" + (role.empty()?"ERN":role);
! #endif
  }
  
--- 274,280 ----
  
  
  bool ModelRep::check()
  {
! 	return true;
  }
  
***************
*** 453,457 ****
  void ModelRep::createMethods()
  {
- 	//--//--commented out on 2/2/2004
  	RoleMap_Iterator r_it = m_initialRoleMap.begin();
  	while ( r_it != m_initialRoleMap.end())
--- 308,311 ----
***************
*** 466,488 ****
  		++r_it;
  	}
- 
- 	// all roles (final)
- 	RoleMap_Iterator it = /*m_initialRoleMap.begin();//*/m_finalRoleMap.begin();
- 	while ( it != /*m_initialRoleMap.end())//*/m_finalRoleMap.end())
- 	{
- 		RoleMapKey ptr = it->first;
- 		//ModelRep::dumpKindGetter( ptr, this);
- 
- 		RoleMapValue &roles = it->second;
- 		RoleSeries_Iterator jt = roles.begin();
- 		for( ; jt != roles.end() ; ++jt)
- 		{
- 			//if ( jt->getOwnerModelRepPtr() == this)
- 			{
- 				//ModelRep::dumpRoleGetter( ptr, &*jt, this);
- 			}
- 		}
- 		++it;
- 	}
  }
  
--- 320,323 ----
***************
*** 524,528 ****
  {
  	std::string h_file;
- 	//h_file += FCO::methodsExposed();
  	h_file += FCO::expose();
  
--- 359,362 ----
***************
*** 540,544 ****
  {
  	std::string h_file;
- 	//h_file += FCO::methodsHidden();
  	h_file += FCO::hide();
  
--- 374,377 ----

Index: ModelRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/ModelRep.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ModelRep.h	26 Feb 2004 17:12:46 -0000	1.3
--- ModelRep.h	10 Mar 2004 02:50:18 -0000	1.4
***************
*** 4,8 ****
  #define MODELREP_H
  #include "Any.h"
- #include "AspectRep.h"
  #include "RoleRep.h"
  #include "FCO.h"
--- 4,7 ----
***************
*** 31,52 ****
  	typedef RoleMap::iterator RoleMap_Iterator;
  	typedef RoleMap::const_iterator RoleMap_ConstIterator;
- 	// aspects
- 	typedef std::vector<AspectRep*> AspectRepPtrList;
  
  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; }
--- 30,37 ----
  	typedef RoleMap::iterator RoleMap_Iterator;
  	typedef RoleMap::const_iterator RoleMap_ConstIterator;
  
  public:
! 	ModelRep( BON::FCO& ptr);
! 	~ModelRep();
  
  	inline Any::KIND_TYPE getMyKind() const { return Any::MODEL; }
***************
*** 57,60 ****
--- 42,46 ----
  	void initRoles();
  	bool getRoles( FCO * ptr, RoleMapValue& ) const;
+ 
  	// Final roles
  	void addFinalRole( RoleMapKey whose, RoleRep& role);
***************
*** 66,102 ****
  	std::vector< ReferenceRep *> getInnerModelReferencesFinal() const;
  
- 	// aspects
- 	void addAspect( AspectRep * asp);
- 	const AspectRepPtrList& getAspectRepPtrList() const;
- 	// final
- 	const AspectRepPtrList& getFinalAspectRepPtrList() const;
- 	void addFinalAspect( AspectRep *);
- 	void addFinalAspectList(const AspectRepPtrList& l);
- 
- 	void getAspectNames( CStringList &list) const;
- 	AspectRep * getFirstAspect() const;
- 
- 	// search
- 	int searchMyAspectsForFCO( const FCO* asp_element) const; // how many of my aspects contain FCO as an aspect member
- 	bool findAspect( const AspectRep * one_asp) const;
- 	int howManyAspects() const; // how many aspects has this model
- 	
  	bool check();
  	void inherit();
- 	void createPartsInModelAspects();
- 
- 
- 	static std::string kindGetterMethodName( FCO * fco);
- 	static std::string roleGetterMethodName( FCO * fco, const std::string& role, bool use_fco_name);
- 	static std::string roleGetterMethodName2( FCO * fco, RoleRep* role, bool use_fco_name);
- 	static std::string roleGetterMethodName3( FCO * fco, RoleRep* role, bool use_fco_name);
  
  	void addMethod(Method& m) { m_methods.push_back( m); }
- 	std::string modGetterTemplate(FCO *);
- 
  	void createMethods();
  	std::string expose();
  	std::string hide();
  
  protected:
  	RoleMap m_initialRoleMap;
--- 52,66 ----
  	std::vector< ReferenceRep *> getInnerModelReferencesFinal() const;
  
  	bool check();
  	void inherit();
  
  	void addMethod(Method& m) { m_methods.push_back( m); }
  	void createMethods();
  	std::string expose();
  	std::string hide();
  
+ 	static std::string roleGetterMethodName2( FCO * fco, RoleRep* role, bool use_fco_name);
+ 	static std::string roleGetterMethodName3( FCO * fco, RoleRep* role, bool use_fco_name);
+ 
  protected:
  	RoleMap m_initialRoleMap;
***************
*** 105,111 ****
  	std::vector<Method> m_methods;
  	
- 	AspectRepPtrList m_initialAspectList;
- 	AspectRepPtrList m_finalAspectList;
- 
  private: // forbid copying
  	ModelRep( const ModelRep&);
--- 69,72 ----

Index: PointerItem.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/PointerItem.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PointerItem.h	4 Dec 2003 16:45:26 -0000	1.1
--- PointerItem.h	10 Mar 2004 02:50:18 -0000	1.2
***************
*** 26,30 ****
  	bool operator !=( const PointerItem& peer) const;
  	const std::string& name() const;
! 	FCO * fcoPtr() const;
  };
  
--- 26,30 ----
  	bool operator !=( const PointerItem& peer) const;
  	const std::string& name() const;
! 	FCO * fcoPtr() const; //<!> is this needed?
  };
  

Index: ReferenceRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/ReferenceRep.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ReferenceRep.cpp	26 Feb 2004 17:12:46 -0000	1.4
--- ReferenceRep.cpp	10 Mar 2004 02:50:18 -0000	1.5
***************
*** 16,23 ****
  
  ReferenceRep::ReferenceRep( BON::FCO& ptr)
! : FCO( ptr),
! 	m_initialReferees(),
! 	m_finalReferees(),
! 	m_allReferees()
  {
  }
--- 16,23 ----
  
  ReferenceRep::ReferenceRep( BON::FCO& ptr)
! 	: FCO( ptr)
! 	, m_initialReferees()
! 	, m_finalReferees()
! 	, m_allReferees()
  {
  }
***************
*** 61,65 ****
  
  /*
! Return true if the reference refers to a Model (beside other kinds like FCO or Reference)
  -----------------------------------------------------------------------------------------------
  Since the inheritance is allowed to be homogenous the result is not depending 
--- 61,65 ----
  
  /*
! Return true if the reference refers to a Model (a non abstract model) beside other kinds like FCO or Reference
  -----------------------------------------------------------------------------------------------
  Since the inheritance is allowed to be homogenous the result is not depending 
***************
*** 73,76 ****
--- 73,77 ----
  	bool to_models = true;
  	KIND_TYPE kind;
+ 
  	for( unsigned int i = 0; i < m_allReferees.size(); ++i)
  	{
***************
*** 78,87 ****
  		if( kind != Any::FCO_REP && kind != Any::REF)
  		{
! 			to_models = to_models && (kind == Any::MODEL);
! 			value_set = true;
! 			if (kind == Any::MODEL)
  			{
! 				how_many_models += 1;
! 				which_models += m_allReferees[i]->getName() + " ";
  			}
  		}
--- 79,94 ----
  		if( kind != Any::FCO_REP && kind != Any::REF)
  		{
! 			// consider the non-abstracts models only
! 			if ( !m_allReferees[i]->isAbstract())
  			{
! 				to_models = to_models && (kind == Any::MODEL);
! 
! 				value_set = true;
! 
! 				if (kind == Any::MODEL)
! 				{
! 					how_many_models += 1;
! 					which_models += m_allReferees[i]->getName() + " ";
! 				}
  			}
  		}
***************
*** 94,117 ****
  
  /*
! Should return a ModelRep * if pointToModels is true
  */
! const ModelRep * ReferenceRep::getModelRef() const
  {
  	unsigned int i = 0;
! 	while( i < m_allReferees.size() && m_allReferees[i]->getMyKind() != Any::MODEL)
! 		++i;
! 
! 	if ( i == m_allReferees.size()) // not found any model, how come?
! 		return 0;
! 	else 
  	{
! 		unsigned int j = i+1; // look for other models 
! 		while( j < m_allReferees.size() && m_allReferees[j]->getMyKind() != Any::MODEL)
! 			++j;
! 		if ( j != m_allReferees.size()) // found another one
! 			global_vars.err << "Notice: reference \"" << getName() << "\" referring to many models. Considering only the first: " << m_allReferees[i]->getName() << "\n";
! 		
! 		return static_cast<const ModelRep*>( m_allReferees[i]);
  	}
  }
  
--- 101,123 ----
  
  /*
! 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;
  }
  
***************
*** 125,128 ****
--- 131,136 ----
  		m_finalReferees.push_back( referee);
  	else { } // can happen if multiple inheritance is used
+ 
+ 	referee->addFinalRefersToMe( this);
  }
  
***************
*** 132,136 ****
--- 140,147 ----
  	RefereeList_Iterator referee_it = referees.begin();
  	for( ; referee_it != referees.end(); ++referee_it)
+ 	{
  		addFinalReferees( *referee_it);
+ 		(*referee_it)->addFinalRefersToMe( this);
+ 	}
  }
  
***************
*** 139,143 ****
  {
  	std::vector<FCO*> refnce_descendants;
! 	//this->getImpDescendants( refnce_descendants);
  	refnce_descendants.push_back( this);
  
--- 150,154 ----
  {
  	std::vector<FCO*> refnce_descendants;
! 	this->getImpDescendants( refnce_descendants); //implementation inheritance needed because the common ancestor of all referees is to be returned
  	refnce_descendants.push_back( this);
  
***************
*** 170,173 ****
--- 181,188 ----
  bool ReferenceRep::finalize()
  {
+ 	m_allReferees = m_finalReferees;
+ 	return true; //<!>
+ 	// right now do not perform the calc
+ 
  	bool value_set = false;
  	bool same_kind = true;
***************
*** 213,218 ****
  void ReferenceRep::createMethods() 
  { 
  	std::string getter_src, getter_hdr;
! 	std::vector<FCO*> common_anc = FCO::lcdIntersect( m_initialReferees);//m_allReferees);
  	if ( !common_anc.empty())
  	{
--- 228,235 ----
  void ReferenceRep::createMethods() 
  { 
+ 	if ( m_initialReferees.empty()) return; // in such cases no specific getter is added, its base (if any) provides anyway the needed methods
+ 
  	std::string getter_src, getter_hdr;
! 	std::vector<FCO*> common_anc = FCO::lcdIntersect( m_finalReferees); // the reference may point to all of these fcos
  	if ( !common_anc.empty())
  	{
***************
*** 221,225 ****
  			m_refGetterMethods.push_back( CodeGen::dumpRefGetter( this, *c_it, ""));
  	}
! 	else if ( common_anc.empty() && !m_initialReferees.empty()) // empty
  	{
  		m_refGetterMethods.push_back( CodeGen::dumpRefGetter( this, 0, ""));
--- 238,242 ----
  			m_refGetterMethods.push_back( CodeGen::dumpRefGetter( this, *c_it, ""));
  	}
! 	else if ( common_anc.empty()) // empty, use BON::FCO
  	{
  		m_refGetterMethods.push_back( CodeGen::dumpRefGetter( this, 0, ""));
***************
*** 337,341 ****
  { 
  	std::string h_file;
- 	//h_file += FCO::methodsExposed();
  	h_file += FCO::expose();
  
--- 354,357 ----
***************
*** 355,359 ****
  { 
  	std::string h_file;
- 	//h_file += FCO::methodsHidden();
  	h_file += FCO::hide();
  	
--- 371,374 ----

Index: ReferenceRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/ReferenceRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ReferenceRep.h	26 Feb 2004 17:12:46 -0000	1.2
--- ReferenceRep.h	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 23,34 ****
  	const RefereeList& getInitialReferees() const;
  	
- 	const ModelRep * getModelRef() 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;
--- 23,35 ----
  	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;
  
  	bool checkNotEmpty() const;
***************
*** 40,47 ****
  	std::string dumpUsingLine( FCO *);
  	void createMethods();
- 	/*std::string refGetterHideAndExpose();
- 	std::string refGetterExposed();
- 	std::string refGetterHidden();*/
- 	/*std::string hideAndExpose();*/
  	std::string expose();
  	std::string hide();
--- 41,44 ----

Index: RoleRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/RoleRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RoleRep.h	2 Feb 2004 21:36:26 -0000	1.2
--- RoleRep.h	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 8,12 ****
  class AtomRep;
  class ReferenceRep;
- class PartRep;
  class FCO;
  
--- 8,11 ----
***************
*** 34,38 ****
  		FCO* ptr, 
  		ModelRep* model_ptr,
- 		//ModelRep* model_ptr_owner,
  		bool is_port,
  		const std::string &cardinality,
--- 33,36 ----
***************
*** 53,57 ****
  	FCO * getFCOPtr() const;
  	ModelRep * getModelRepPtr() const;
- 	//ModelRep * getOwnerModelRepPtr() const;
  	bool isPort() const;
  	const std::string& getCardinality() const;
--- 51,54 ----
***************
*** 67,71 ****
  	FCO* m_ptr;
  	ModelRep * m_model;
- 	//ModelRep * m_ownerModel;
  	bool m_isPort;
  	std::string m_cardinality;
--- 64,67 ----

Index: RootFolder.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/RootFolder.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RootFolder.cpp	4 Dec 2003 16:45:26 -0000	1.1
--- RootFolder.cpp	10 Mar 2004 02:50:18 -0000	1.2
***************
*** 14,20 ****
  
  
! bool RootFolder::isInRoot( FCO * ptr)
  {
! 	FCO_Iterator fco_it = std::find( m_fcoList.begin(), m_fcoList.end(), ptr);
  	return fco_it != m_fcoList.end();
  }
--- 14,20 ----
  
  
! bool RootFolder::isInRoot( FCO * ptr) const
  {
! 	FCO_ConstIterator fco_it = std::find( m_fcoList.begin(), m_fcoList.end(), ptr);
  	return fco_it != m_fcoList.end();
  }
***************
*** 27,84 ****
  
  
- std::string RootFolder::headDump() 
- { 
- 	++ind;
- 	std::string mmm = indStr() + "<folder name = \"RootFolder\" metaref = \"1000\" ";
- 
- 	AnyLexicographicSort lex;
- 	std::sort( m_subFolderList.begin(), m_subFolderList.end(), lex);
- 	SubFolder_ConstIterator it_f = m_subFolderList.begin();
- 	if  ( it_f != m_subFolderList.end())
- 	{
- 		mmm +=" subfolders = \"";
- 		bool first = true;
- 		while( it_f != m_subFolderList.end())
- 		{
- 			if (!first) mmm += " ";
- 			mmm += (*it_f)->getName();
- 			first = false;
- 			++it_f;
- 		}
- 		mmm +="\"";
- 	}
- 
- 	std::sort( m_fcoList.begin(), m_fcoList.end(), lex);
- 
- 	FCO_ConstIterator it = m_fcoList.begin();
- 	if ( it != m_fcoList.end())
- 	{
- 		std::string nnn;
- 		bool first = true;
- 		while ( it != m_fcoList.end())
- 		{
- 			if ((*it)->isFCO() && !(*it)->isAbstract())
- 			{
- 				if ( !first) nnn += " ";
- 				nnn += (*it)->getName();
- 				first = false;
- 			}
- 			++it;
- 		}
- 		
- 		if (!nnn.empty()) 
- 			mmm += " rootobjects = \"" + nnn + "\"";
- 	}
- 	mmm +=" >\n";
- 	return mmm;
- }
- 
- 
- std::string RootFolder::tailDump() 
- { 
- 	--ind;
- 	std::string mmm;
- 	mmm = indStr() + "</folder>\n";
- 
- 	return mmm;
- }
--- 27,28 ----

Index: RootFolder.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/RootFolder.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RootFolder.h	4 Dec 2003 16:45:26 -0000	1.1
--- RootFolder.h	10 Mar 2004 02:50:18 -0000	1.2
***************
*** 3,9 ****
  
  #include "Any.h"
- #include "PartRep.h"
  #include "FCO.h"
- #include "ConstraintFuncRep.h"
  #include "FolderRep.h"
  #include "ModelRep.h"
--- 3,7 ----
***************
*** 38,48 ****
  
  	void addRootElement( FCO * ptr);
! 	bool isInRoot( FCO * ptr);
  
  	void addSubFolder( FolderRep * ptr);
- 
- 	std::string headDump();
- 	std::string tailDump();
- 
  
  protected:
--- 36,42 ----
  
  	void addRootElement( FCO * ptr);
! 	bool isInRoot( FCO * ptr) const;
  
  	void addSubFolder( FolderRep * ptr);
  
  protected:

Index: SetRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/SetRep.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SetRep.cpp	26 Feb 2004 17:12:46 -0000	1.4
--- SetRep.cpp	10 Mar 2004 02:50:18 -0000	1.5
***************
*** 26,132 ****
  
  
- // adds new role to the potential lists of set elements in model!!!
- void SetRep::addSetMemberRole( const ModelRep * model, const RoleRep& role)
- { 
- 	PointerItemSeries & series = m_memberMap[model];
- 	PointerItem item = role.getSmartRoleName();
- 	
- 	PointerItemSeries_Iterator it = std::find( series.begin(), series.end() ,item);
- 
- 	//global_vars.err << "Role \"" << role.getSmartRoleName() << "\" in set \"" << getName() << ":" << model->getName() <<"\"\n";
- 	if ( it == series.end() ) // not found
- 		series.push_back( item);
- 	else 
- 		{ /*global_vars.err << "Notice: found duplicate role \"" << role.getSmartRoleName() << "\" in set \"" << getName() << ":" << model->getName() << "\"\n";*/ }
- }
- 
- 
- // adds new roles to the potential lists of set elements in model!!!
- void SetRep::addSetMemberRole( const ModelRep * model, const RoleRep::RoleRepSeries & role_series)
- { 
- 	RoleRep::RoleRepSeries_ConstIterator role_it = role_series.begin();
- 	for( ; role_it != role_series.end(); ++role_it)
- 		addSetMemberRole( model, *role_it);
- }
- 
- 
- //
- // SetRep::createElements
- //
- // expands the set and connection targets with roleNames like below as (elementNames)
- //
- // i.e.:      S
- //          / | \
- //        /   |   \
- //      /    < >    \
- //    M1-r1---A---r2-M2
- //    M1-R1--/ \--R2-M2
- //
- // in this case S has at first A as a member, but after the completion of this task
- // S will have elements like r1, R1 (in M1), r2, R2 ( in M2)
- void SetRep::inherit()
- {
- 	std::vector<FCO*> set_descendants;
- 	//this->getImpDescendants( set_descendants);
- 	set_descendants.push_back( this);
- 	//global_vars.err << "Inheriting from set: "<< getName() << "\n";
- 
- 	// this set is contained by the following models
- 	ModelRepPtrList models = this->modelsIAmPartOfFinal();
- 	ModelRepPtrList_Iterator mod_it = models.begin();
- 	// for all models that contain this set
- 	for( ; mod_it != models.end(); ++mod_it )
- 	{
- 		ModelRep* mod_ptr = *mod_it; 
- 		// we don't have to care with the impl inh between models since all model related
- 		// inheritances are taken into account
- 		//global_vars.err << "In model " << mod_ptr->getName() << "\n";
- 
- 		// for all members of the set
- 		SetMemberList_ConstIterator member_it = m_memberList.begin();
- 		for( ; member_it != m_memberList.end(); ++member_it)
- 		{
- 			FCO * member_ptr = *member_it;
- 			std::vector<FCO*> children;
- 		
- 			//global_vars.err << "For all desc's of " << member_ptr->getName() << "\n";
- 
- 			member_ptr->getIntDescendants( children);
- 			children.push_back( member_ptr);
- 
- 			// for all int desc of current set member
- 			std::vector<FCO*>::reverse_iterator child_it = children.rbegin();
- 			for( ; child_it != children.rend(); ++child_it)
- 			{
- 				FCO * child_member_ptr = * child_it;
- 				if ( !child_member_ptr->isAbstract())
- 				{
- 					RoleRep::RoleRepSeries series;
- 					mod_ptr->getFinalRoles( child_member_ptr, series); //member_ptr->getMyRoles( mod_ptr);
- 
- 					if ( !series.empty())
- 					{
- 						std::vector<FCO*>::reverse_iterator sets_iterator = set_descendants.rbegin();
- 						for( ; sets_iterator != set_descendants.rend(); ++sets_iterator )
- 						{
- 							if ( (*sets_iterator)->getMyKind() != Any::SET) 
- 								global_vars.err << "Non-set descendant: " << (*sets_iterator)->getName() <<" of set: " << getName() <<"\n";
- 							else
- 							{
- 								SetRep* one_set = static_cast<SetRep *>(*sets_iterator);
- 								std::string set_nm = one_set->getName();
- 								// add the roles to the member list of the set ( in that model) 
- 								one_set->addSetMemberRole( mod_ptr, series);
- 								//TO("Previous element names have been added to " + this->getName() + "[" + mod_ptr->getName() + "]");
- 							}
- 						}
- 					}
- 				}
- 			}
- 		}
- 	}
- }
- 
- 
  void SetRep::createMethods()
  {
--- 26,29 ----
***************
*** 214,218 ****
  {
  	std::string h_file;
- 	//h_file += FCO::methodsExposed();
  	h_file += FCO::expose();
  
--- 111,114 ----
***************
*** 232,236 ****
  {
  	std::string h_file;
- 	//h_file += FCO::methodsHidden();
  	h_file += FCO::hide();
  
--- 128,131 ----

Index: SetRep.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/SetRep.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SetRep.h	26 Feb 2004 17:12:46 -0000	1.2
--- SetRep.h	10 Mar 2004 02:50:18 -0000	1.3
***************
*** 29,38 ****
  	{ 
  		m_memberList.clear();
- 		m_memberMap.clear();
  	}
  	~SetRep()
  	{ 
  		m_memberList.clear();
- 		m_memberMap.clear();
  	}
  
--- 29,36 ----
***************
*** 42,63 ****
  	void addMember( FCO * member);
  
- 	// adds new elements to the m_extMemberList vector
- 	void inherit();
- 
- 	void addSetMemberRole( const ModelRep * model, const RoleRep& member);
- 	
- 	void addSetMemberRole( const ModelRep * model, const RoleRep::RoleRepSeries & role_series);
- 
  	std::string doDump();
  
  	bool checkSetElements();
  
- 	/*std::string dumpUsing();
- 	std::string dumpUsingLine( FCO *);
- 	std::string dumpSetGetterSource( FCO * fco, const std::string& lll);
- 	std::string dumpSetGetterHeader( FCO * fco, const std::string& lll);*/
  	std::string setGetterTemplate( const FCO * fco);
  	void createMethods();
- 	//std::string hideAndExpose();
  	std::string expose();
  	std::string hide();
--- 40,49 ----
***************
*** 67,74 ****
  	// coresponds to "initial"
  	SetMemberList m_memberList;
- 
- 	// stores all rolenames for the members above and their intInherited desc's
- 	// coresponds to "final"
- 	SetMembersMap m_memberMap;
  
  private: // forbiding copy
--- 53,56 ----

Index: Sheet.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Sheet.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Sheet.cpp	26 Feb 2004 17:12:46 -0000	1.5
--- Sheet.cpp	10 Mar 2004 02:50:18 -0000	1.6
***************
*** 21,64 ****
  	m_setList(),
  	m_folderList(),
- 	m_aspectList(),
- 	m_constraintList(),
- 	m_constraintFuncList(),
  	m_attributeList()
  {
  }
  
- 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();
- 
- 		multipleInheritance();
- 		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()
--- 21,28 ----
***************
*** 123,150 ****
  	}
  	{
- 		AspectRep_Iterator ai = m_aspectList.begin();
- 		for( ; ai != m_aspectList.end(); ++ai)
- 		{
- 			AspectRep * act_ptr = * ai;
- 			delete act_ptr;
- 		}
- 	}
- 	{
- 		ConstraintRep_Iterator ai = m_constraintList.begin();
- 		for( ; ai != m_constraintList.end(); ++ai)
- 		{
- 			ConstraintRep * act_ptr = * ai;
- 			delete act_ptr;
- 		}
- 	}
- 	{
- 		ConstraintFuncRep_Iterator ai = m_constraintFuncList.begin();
- 		for( ; ai != m_constraintFuncList.end(); ++ai)
- 		{
- 			ConstraintFuncRep * act_ptr = * ai;
- 			delete act_ptr;
- 		}
- 	}
- 	{
  		AttributeRep_Iterator ai = m_attributeList.begin();
  		for( ; ai != m_attributeList.end(); ++ai)
--- 87,90 ----
***************
*** 163,171 ****
  	m_folderList.clear();
  
- 	m_aspectList.clear();
- 	m_constraintList.clear();
- 	m_constraintFuncList.clear();
- 
  	m_attributeList.clear();
  }
  
--- 103,142 ----
  	m_folderList.clear();
  
  	m_attributeList.clear();
+ 	m_BON_Project_Root_Folder = BON::Folder();
+ }
+ 
+ 
+ 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();
+ 
+ 		multipleInheritance();
+ 		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();
+ 	}
  }
  
***************
*** 241,268 ****
  
  
- AspectRep* Sheet::createAspectRep( BON::FCO& ptr, BON::FCO& resp_ptr)
- {
- 	AspectRep * ll = new AspectRep( ptr, resp_ptr);
- 	addAspectRep( ll);
- 	return ll;
- }
- 
- 
- ConstraintRep* Sheet::createConstraintRep( BON::FCO& ptr)
- {
- 	ConstraintRep * ll = new ConstraintRep( ptr);
- 	addConstraintRep( ll);
- 	return ll;
- }
- 
- 
- ConstraintFuncRep* Sheet::createConstraintFuncRep( BON::FCO& ptr)
- {
- 	ConstraintFuncRep * ll = new ConstraintFuncRep( ptr);
- 	addConstraintFuncRep( ll);
- 	return ll;
- }
- 
- 
  AttributeRep* Sheet::createBoolAttributeRep( BON::FCO& ptr)
  {
--- 212,215 ----
***************
*** 325,334 ****
  
  
- void Sheet::addAspectRep( AspectRep * ptr)
- {
- 	m_aspectList.push_back( ptr);
- }
- 
- 
  void Sheet::addFolderRep( FolderRep * ptr)
  {
--- 272,275 ----
***************
*** 337,352 ****
  
  
- void Sheet::addConstraintRep( ConstraintRep * ptr)
- {
- 	m_constraintList.push_back( ptr);
- }
- 
- 
- void Sheet::addConstraintFuncRep( ConstraintFuncRep * ptr)
- {
- 	m_constraintFuncList.push_back( ptr);
- }
- 
- 
  void Sheet::addAttributeRep( AttributeRep * ptr)
  {
--- 278,281 ----
***************
*** 369,373 ****
  	for( ; it0 != m_fcoRepList.end(); ++it0 )
  	{
! 		if ((*it0)->getPtr() == ptr ) return *it0;
  	}
  
--- 298,302 ----
  	for( ; it0 != m_fcoRepList.end(); ++it0 )
  	{
! 		if ((*it0)->getPtr() == ptr) return *it0;
  	}
  
***************
*** 375,379 ****
  	for( ; it1 != m_atomList.end(); ++it1 )
  	{
! 		if ((*it1)->getPtr() == ptr ) return *it1;
  	}
  
--- 304,308 ----
  	for( ; it1 != m_atomList.end(); ++it1 )
  	{
! 		if ((*it1)->getPtr() == ptr) return *it1;
  	}
  
***************
*** 381,385 ****
  	for( ; it2 != m_modelList.end(); ++it2 )
  	{
! 		if ((*it2)->getPtr() == ptr ) return *it2;
  	}
  
--- 310,314 ----
  	for( ; it2 != m_modelList.end(); ++it2 )
  	{
! 		if ((*it2)->getPtr() == ptr) return *it2;
  	}
  
***************
*** 387,391 ****
  	for( ; it3 != m_connList.end(); ++it3 )
  	{
! 		if ((*it3)->getPtr() == ptr ) return *it3;
  	}
  
--- 316,320 ----
  	for( ; it3 != m_connList.end(); ++it3 )
  	{
! 		if ((*it3)->getPtr() == ptr) return *it3;
  	}
  
***************
*** 393,397 ****
  	for( ; it4 != m_setList.end(); ++it4 )
  	{
! 		if ((*it4)->getPtr() == ptr ) return *it4;
  	}
  
--- 322,326 ----
  	for( ; it4 != m_setList.end(); ++it4 )
  	{
! 		if ((*it4)->getPtr() == ptr) return *it4;
  	}
  
***************
*** 399,403 ****
  	for( ; it5 != m_refList.end(); ++it5 )
  	{
! 		if ((*it5)->getPtr() == ptr ) return *it5;
  	}
  	return 0;
--- 328,332 ----
  	for( ; it5 != m_refList.end(); ++it5 )
  	{
! 		if ((*it5)->getPtr() == ptr) return *it5;
  	}
  	return 0;
***************
*** 410,414 ****
  	for( ; it != m_refList.end(); ++it )
  	{
! 		if ((*it)->getPtr() == ptr ) return *it;
  	}
  	return 0;
--- 339,343 ----
  	for( ; it != m_refList.end(); ++it )
  	{
! 		if ((*it)->getPtr() == ptr) return *it;
  	}
  	return 0;
***************
*** 422,444 ****
  	for( ; it5 != m_folderList.end(); ++it5 )
  	{
! 		if ((*it5)->getPtr() == ptr ) return *it5;
! 	}
! 
! 	AspectRep_Iterator it1( m_aspectList.begin());
! 	for( ; it1 != m_aspectList.end(); ++it1 )
! 	{
! 		if ((*it1)->getPtr() == ptr ) return *it1;
! 	}
! 
! 	ConstraintRep_Iterator it2 = m_constraintList.begin();
! 	for( ; it2 != m_constraintList.end(); ++it2 )
! 	{
! 		if ((*it2)->getPtr() == ptr ) return *it2;
! 	}
! 
! 	ConstraintFuncRep_Iterator it3 = m_constraintFuncList.begin();
! 	for( ; it3 != m_constraintFuncList.end(); ++it3 )
! 	{
! 		if ((*it3)->getPtr() == ptr ) return *it3;
  	}
  
--- 351,355 ----
  	for( ; it5 != m_folderList.end(); ++it5 )
  	{
! 		if ((*it5)->getPtr() == ptr) return *it5;
  	}
  
***************
*** 465,469 ****
  void Sheet::setProjectRootFolder( BON::Folder& p)
  {
! 	m_projectRootFolder = p;
  }
  
--- 376,380 ----
  void Sheet::setProjectRootFolder( BON::Folder& p)
  {
! 	m_BON_Project_Root_Folder = p;
  }
  

Index: Sheet.h
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/BonExtension/Rep/Sheet.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Sheet.h	26 Feb 2004 17:12:46 -0000	1.4
--- Sheet.h	10 Mar 2004 02:50:18 -0000	1.5
***************
*** 3,10 ****
  
  #include "Any.h"
- #include "PartRep.h"
  #include "FCO.h"
- #include "ConstraintFuncRep.h"
- #include "ConstraintRep.h"
  #include "FolderRep.h"
  #include "ModelRep.h"
--- 3,7 ----
***************
*** 46,52 ****
  	FolderRep* createFolderRep( BON::FCO& ptr, BON::FCO& resp_ptr);
  
- 	AspectRep* createAspectRep( BON::FCO& ptr, BON::FCO& resp_ptr);
- 	ConstraintRep* createConstraintRep( BON::FCO& ptr);
- 	ConstraintFuncRep* createConstraintFuncRep( BON::FCO& ptr);
  	AttributeRep* createBoolAttributeRep( BON::FCO& ptr);
  	AttributeRep* createEnumAttributeRep( BON::FCO& ptr);
--- 43,46 ----
***************
*** 75,81 ****
  	typedef std::vector<SetRep*>::iterator SetRep_Iterator;
  	typedef std::vector<FolderRep*>::iterator FolderRep_Iterator;
- 	typedef std::vector<AspectRep*>::iterator AspectRep_Iterator;
- 	typedef std::vector<ConstraintRep*>::iterator ConstraintRep_Iterator;
- 	typedef std::vector<ConstraintFuncRep*>::iterator ConstraintFuncRep_Iterator;
  	typedef std::vector<AttributeRep*>::iterator AttributeRep_Iterator;
  
--- 69,72 ----
***************
*** 88,94 ****
  	void addSetRep( SetRep * ptr);
  	void addFolderRep( FolderRep * ptr);
- 	void addAspectRep( AspectRep * ptr);
- 	void addConstraintFuncRep( ConstraintFuncRep *ptr);
- 	void addConstraintRep( ConstraintRep *ptr);
  	void addAttributeRep( AttributeRep* ptr);
  
--- 79,82 ----
***************
*** 102,113 ****
  	std::vector<FolderRep*> m_folderList;
  
- 	std::vector<AspectRep*> m_aspectList;
- 	std::vector<ConstraintRep*> m_constraintList;
- 	std::vector<ConstraintFuncRep*> m_constraintFuncList;
  	std::vector<AttributeRep*> m_attributeList;
  
  	std::string m_projName;
  	RootFolder m_rootFolder;
! 	BON::Folder m_projectRootFolder;
  
  
--- 90,98 ----
  	std::vector<FolderRep*> m_folderList;
  
  	std::vector<AttributeRep*> m_attributeList;
  
  	std::string m_projName;
  	RootFolder m_rootFolder;
! 	BON::Folder m_BON_Project_Root_Folder;
  
  

--- AspectRep.cpp DELETED ---

--- AspectRep.h DELETED ---

--- ConstraintFuncRep.cpp DELETED ---

--- ConstraintFuncRep.h DELETED ---

--- ConstraintRep.cpp DELETED ---

--- ConstraintRep.h DELETED ---

--- PartRep.h DELETED ---



More information about the GME-commit mailing list