Example #1
0
  void assign(Int& x, const Int& y)
  { 
    switch (step)
    {
      case 0: 
      { step = 1;

        tmp = &x;
        i = &const_cast<Int&>(y);

        insert(assign_event,tmp,i);

        break;      
      }
      
      case 1:
      { 
        if (&x != i) 
        {
          init(); 
          clear();
          occur<Int&,const Int&>(assign_event,x,y);      
        
          break; 
        }      
        
        step = 2;
        j = &const_cast<Int&>(y);

        insert(assign_event,i,j);
        break;
      }
    
      case 2:
      { if (&x == j && &const_cast<Int&>(y) == tmp) 
        { occur<const Int&,const Int&>(swap_event,*i,*j);                
          EQ.clear();
        }
        else
        { init();        
          clear();           
          occur<Int&,const Int&>(assign_event,x,y); 
        }
                
        break;
      }    
    };
  }