[GME-commit]
GMESRC/GME/Mga MgaComplexOps.cpp,1.14,1.15 MgaDeriveOps.cpp,1.4,1.5
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Tue Feb 14 19:55:38 CST 2006
Update of /project/gme-repository/GMESRC/GME/Mga
In directory escher:/tmp/cvs-serv17548
Modified Files:
MgaComplexOps.cpp MgaDeriveOps.cpp
Log Message:
GME-126 JIRA bug fixed.
Scenario: If a model (M) containing a reference (r) and its target (t) is derived (into M_s), then the (secondary) derived reference (r_s) will point to the (secondary) derived target (t_s).
The Bug was: If the user makes a copy (r2) of such a reference (r) in the basetype (M), then the (secondary) derived object r2_s (counterpart of r2), will point to t, instead of t_s.
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: MgaDeriveOps.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Mga/MgaDeriveOps.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MgaDeriveOps.cpp 2 Sep 2005 21:46:53 -0000 1.4
--- MgaDeriveOps.cpp 14 Feb 2006 19:55:36 -0000 1.5
***************
*** 189,193 ****
}
!
void GetDerivedEquivalent(CoreObj const &objinbase, CoreObj const &subtype, CoreObj &objinsubtype, int level) {
CoreObj basetype= subtype[ATTRID_DERIVED];
--- 189,224 ----
}
! // in the diagram below a model M is instantiated/subtyped into Mi
! // M contains reference r, pointing to A
! // Mi will contain derived reference ri, and derived target object Ai
! // Mj will contain derived reference rj, and derived target object Aj
! // this is the internal reference redirection scenario, so when MGA detects
! // that secondary derived references (r) have their targets set like here to
! // another secondary derived object (A) it must perform the redirect job
! // i.e.: ri->Ai, rj->Aj
! // external references (let's suppose p refers to B, p->B) can't be redirected
! // automatically because there is no clue how Mi, Mj relate to B1, B2
! //
! // M------------- B
! // | | / \
! // | r--->A | / \
! // | p | / \ / \
! // ------------- /I/S\ /I/S\
! // / \ ---- -----
! // | | | |
! // / \ / \ B1 B2
! // /I/S\ /I/S\
! // ----- -----
! // | |
! // Mi------------ Mj------------
! // | | | |
! // | ri---->Ai | | rj---->Aj |
! // | | | |
! // ------------- -------------
! //
! // this method GetDerivedEquivalent gives back/finds Ai [corresponding for A] in Mi
! // and is called like:
! // GetDerivedEquivalent( A, Mi, [out] Ai, [in] level = -1)
! // the corresponding parameters are (names taken from the diagram above)
void GetDerivedEquivalent(CoreObj const &objinbase, CoreObj const &subtype, CoreObj &objinsubtype, int level) {
CoreObj basetype= subtype[ATTRID_DERIVED];
Index: MgaComplexOps.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Mga/MgaComplexOps.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** MgaComplexOps.cpp 13 Sep 2005 19:36:48 -0000 1.14
--- MgaComplexOps.cpp 14 Feb 2006 19:55:36 -0000 1.15
***************
*** 876,880 ****
ITERATE_THROUGH(deriveds) {
int i;
! CoreObj subtypebase = ITER.FollowChain(ATTRID_PARENT, targetlevel);
coreobjpairhash derivcrealist;
coreobjhash derivmovedlist;
--- 876,888 ----
ITERATE_THROUGH(deriveds) {
int i;
! // we look for the object (subtypebase) which has been derived primarily (a parent of ITER most probably)
! // subtypebase will be used when internal references need to be redirected [ObjTreeReconnect call]
! // an internal reference is:
! // - part of a model which is derived
! // - its target is also part of that model
! // when such a reference is found in a derived model it is redirected to
! // the target's derived counterpart. more details: GetDerivedEquivalent() [in MgaDeriveOps.cpp]
! // WAS: CoreObj subtypebase = ITER.FollowChain(ATTRID_PARENT, targetlevel);
! CoreObj subtypebase = ITER.FollowChain(ATTRID_PARENT, targetlevel-1);
coreobjpairhash derivcrealist;
coreobjhash derivmovedlist;
More information about the GME-commit
mailing list