model_server/obj/src/objRelation.h.cxx
// Add one relation - internal function (doesn't care about inversed one)
Add one relation - internal function (doesn't care about inversed one)
Add one relation - internal function ( doesn ' t care about inversed one )
void  Relational::priv_add_one_rel (Relational * m, RelType *rt)
  {
  Initialize(Relational::priv_add_one_rel);
  Assert(m);
  Assert(rt);
  if(rt->offset)
    {
    priv_add_one_ptr((Relational*)m, rt); 
    return;
    }    
  Relation* curr_rel = rel_list[rel_list.index(rt)];
  if(! curr_rel)
     {
      rel_list.append(rt, m);
      return;
     }
  if(rt->get_cardinality() == 1) {	
      Relational * m1 = (Relational *)curr_rel->members;
      if(m1 != m) {
        RelType * irt = rt->get_inv_type();
        call_rel_hook(-1, rt, irt, this, m1);
        m1->priv_rem_one_rel(this, irt);
	curr_rel = rel_list[rel_list.index(rt)];
        if(! curr_rel)
	    rel_list.append(rt, m);
	else 
	    curr_rel->members = m;
      }
    }
  else					
    {
      Obj * mb = curr_rel->members;
      if (mb->includes (m))
	  return;
      if(! mb->collectionp()) {
          objSet * ns = new objSet(2);
          ns->os_list.add(*mb); 
          curr_rel->members = mb = ns;
      }	  
      ((objSet *)mb)->os_list.add(*m);
    }
  }
void Relational :: priv_add_one_rel ( Relational * m , RelType * rt ) { Initialize ( Relational :: priv_add_one_rel ) ; Assert ( m ) ; Assert ( rt ) ; if ( rt -> offset ) { priv_add_one_ptr ( ( Relational * ) m , rt ) ; return ; } Relation * curr_rel = rel_list [ rel_list . index ( rt ) ] ; if ( ! curr_rel ) { rel_list . append ( rt , m ) ; return ; } if ( rt -> get_cardinality ( ) == 1 ) { Relational * m1 = ( Relational * ) curr_rel -> members ; if ( m1 != m ) { RelType * irt = rt -> get_inv_type ( ) ; call_rel_hook ( -1 , rt , irt , this , m1 ) ; m1 -> priv_rem_one_rel ( this , irt ) ; curr_rel = rel_list [ rel_list . index ( rt ) ] ; if ( ! curr_rel ) rel_list . append ( rt , m ) ; else curr_rel -> members = m ; } } else { Obj * mb = curr_rel -> members ; if ( mb -> includes ( m ) ) return ; if ( ! mb -> collectionp ( ) ) { objSet * ns = new objSet ( 2 ) ; ns -> os_list . add ( * mb ) ; curr_rel -> members = mb = ns ; } ( ( objSet * ) mb ) -> os_list . add ( * m ) ; } }
Add one relation - internal function (doesn't care about inversed one)
Add one relation - internal function ( doesn ' t care about inversed one )
//  Assert(m != this); // Find "Relation" object // Cardinality = 1 // hook can change rel_list // Cardinality > 1