model_server/dd/src/xref_dd.cxx
//------------------------------------------
// handle_grp_rel: insert/remove links for relations among groups/subsystems and
// their members.
//------------------------------------------
insert/remove links for relations among groups/subsystems and
their members.
insert / remove links for relations among groups / subsystems and their members .
void handle_grp_rel(ddElementPtr src, ddElementPtr trg, int oper, RelType* rel) {
   Initialize(handle_group_rel);
   if (oper && src && trg) {
      symbolPtr srcxr = src->get_xrefSymbol();
      symbolPtr trgxr = trg->get_xrefSymbol();
      if (srcxr.xrisnotnull() && trgxr.xrisnotnull()) {
	 Xref* xr;
	 linkType lt = get_linkType(rel);
	 if (oper > 0) {
	    xr = srcxr->get_Xref();
	    if (xr && !trgxr->is_symbol_in(xr)) {
	       XrefTable* xrt = xr->get_lxref();
	       if (xrt) {
		  xrt->insert_symbol(trg);
	       }
	    }
	    srcxr->add_link(lt, trgxr, 1, trgxr.get_xref()->get_lxref());
	 }
         else {
            projNodePtr homep = projNode::get_home_proj();
            xr = (homep) ? homep->get_xref() : 0;
            if (xr && !trgxr->is_symbol_in(xr)) {
               symbolArr results;
               symbolPtr new_trg = xr->find_symbol(results, trg->get_kind(),
                                                   trg->get_ddname(),
                                                   trg->get_def_file());
               if (new_trg.xrisnotnull()) {
                  trgxr = new_trg;
               }
            }
            srcxr->rm_link(lt, trgxr);
         }
      }
   }
}
void handle_grp_rel ( ddElementPtr src , ddElementPtr trg , int oper , RelType * rel ) { Initialize ( handle_group_rel ) ; if ( oper && src && trg ) { symbolPtr srcxr = src -> get_xrefSymbol ( ) ; symbolPtr trgxr = trg -> get_xrefSymbol ( ) ; if ( srcxr . xrisnotnull ( ) && trgxr . xrisnotnull ( ) ) { Xref * xr ; linkType lt = get_linkType ( rel ) ; if ( oper > 0 ) { xr = srcxr -> get_Xref ( ) ; if ( xr && ! trgxr -> is_symbol_in ( xr ) ) { XrefTable * xrt = xr -> get_lxref ( ) ; if ( xrt ) { xrt -> insert_symbol ( trg ) ; } } srcxr -> add_link ( lt , trgxr , 1 , trgxr . get_xref ( ) -> get_lxref ( ) ) ; } else { projNodePtr homep = projNode :: get_home_proj ( ) ; xr = ( homep ) ? homep -> get_xref ( ) : 0 ; if ( xr && ! trgxr -> is_symbol_in ( xr ) ) { symbolArr results ; symbolPtr new_trg = xr -> find_symbol ( results , trg -> get_kind ( ) , trg -> get_ddname ( ) , trg -> get_def_file ( ) ) ; if ( new_trg . xrisnotnull ( ) ) { trgxr = new_trg ; } } srcxr -> rm_link ( lt , trgxr ) ; } } } }
handle_grp_rel: insert/remove links for relations among groups/subsystems and
their members.
handle_grp_rel : insert / remove links for relations among groups / subsystems and their members .
// Auto-clone seems not to be working any more (960925).  Let's // make sure we get the correct processing by cloning the symbol // explicitly if necessary. // Adding a link automatically clones a symbol in a read-only pmod // into the home pmod; unfortunately, the same is not true for // removing a link, so we have to do it manually here.