[GME-commit] GMESRC/GME/XmlBackEnd CoreXmlFile.cpp,1.18,1.19
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Wed Jun 20 18:04:08 CDT 2007
Update of /project/gme-repository/GMESRC/GME/XmlBackEnd
In directory escher:/tmp/cvs-serv22954
Modified Files:
CoreXmlFile.cpp
Log Message:
Special locks in case of Delete operation.
Might need further elaborations (references to these might be also locked)
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: CoreXmlFile.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/CoreXmlFile.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** CoreXmlFile.cpp 20 Jun 2007 17:16:00 -0000 1.18
--- CoreXmlFile.cpp 20 Jun 2007 23:04:06 -0000 1.19
***************
*** 891,894 ****
--- 891,919 ----
XmlObject * cont = getContainer(m_openedObject);
m_modifiedObjects.insert( cont );
+
+ metaid_type &mt = m_openedObject->m_metaid;
+ bool is_fco = mt == DTID_MODEL || mt == DTID_ATOM || mt == DTID_REFERENCE || mt == DTID_SET; // m, a, r, s, but no connection
+ if( cont && is_fco && m_metaAttributeId == ATTRID_PARENT)
+ {
+ metaobjidpair_type idpair;CopyTo(p, idpair);
+ if( idpair.metaid == 0 && idpair.objid == 0) // VARIANT p is 0 => removal
+ {
+ // TODO: optimization based on if 'm_openedObject' is or isn't port of cont
+ // lock granparent (gcont) to prevent a case that a connection would be drawn
+ // in gcont to m_openedObject as cont's port
+ AttribMapIter it3 = cont->m_attributes.find( ATTRID_PARENT );
+ ASSERT( it3 != cont->m_attributes.end() );
+ if( it3 != cont->m_attributes.end() )
+ {
+ XmlObject * gcont = ((XmlAttrPointer*)(it3->second))->m_parent;
+ #ifdef _DEBUG
+ std::string nm, tp;
+ if( gcont) getContainerName( gcont, nm, tp);
+ sendMsg( std::string( "Deletion case: added grandparent to the locked set: \"") + nm + std::string("\""), MSG_INFO);
+ #endif
+ m_modifiedObjects.insert( gcont );
+ }
+ }
+ }
}
More information about the GME-commit
mailing list