[GME-commit] GMESRC/Paradigms/MetaGME/MetaInterpreter2004
BON2Component.cpp,1.12,1.13
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Thu May 6 18:30:28 CDT 2004
Update of /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004
In directory braindrain:/tmp/cvs-serv8100/MetaInterpreter2004
Modified Files:
BON2Component.cpp
Log Message:
A few verbose error messages introduced.
CVS User: zolmol
Index: BON2Component.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/BON2Component.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** BON2Component.cpp 11 Mar 2004 15:39:37 -0000 1.12
--- BON2Component.cpp 6 May 2004 22:30:26 -0000 1.13
***************
*** 31,38 ****
Globals global_vars;
- #define show_to_be_removed 0
- #define show_entities 1
- #define show_relations 1
-
namespace BON
{
--- 31,34 ----
***************
*** 84,88 ****
if ( m_sheet != 0)
{
! TO( "The merged paradigm sheet still exists");
delete m_sheet;
m_sheet = 0;
--- 80,84 ----
if ( m_sheet != 0)
{
! TO( "Internal error: Merged Paradigm Sheet object still exists.");
delete m_sheet;
m_sheet = 0;
***************
*** 192,196 ****
// it cannot be of type set (aspect), or type model
- //TO( std::string("Aspect member operand\nOp1: ") + (*aspect)->getName() + "\nOp2: " + (*asp_elem)->getName());
if ((*asp_elem)->getObjectMeta().type() == MON::OT_Atom ||
(*asp_elem)->getObjectMeta().type() == MON::OT_Reference)
--- 188,191 ----
***************
*** 223,227 ****
}
else
! global_vars.err << "Error: weird aspect member operation\nOp1: " << (*aspect)->getName() << "\nOp2: " << (*asp_elem)->getName();
}
}
--- 218,222 ----
}
else
! global_vars.err << "Error: Cannot handle AspectMember operation. Op1: " << (*aspect)->getName() << " Op2: " << (*asp_elem)->getName() << "\n";
}
}
***************
*** 249,259 ****
std::string conn_kind = (*conn_it)->getObjectMeta().name();
! if ( conn_kind == "Containment" ||
! conn_kind == "FolderContainment" ||
! conn_kind == "SetMembership" ||
! conn_kind == "ReferTo" ||
! conn_kind == "HasAspect" ||
! conn_kind == "HasConstraint" ||
! conn_kind == "HasAttribute")
{
Object src = FCO((*conn_it)->getSrc());
--- 244,254 ----
std::string conn_kind = (*conn_it)->getObjectMeta().name();
! if ( conn_kind == Relation::containment_str ||
! conn_kind == Relation::folder_containment_str ||
! conn_kind == Relation::set_membership_str ||
! conn_kind == Relation::refer_to_str ||
! conn_kind == Relation::has_aspect_str ||
! conn_kind == Relation::has_constraint_str ||
! conn_kind == Relation::has_attribute_str)
{
Object src = FCO((*conn_it)->getSrc());
***************
*** 262,288 ****
Relation rela( Relation::CONTAINMENT_OP, dst, src); // create a relation object
! std::string relation_name = (*conn_it)->getObjectMeta().name();
! if ( relation_name == Relation::containment_str)
{
rela.setOperation( Relation::CONTAINMENT_OP);
rela.setOp3( *conn_it);
}
! else if ( relation_name == Relation::folder_containment_str)
{
rela.setOperation( Relation::FOLDER_CONTAINMENT_OP);
rela.setOp3( *conn_it);
}
! else if ( relation_name == Relation::set_membership_str)
rela.setOperation( Relation::SET_MEMBER_OP);
! else if ( relation_name == Relation::refer_to_str)
rela.setOperation( Relation::REFER_TO_OP);
! else if ( relation_name == Relation::has_aspect_str)
rela.setOperation( Relation::HAS_ASPECT_OP);
! else if ( relation_name == Relation::has_constraint_str)
rela.setOperation( Relation::HAS_CONSTRAINT_OP);
! else if ( relation_name == Relation::has_attribute_str)
rela.setOperation( Relation::HAS_ATTRIBUTE_OP);
else
! global_vars.err << "ERROR in entity Builder: unhandled entity.\n";
m_relations.push_back(rela);
--- 257,282 ----
Relation rela( Relation::CONTAINMENT_OP, dst, src); // create a relation object
! if ( conn_kind == Relation::containment_str)
{
rela.setOperation( Relation::CONTAINMENT_OP);
rela.setOp3( *conn_it);
}
! else if ( conn_kind == Relation::folder_containment_str)
{
rela.setOperation( Relation::FOLDER_CONTAINMENT_OP);
rela.setOp3( *conn_it);
}
! else if ( conn_kind == Relation::set_membership_str)
rela.setOperation( Relation::SET_MEMBER_OP);
! else if ( conn_kind == Relation::refer_to_str)
rela.setOperation( Relation::REFER_TO_OP);
! else if ( conn_kind == Relation::has_aspect_str)
rela.setOperation( Relation::HAS_ASPECT_OP);
! else if ( conn_kind == Relation::has_constraint_str)
rela.setOperation( Relation::HAS_CONSTRAINT_OP);
! else if ( conn_kind == Relation::has_attribute_str)
rela.setOperation( Relation::HAS_ATTRIBUTE_OP);
else
! global_vars.err << "ERROR: Unknown connection kind.\n";
m_relations.push_back(rela);
***************
*** 302,308 ****
FCO referred = (*ref_it)->getReferred();
this->m_realObj[ *ref_it] = referred;
- std::string m1, m2;
- m1 = referred->getName();
- m2 = (*ref_it)->getName();
}
catch( ... )
--- 296,299 ----
***************
*** 346,351 ****
in_connection_line = * con_list_ptr_i.begin();
obj1 = in_connection_line->getSrc();
- //std::string o01 = BON::FCO((*con_list_ptr_i.begin())->getSrc())->getName();
- std::string o1 = BON::FCO(obj1)->getName();
}
if ( !con_list_ptr_o.empty())
--- 337,340 ----
***************
*** 353,361 ****
out_connection_line = * con_list_ptr_o.begin();
obj2 = out_connection_line->getDst();
-
- //std::string o2 = BON::FCO(*obj2)->getName();
}
if ( !in_connection_line || !out_connection_line)
! global_vars.err << "ERROR during entity builder - handling connector \"" << (*atom_it)->getName() << "\"\n";
--- 342,348 ----
out_connection_line = * con_list_ptr_o.begin();
obj2 = out_connection_line->getDst();
}
if ( !in_connection_line || !out_connection_line)
! global_vars.err << "ERROR: connector \"" << (*atom_it)->getName() << "\" does not have both SourceToConnector and ConnectorToDestination connections attached.\n";
***************
*** 369,378 ****
{
obja = * a_out_list.begin();
- //TO(g_curr_elem + s + " [Out, C2A] "+ obja->getName() +" | " + obja->getObjectMeta().name());
}
else if ( !a_in_list.empty()) // if not found outgoings check for incoming AssociationClass connections
{
obja = * a_in_list.begin();
- //TO(g_curr_elem + s + " [Out, C2A] "+ obja->getName() +" | " + obja->getObjectMeta().name());
}
else
--- 356,363 ----
***************
*** 383,387 ****
// src: obj1, dest: obj2, association class: obja, in line, and out_line
if ( !obj1 || !obj2 || !obja || !in_connection_line || !out_connection_line)
! global_vars.err << "ERROR: Association can not be inserted into Relations\n";
else
{
--- 368,377 ----
// src: obj1, dest: obj2, association class: obja, in line, and out_line
if ( !obj1 || !obj2 || !obja || !in_connection_line || !out_connection_line)
! {
! if ( obja)
! global_vars.err << "ERROR: Association \"" << FCO( obja)->getName() << "\" disregarded.\n";
! else
! global_vars.err << "ERROR: Association disregarded.\n";
! }
else
{
***************
*** 409,418 ****
obj1 = * in_it;
++how_many_bases;
! if ( how_many_bases > 1) global_vars.err << "Warning: Too many base classes\n";
! //TO(g_curr_elem + s + " [IN, Base] "+ obj1->getName() +" | " + obj1->getObjectMeta().name());
for( ; out_it != out_list.end(); ++out_it)
{
- //std::string s(Relation::inheritance_derived.c_str());
- //TO(g_curr_elem + s + " [Out, Derived] "+ obj2->getName() +" | " + obj2->getObjectMeta().name());
obj2 = * out_it;
--- 399,405 ----
obj1 = * in_it;
++how_many_bases;
! if ( how_many_bases > 1) global_vars.err << "Warning: Too many base classes. Multiple inheritance should be used with two different operators.\n";
for( ; out_it != out_list.end(); ++out_it)
{
obj2 = * out_it;
***************
*** 435,444 ****
obj1 = * in_it;
++how_many_bases;
! if ( how_many_bases > 1) global_vars.err << "Warning: Too many base classes\n";
! //TO(g_curr_elem + s + " [IN, Base] "+ obj1->getName() +" | " + obj1->getObjectMeta().name());
for( ; out_it != out_list.end(); ++out_it)
{
- //std::string s(Relation::inheritance_derived.c_str());
- //TO(g_curr_elem + s + " [Out, Derived] "+ obj2->getName() +" | " + obj2->getObjectMeta().name());
obj2 = * out_it;
--- 422,428 ----
obj1 = * in_it;
++how_many_bases;
! if ( how_many_bases > 1) global_vars.err << "Warning: Too many base classes. Multiple inheritance should be used with two different operators.\n";
for( ; out_it != out_list.end(); ++out_it)
{
obj2 = * out_it;
***************
*** 461,470 ****
obj1 = * in_it;
++how_many_bases;
! if ( how_many_bases > 1) global_vars.err << "Warning: Too many base classes\n";
! //TO(g_curr_elem + s + " [IN, Base] "+ obj1->getName() +" | " + obj1->getObjectMeta().name());
for( ; out_it != out_list.end(); ++out_it)
{
- //std::string s(Relation::inheritance_derived.c_str());
- //TO(g_curr_elem + s + " [Out, Derived] "+ obj2->getName() +" | " + obj2->getObjectMeta().name());
obj2 = * out_it;
--- 445,451 ----
obj1 = * in_it;
++how_many_bases;
! if ( how_many_bases > 1) global_vars.err << "Warning: Too many base classes. Multiple inheritance should be used with two different operators.\n";
for( ; out_it != out_list.end(); ++out_it)
{
obj2 = * out_it;
***************
*** 482,496 ****
std::multiset<ConnectionEnd>::iterator out_it = out_list.begin();
- int how_many_bases = 0;
for( ; in_it != in_list.end(); ++in_it ) // if outer cycle performs more than once should be an error
{
obj1 = * in_it;
- ++how_many_bases;
- if ( how_many_bases > 1) global_vars.err << "Warning: Too many base classes\n";
- //TO(g_curr_elem + s + " [IN, Base] "+ obj1->getName() +" | " + obj1->getObjectMeta().name());
for( ; out_it != out_list.end(); ++out_it)
{
- //std::string s(Relation::inheritance_derived.c_str());
- //TO(g_curr_elem + s + " [Out, Derived] "+ obj2->getName() +" | " + obj2->getObjectMeta().name());
obj2 = * out_it;
--- 463,471 ----
***************
*** 511,519 ****
{
obj1 = * in_it;
- //TO(g_curr_elem + s + " [IN, Base] "+ obj1->getName() +" | " + obj1->getObjectMeta().name());
for( ; out_it != out_list.end(); ++out_it)
{
- //std::string s(Relation::inheritance_derived.c_str());
- //TO(g_curr_elem + s + " [Out, Derived] "+ obj2->getName() +" | " + obj2->getObjectMeta().name());
obj2 = * out_it;
--- 486,491 ----
***************
*** 534,542 ****
{
obj1 = * in_it;
- //TO(g_curr_elem + s + " [IN, Base] "+ obj1->getName() +" | " + obj1->getObjectMeta().name());
for( ; out_it != out_list.end(); ++out_it)
{
- //std::string s(Relation::inheritance_derived.c_str());
- //TO(g_curr_elem + s + " [Out, Derived] "+ obj2->getName() +" | " + obj2->getObjectMeta().name());
obj2 = * out_it;
--- 506,511 ----
***************
*** 827,905 ****
void Component::Show()
{
- std::string msg = "";
- #if(show_to_be_removed)
-
- Entity_Iterator it_1(m_toBeDeletedEntities.begin());
- for( ; it_1 != m_toBeDeletedEntities.end(); ++it_1)
- {
- const CBuilderObject * obj = static_cast<const CBuilderObject *>(it_1->getPointer());
- msg += obj->getName() + " / " + obj->getObjectMeta().name() + "\n";
- }
- TO(msg.c_str());
- #endif
-
- msg = " / / / / / E N T I T I E S \\ \\ \\ \\ \\ \n";
-
- #if(show_entities)
-
- Entity_Iterator it_2( m_entities.begin());
- for( ; it_2 != m_entities.end(); ++it_2)
- {
- char dst[32];
- sprintf( dst, "%x", it_2->getPointer());
- msg += it_2->getPointer()->getName() + " / " + it_2->getPointer()->getObjectMeta().name() + " Addr: " + dst;
-
- // if proxy show its real objs
- ObjPointer objreal = m_realObj[it_2->getPointer()];
- if ( objreal != BON::Object())
- {
- msg += " is a proxy to " + objreal->getName() + "/" + objreal->getObjectMeta().name();
- }
- msg += "\n";
- }
- TO(msg.c_str());
-
- #endif
-
- msg = " * * * * * * R E L A T I O N S * * * * * *\n";
-
- #if(show_relations)
-
-
- Relation_Const_Iterator it_3 (m_relations.begin());
- for( ; it_3 != m_relations.end(); ++it_3)
- {
- ObjPointer obj1 = it_3->getOp1();
- ObjPointer obj2 = it_3->getOp2();
- ObjPointer obj3 = it_3->getOp3();
- ObjPointer obj4 = it_3->getOp4();
- ObjPointer obj5 = it_3->getOp5();
- msg += it_3->getOperationStr() + " between ";
- if ( obj1!=BON::Object() && obj2 != BON::Object() )
- msg += obj1->getName() + ":" + obj1->getObjectMeta().name() + " + " + obj2->getName() + ":" + obj2->getObjectMeta().name();
- else TO("Error in relations list\n");
-
- if ( obj3 != BON::Object() )
- msg += " A:" + obj3->getName() /*+ ":" + obj3->getObjectMeta().name()*/;
-
- if ( obj4 != BON::Object() )
- msg += " L:" + obj4->getName() /* + ":" + obj4->getObjectMeta().name()*/;
- if ( obj5 != BON::Object() )
- msg += " L:" + obj5->getName() /*+ ":" + obj5->getObjectMeta().name()*/;
-
- if ( it_3->getOperation() == Relation::HAS_ASPECT_OP ||
- it_3->getOperation() == Relation::ASPECT_MEMBER_OP )
- {
- char dst1[32], dst2[32];
- sprintf( dst1, "%x", obj1);
- sprintf( dst2, "%x", obj2);
- msg += "Addr1: " + std::string( dst1) + " Addr2: " + std::string( dst2);
- }
-
- msg += "\n";
- }
- TO(msg.c_str());
-
- #endif
}
--- 796,799 ----
***************
*** 1086,1090 ****
base->addChild( new_relation[inh_type], derived);
derived->addParent( new_relation[inh_type], base);
- //TO( "some inh " + obj1->getName() + " <|-- " + obj2->getName());
}
else
--- 980,983 ----
***************
*** 1134,1138 ****
- //TO( src_role + ":"+ dst_role +"|" + src_card +":"+dst_card);
ConnJoint::SDList list_op1, list_op2;
list_op1.push_back( op1);
--- 1027,1030 ----
***************
*** 1148,1152 ****
if (conn_obj) conn_obj->addJoint( assoc ); // op3 describes the association of op1 and op2
else global_vars.err << "ERROR after dynamic_cast - conn\n";
- //TO( obj3->getName() + " : " + obj1->getName() + " >--> " + obj2->getName());
}
else if ( obj3 == BON::Object() )
--- 1040,1043 ----
***************
*** 1169,1178 ****
if ( set != 0 && member != 0)
{
! if ( set->getMyKind() != Any::SET ) global_vars.err << "Not a set on left hand side of set_member relation\n";
SetRep * set_obj = dynamic_cast< SetRep * > ( set );
if (set_obj) set_obj->addMember( member);
! else global_vars.err << "ERROR after dynamic_cast - set\n";
- //TO( obj1->getName() + " has member " + obj2->getName() );
}
else
--- 1060,1068 ----
if ( set != 0 && member != 0)
{
! if ( set->getMyKind() != Any::SET ) global_vars.err << "Internal error: Not a set on left hand side of set_member relation\n";
SetRep * set_obj = dynamic_cast< SetRep * > ( set );
if (set_obj) set_obj->addMember( member);
! else global_vars.err << "Internal error: After dynamic_cast - set\n";
}
else
***************
*** 1204,1209 ****
ref_obj->addInitialReferee( elem);
elem->addRefersToMe( ref_obj);
-
- //TO( obj2->getName() + " ----> " + obj1->getName() );
}
else
--- 1094,1097 ----
***************
*** 1237,1242 ****
else
model_obj->addAspect( aspect_obj); //adding the aspect_ptr to the model
-
- //TO( obj1->getName() + " has aspect " + obj2->getName() );
}
else
--- 1125,1128 ----
***************
*** 1322,1326 ****
{
::FCO * fco = dynamic_cast< ::FCO *>( any);
! if (!fco) global_vars.err << "ERROR after dynamic cast - folder containment - subfolder is 0\n";
else folder_obj->addFCO( fco, card);
}
--- 1208,1212 ----
{
::FCO * fco = dynamic_cast< ::FCO *>( any);
! if ( !fco) global_vars.err << "ERROR after dynamic cast - folder containment - subfolder is 0\n";
else folder_obj->addFCO( fco, card);
}
***************
*** 1381,1389 ****
}
else // model cannot be found //<!> needs testing
! global_vars.err << "No model (op4) present in aspect_member relation. " << rel_it.getOp4()->getName() << " missing.\n";
}
else // means regular aspect membership
aspect_obj->addFCO( member);
- //TO( obj1->getName() + " aspect member " + obj2->getName() );
}
else
--- 1267,1274 ----
}
else // model cannot be found //<!> needs testing
! global_vars.err << "Interal error: No model present in aspect_member relation. " << rel_it.getOp4()->getName() << " missing.\n";
}
else // means regular aspect membership
aspect_obj->addFCO( member);
}
else
***************
*** 1474,1478 ****
rel_it->getOp4() == BON::Object() ||
rel_it->getOp5() == BON::Object() )
! global_vars.err << "Error: ASSOCIATION has one operand 0\n";
Entity ent1 = entitySearch( rel_it->getOp1());
Entity ent2 = entitySearch( rel_it->getOp2());
--- 1359,1363 ----
rel_it->getOp4() == BON::Object() ||
rel_it->getOp5() == BON::Object() )
! global_vars.err << "Internal error: Assocation has one operand 0\n";
Entity ent1 = entitySearch( rel_it->getOp1());
Entity ent2 = entitySearch( rel_it->getOp2());
***************
*** 1668,1689 ****
success = executeSheet();
else
! global_vars.err << "PopulateSheet returned with error\n";
}
catch( MON::Exception p)
{
! global_vars.err << p.getKind() << " exception caught during populate/execute\n";
}
catch( std::string exc_str)
{
! global_vars.err << "Exception caught during populate/execute. Msg: " << exc_str << "\n";
}
catch(...)
{
! global_vars.err << "Exception caught during populate/execute.\n";
}
if ( !Sheet::checkInstance())
! global_vars.err << "Internal error: sheet doesn't exist\n";
deleteSheet();
--- 1553,1574 ----
success = executeSheet();
else
! global_vars.err << "Internal error: PopulateSheet returned with error\n";
}
catch( MON::Exception p)
{
! global_vars.err << "Internal error: " << p.getKind() << " exception caught during populate/execute\n";
}
catch( std::string exc_str)
{
! global_vars.err << "Internal error: Exception caught during populate/execute. Msg: " << exc_str << "\n";
}
catch(...)
{
! global_vars.err << "Internal error: Exception caught during populate/execute.\n";
}
if ( !Sheet::checkInstance())
! global_vars.err << "Internal error: Merged Sheet object doesn't exist\n";
deleteSheet();
***************
*** 1695,1699 ****
else
global_vars.err << "Exited before populating the Merged Paradigm Sheet. Proxy or other problem may exist.\n";
! } catch (...) {
global_vars.err << "Internal error: Exception thrown by Component.\n";
deleteSheet();
--- 1580,1585 ----
else
global_vars.err << "Exited before populating the Merged Paradigm Sheet. Proxy or other problem may exist.\n";
! } catch (...)
! {
global_vars.err << "Internal error: Exception thrown by Component.\n";
deleteSheet();
***************
*** 1701,1705 ****
if ( Sheet::checkInstance())
! global_vars.err << "Internal error: Merged Paradigm Sheet still exists\n";
global_vars.err << "\nEND OF LOG";
--- 1587,1591 ----
if ( Sheet::checkInstance())
! global_vars.err << "Internal error: Merged Paradigm Sheet object still exists\n";
global_vars.err << "\nEND OF LOG";
More information about the GME-commit
mailing list