[GME-commit]
GMESRC/Paradigms/MetaGME/BonExtension/Rep CodeGen.cpp,1.5,1.6
CodeGenReg.cpp,1.1,1.2 CodeGenTemplate.cpp,1.2,1.3
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Tue Sep 6 20:52:08 CDT 2005
Update of /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Rep
In directory escher:/tmp/cvs-serv10937
Modified Files:
CodeGen.cpp CodeGenReg.cpp CodeGenTemplate.cpp
Log Message:
Avoiding name conflicts in implementations of the generated code like:
BON::Model myRef::getReferred()
{
BON::FCO m = getReferred(); // ends up in a recursive call
return BON::Model( m);
}
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: CodeGen.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Rep/CodeGen.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CodeGen.cpp 16 Jun 2004 18:35:02 -0000 1.5
--- CodeGen.cpp 6 Sep 2005 19:52:06 -0000 1.6
***************
*** 388,392 ****
//mmm += kind + " " + getNameImpl() + "::" + refGetterTemplate(fco) + "()\n";
mmm = indent(s_ind + 0) + "{\n";
! mmm += indent(s_ind + 1) + "BON::FCO r = getReferred();\n";
mmm += indent(s_ind + 1) + "return " + retval_kind + "(r);\n";
mmm += indent(s_ind + 0) + "}\n\n\n";
--- 388,392 ----
//mmm += kind + " " + getNameImpl() + "::" + refGetterTemplate(fco) + "()\n";
mmm = indent(s_ind + 0) + "{\n";
! mmm += indent(s_ind + 1) + "BON::FCO r = BON::ReferenceImpl::getReferred();\n";
mmm += indent(s_ind + 1) + "return " + retval_kind + "(r);\n";
mmm += indent(s_ind + 0) + "}\n\n\n";
Index: CodeGenReg.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Rep/CodeGenReg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CodeGenReg.cpp 16 Jun 2004 18:35:02 -0000 1.1
--- CodeGenReg.cpp 6 Sep 2005 19:52:06 -0000 1.2
***************
*** 373,377 ****
// if reference ports may be conn ends than the implementation is so simple
nnn = indent(s_ind + 0) + "{\n";
! nnn += indent(s_ind + 1) + "return getInConnEnds(\"" + conn->getName() + "\");\n";
nnn += indent(s_ind + 0) + "}\n\n\n";
--- 373,377 ----
// if reference ports may be conn ends than the implementation is so simple
nnn = indent(s_ind + 0) + "{\n";
! nnn += indent(s_ind + 1) + "return BON::ConnectionEndImpl::getInConnEnds(\"" + conn->getName() + "\");\n";
nnn += indent(s_ind + 0) + "}\n\n\n";
***************
*** 389,393 ****
mmm += indent(s_ind + 1) + "{\n";
// the name getInConnEnds is confusing but does the right thing
! mmm += indent(s_ind + 2) + "std::multiset<BON::ConnectionEnd> in_ends = getInConnEnds(\"" + conn->getName() + "\");\n";
mmm += indent(s_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = in_ends.begin() ; cit != in_ends.end() ; ++cit )\n";
mmm += indent(s_ind + 2) + "{\n";
--- 389,393 ----
mmm += indent(s_ind + 1) + "{\n";
// the name getInConnEnds is confusing but does the right thing
! mmm += indent(s_ind + 2) + "std::multiset<BON::ConnectionEnd> in_ends = BON::ConnectionEndImpl::getInConnEnds(\"" + conn->getName() + "\");\n";
mmm += indent(s_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = in_ends.begin() ; cit != in_ends.end() ; ++cit )\n";
mmm += indent(s_ind + 2) + "{\n";
***************
*** 425,429 ****
{
nnn = indent(s_ind + 0) + "{\n";
! nnn += indent(s_ind + 1) + "return getOutConnEnds(\"" + conn->getName() + "\");\n";
nnn += indent(s_ind + 0) + "}\n\n\n";
--- 425,429 ----
{
nnn = indent(s_ind + 0) + "{\n";
! nnn += indent(s_ind + 1) + "return BON::ConnectionEndImpl::getOutConnEnds(\"" + conn->getName() + "\");\n";
nnn += indent(s_ind + 0) + "}\n\n\n";
***************
*** 439,443 ****
mmm += indent(s_ind + 1) + "std::multiset<" + peer_lcd + "> res;\n";
mmm += indent(s_ind + 1) + "{\n";
! mmm += indent(s_ind + 2) + "std::multiset<BON::ConnectionEnd> out_ends = getOutConnEnds(\"" + conn->getName() + "\");\n";
mmm += indent(s_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = out_ends.begin() ; cit != out_ends.end() ; ++cit )\n";
mmm += indent(s_ind + 2) + "{\n";
--- 439,443 ----
mmm += indent(s_ind + 1) + "std::multiset<" + peer_lcd + "> res;\n";
mmm += indent(s_ind + 1) + "{\n";
! mmm += indent(s_ind + 2) + "std::multiset<BON::ConnectionEnd> out_ends = BON::ConnectionEndImpl::getOutConnEnds(\"" + conn->getName() + "\");\n";
mmm += indent(s_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = out_ends.begin() ; cit != out_ends.end() ; ++cit )\n";
mmm += indent(s_ind + 2) + "{\n";
***************
*** 475,479 ****
{
nnn = indent(s_ind + 0) + "{\n";
! nnn += indent(s_ind + 1) + "return getConnEnds(\"" + conn->getName() + "\");\n";
nnn += indent(s_ind + 0) + "}\n\n\n";
--- 475,479 ----
{
nnn = indent(s_ind + 0) + "{\n";
! nnn += indent(s_ind + 1) + "return BON::ConnectionEndImpl::getConnEnds(\"" + conn->getName() + "\");\n";
nnn += indent(s_ind + 0) + "}\n\n\n";
***************
*** 489,493 ****
mmm += indent(s_ind + 1) + "std::multiset<" + peer_lcd + "> res;\n";
mmm += indent(s_ind + 1) + "{\n";
! mmm += indent(s_ind + 2) + "std::multiset<BON::ConnectionEnd> in_ends = getInConnEnds(\"" + conn->getName() + "\");\n";
mmm += indent(s_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = in_ends.begin() ; cit != in_ends.end() ; ++cit )\n";
mmm += indent(s_ind + 2) + "{\n";
--- 489,493 ----
mmm += indent(s_ind + 1) + "std::multiset<" + peer_lcd + "> res;\n";
mmm += indent(s_ind + 1) + "{\n";
! mmm += indent(s_ind + 2) + "std::multiset<BON::ConnectionEnd> in_ends = BON::ConnectionEndImpl::getInConnEnds(\"" + conn->getName() + "\");\n";
mmm += indent(s_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = in_ends.begin() ; cit != in_ends.end() ; ++cit )\n";
mmm += indent(s_ind + 2) + "{\n";
***************
*** 496,500 ****
mmm += indent(s_ind + 3) + "res.insert( dst);\n";
mmm += indent(s_ind + 2) + "}\n";
! mmm += indent(s_ind + 2) + "std::multiset<BON::ConnectionEnd> out_ends = getOutConnEnds(\"" + conn->getName() + "\");\n";
mmm += indent(s_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cot = out_ends.begin() ; cot != out_ends.end() ; ++cot )\n";
mmm += indent(s_ind + 2) + "{\n";
--- 496,500 ----
mmm += indent(s_ind + 3) + "res.insert( dst);\n";
mmm += indent(s_ind + 2) + "}\n";
! mmm += indent(s_ind + 2) + "std::multiset<BON::ConnectionEnd> out_ends = BON::ConnectionEndImpl::getOutConnEnds(\"" + conn->getName() + "\");\n";
mmm += indent(s_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cot = out_ends.begin() ; cot != out_ends.end() ; ++cot )\n";
mmm += indent(s_ind + 2) + "{\n";
***************
*** 638,642 ****
mmm = indent(s_ind + 0) + "{\n";
mmm += indent(s_ind + 1) + "std::set<" + retval_kind + "> res;\n";
! mmm += indent(s_ind + 1) + "std::set<BON::FCO> elems = getMembers();\n";
mmm += indent(s_ind + 1) + "std::set<BON::FCO>::iterator elem = elems.begin();\n";
mmm += indent(s_ind + 1) + "for( ; elem != elems.end(); ++elem)\n";
--- 638,642 ----
mmm = indent(s_ind + 0) + "{\n";
mmm += indent(s_ind + 1) + "std::set<" + retval_kind + "> res;\n";
! mmm += indent(s_ind + 1) + "std::set<BON::FCO> elems = BON::SetImpl::getMembers();\n";
mmm += indent(s_ind + 1) + "std::set<BON::FCO>::iterator elem = elems.begin();\n";
mmm += indent(s_ind + 1) + "for( ; elem != elems.end(); ++elem)\n";
Index: CodeGenTemplate.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Rep/CodeGenTemplate.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CodeGenTemplate.cpp 6 Jan 2005 19:50:47 -0000 1.2
--- CodeGenTemplate.cpp 6 Sep 2005 19:52:06 -0000 1.3
***************
*** 398,402 ****
sgn = "get" + conn->getDispName() + "Srcs(TDP)";
src = indent(h_ind + 0) + "{\n";
! src += indent(h_ind + 1) + "std::multiset<BON::ConnectionEnd> ends = getInConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 1) + "return std::multiset<BON::ConnectionEnd, T>( ends.begin(), ends.end());\n";
src += indent(h_ind + 0) + "}\n";
--- 398,402 ----
sgn = "get" + conn->getDispName() + "Srcs(TDP)";
src = indent(h_ind + 0) + "{\n";
! src += indent(h_ind + 1) + "std::multiset<BON::ConnectionEnd> ends = BON::ConnectionEndImpl::getInConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 1) + "return std::multiset<BON::ConnectionEnd, T>( ends.begin(), ends.end());\n";
src += indent(h_ind + 0) + "}\n";
***************
*** 420,424 ****
src += indent(h_ind + 1) + "{\n";
// the name getInConnEnds is confusing but does the right thing
! src += indent(h_ind + 2) + "std::multiset<BON::ConnectionEnd> in_ends = getInConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = in_ends.begin() ; cit != in_ends.end() ; ++cit )\n";
src += indent(h_ind + 2) + "{\n";
--- 420,424 ----
src += indent(h_ind + 1) + "{\n";
// the name getInConnEnds is confusing but does the right thing
! src += indent(h_ind + 2) + "std::multiset<BON::ConnectionEnd> in_ends = BON::ConnectionEndImpl::getInConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = in_ends.begin() ; cit != in_ends.end() ; ++cit )\n";
src += indent(h_ind + 2) + "{\n";
***************
*** 460,464 ****
sgn = "get" + conn->getDispName() + "Dsts(TDP)";
src = indent(h_ind + 0) + "{\n";
! src += indent(h_ind + 1) + "std::multiset<BON::ConnectionEnd> ends = getOutConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 1) + "return std::multiset<BON::ConnectionEnd, T>( ends.begin(), ends.end());\n";
src += indent(h_ind + 0) + "}\n";
--- 460,464 ----
sgn = "get" + conn->getDispName() + "Dsts(TDP)";
src = indent(h_ind + 0) + "{\n";
! src += indent(h_ind + 1) + "std::multiset<BON::ConnectionEnd> ends = BON::ConnectionEndImpl::getOutConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 1) + "return std::multiset<BON::ConnectionEnd, T>( ends.begin(), ends.end());\n";
src += indent(h_ind + 0) + "}\n";
***************
*** 483,487 ****
src += indent(h_ind + 1) + "{\n";
// the name getOutConnEnds is confusing but does the right thing
! src += indent(h_ind + 2) + "std::multiset<BON::ConnectionEnd> out_ends = getOutConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = out_ends.begin() ; cit != out_ends.end() ; ++cit )\n";
src += indent(h_ind + 2) + "{\n";
--- 483,487 ----
src += indent(h_ind + 1) + "{\n";
// the name getOutConnEnds is confusing but does the right thing
! src += indent(h_ind + 2) + "std::multiset<BON::ConnectionEnd> out_ends = BON::ConnectionEndImpl::getOutConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = out_ends.begin() ; cit != out_ends.end() ; ++cit )\n";
src += indent(h_ind + 2) + "{\n";
***************
*** 524,528 ****
sgn = "get" + conn->getDispName() + "Ends(TDP)";
src = indent(h_ind + 0) + "{\n";
! src += indent(h_ind + 1) + "std::multiset<BON::ConnectionEnd> ends = getConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 1) + "return std::multiset<BON::ConnectionEnd, T>( ends.begin(), ends.end());\n";
src += indent(h_ind + 0) + "}\n";
--- 524,528 ----
sgn = "get" + conn->getDispName() + "Ends(TDP)";
src = indent(h_ind + 0) + "{\n";
! src += indent(h_ind + 1) + "std::multiset<BON::ConnectionEnd> ends = BON::ConnectionEndImpl::getConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 1) + "return std::multiset<BON::ConnectionEnd, T>( ends.begin(), ends.end());\n";
src += indent(h_ind + 0) + "}\n";
***************
*** 545,549 ****
src += indent(h_ind + 1) + "std::multiset<" + peer_lcd + ", T> res;\n";
src += indent(h_ind + 1) + "{\n";
! src += indent(h_ind + 2) + "std::multiset<BON::ConnectionEnd> in_ends = getInConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = in_ends.begin() ; cit != in_ends.end() ; ++cit )\n";
src += indent(h_ind + 2) + "{\n";
--- 545,549 ----
src += indent(h_ind + 1) + "std::multiset<" + peer_lcd + ", T> res;\n";
src += indent(h_ind + 1) + "{\n";
! src += indent(h_ind + 2) + "std::multiset<BON::ConnectionEnd> in_ends = BON::ConnectionEndImpl::getInConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cit = in_ends.begin() ; cit != in_ends.end() ; ++cit )\n";
src += indent(h_ind + 2) + "{\n";
***************
*** 552,556 ****
src += indent(h_ind + 3) + "res.insert( dst);\n";
src += indent(h_ind + 2) + "}\n";
! src += indent(h_ind + 2) + "std::multiset<BON::ConnectionEnd> out_ends = getOutConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cot = out_ends.begin() ; cot != out_ends.end() ; ++cot )\n";
src += indent(h_ind + 2) + "{\n";
--- 552,556 ----
src += indent(h_ind + 3) + "res.insert( dst);\n";
src += indent(h_ind + 2) + "}\n";
! src += indent(h_ind + 2) + "std::multiset<BON::ConnectionEnd> out_ends = BON::ConnectionEndImpl::getOutConnEnds(\"" + conn->getName() + "\");\n";
src += indent(h_ind + 2) + "for ( std::multiset<BON::ConnectionEnd>::iterator cot = out_ends.begin() ; cot != out_ends.end() ; ++cot )\n";
src += indent(h_ind + 2) + "{\n";
***************
*** 606,610 ****
src = indent(h_ind + 0) + "{\n";
src += indent(h_ind + 1) + "std::set<" + retval_kind + "> res;\n";
! src += indent(h_ind + 1) + "std::set<BON::FCO> elems = getMembers();\n";
src += indent(h_ind + 1) + "std::set<BON::FCO>::iterator elem = elems.begin();\n";
src += indent(h_ind + 1) + "for( ; elem != elems.end(); ++elem)\n";
--- 606,610 ----
src = indent(h_ind + 0) + "{\n";
src += indent(h_ind + 1) + "std::set<" + retval_kind + "> res;\n";
! src += indent(h_ind + 1) + "std::set<BON::FCO> elems = BON::SetImpl::getMembers();\n";
src += indent(h_ind + 1) + "std::set<BON::FCO>::iterator elem = elems.begin();\n";
src += indent(h_ind + 1) + "for( ; elem != elems.end(); ++elem)\n";
More information about the GME-commit
mailing list