model_server/obj/src/objRelation.h.cxx
// Remove relation hooks calling without touching relations itself
//
Remove relation hooks calling without touching relations itself
Remove relation hooks calling without touching relations itself
void  Relational::call_rel_hooks(int fla)
{
  Initialize(Relational::call_rel_hooks);  
  int sz = rel_list.size();
  if (sz == 0) return;
  RelType* rt = 0;
  Relation* rl;
  for (rl = rel_list[0] ;
       rl ;
       rl = get_next_rel(rel_list, rt))
  {
    rt = rl->get_rel_type();
    RelType *irt = rt->get_inv_type();
    Obj * m = get_ptr(rt);
    if (!m || !rt )
          continue;
    if((!rt->hook) && (!irt->hook))
          continue;
    int hcsf = rt->hcs || irt->hcs;
    if(m->collectionp() && !hcsf)
    {
      Obj * el;
      if (fla == 1) {
        ForEach(el, *m)
        {
	  call_rel_hook(fla, rt, irt, this, (Relational *)el);
	  if (rt == ref_smt_of_dd) break; 
        }
      }
      else {
        objSet ms(m);
        ForEach(el, ms)
        {
	  call_rel_hook(fla, rt, irt, this, (Relational *)el);
        }
      }
    }
    else
      call_rel_hook(fla, rt, irt, this, (Relational *)m);
  }
}
void Relational :: call_rel_hooks ( int fla ) { Initialize ( Relational :: call_rel_hooks ) ; int sz = rel_list . size ( ) ; if ( sz == 0 ) return ; RelType * rt = 0 ; Relation * rl ; for ( rl = rel_list [ 0 ] ; rl ; rl = get_next_rel ( rel_list , rt ) ) { rt = rl -> get_rel_type ( ) ; RelType * irt = rt -> get_inv_type ( ) ; Obj * m = get_ptr ( rt ) ; if ( ! m || ! rt ) continue ; if ( ( ! rt -> hook ) && ( ! irt -> hook ) ) continue ; int hcsf = rt -> hcs || irt -> hcs ; if ( m -> collectionp ( ) && ! hcsf ) { Obj * el ; if ( fla == 1 ) { ForEach ( el , * m ) { call_rel_hook ( fla , rt , irt , this , ( Relational * ) el ) ; if ( rt == ref_smt_of_dd ) break ; } } else { objSet ms ( m ) ; ForEach ( el , ms ) { call_rel_hook ( fla , rt , irt , this , ( Relational * ) el ) ; } } } else call_rel_hook ( fla , rt , irt , this , ( Relational * ) m ) ; } }
Remove relation hooks calling without touching relations itself
Remove relation hooks calling without touching relations itself
// no need to do same action for all.