Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Private Attributes
ip_observer_rep Class Reference
Inheritance diagram for ip_observer_rep:
Inheritance graph
[legend]
Collaboration diagram for ip_observer_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ip_observer_rep (path ip2)
int get_type ()
tm_ostreamprint (tm_ostream &out)
void announce (tree &ref, modification mod)
void done (tree &ref, modification mod)
void touched (tree &ref, path p)
void notify_assign (tree &ref, tree t)
void notify_insert (tree &ref, int pos, int nr)
void notify_remove (tree &ref, int pos, int nr)
void notify_split (tree &ref, int pos, tree prev)
void notify_var_split (tree &ref, tree t1, tree t2)
void notify_join (tree &ref, int pos, tree next)
void notify_var_join (tree &ref, tree t, int offset)
void notify_assign_node (tree &ref, tree_label op)
void notify_insert_node (tree &ref, int pos)
void notify_remove_node (tree &ref, int pos)
void notify_detach (tree &ref, tree closest, bool right)
bool get_ip (path &ip)
bool set_ip (path ip)
virtual void announce_assign (tree &ref, path p, tree t)
virtual void announce_insert (tree &ref, path p, tree ins)
virtual void announce_remove (tree &ref, path p, int nr)
virtual void announce_split (tree &ref, path p)
virtual void announce_join (tree &ref, path p)
virtual void announce_assign_node (tree &ref, path p, tree_label op)
virtual void announce_insert_node (tree &ref, path p, tree ins)
virtual void announce_remove_node (tree &ref, path p)
virtual void announce_set_cursor (tree &ref, path p, tree data)
virtual void notify_set_cursor (tree &ref, int pos, tree data)
virtual bool get_position (tree &t, int &index)
virtual bool set_position (tree t, int index)
virtual observerget_child (int which)
virtual list< observerget_tree_pointers ()
virtual bool get_tree (tree &t)
virtual bool get_contents (int kind, blackbox &bb)
virtual bool set_highlight (int lan, int col, int start, int end)
virtual bool get_highlight (int lan, array< int > &cols)

Public Attributes

int ref_count

Private Attributes

path ip

Detailed Description

Definition at line 24 of file ip_observer.cpp.


Constructor & Destructor Documentation

Definition at line 27 of file ip_observer.cpp.

: ip (ip2) {}

Member Function Documentation

void ip_observer_rep::announce ( tree ref,
modification  mod 
) [virtual]

Reimplemented from observer_rep.

Definition at line 61 of file ip_observer.cpp.

                                                      {
  (void) ref;
  //cout << "Announce " << ip << ", " << p << "\n";
  if (!has_parent (ip)) return;
  tree& parent (subtree (the_et, reverse (ip->next)));
  parent->obs->announce (parent, ip->item * mod);
}

Here is the call graph for this function:

void observer_rep::announce_assign ( tree ref,
path  p,
tree  t 
) [virtual, inherited]

Definition at line 587 of file observer.cpp.

                                                        {
  (void) ref; (void) p; (void) t;
}

Here is the caller graph for this function:

void observer_rep::announce_assign_node ( tree ref,
path  p,
tree_label  op 
) [virtual, inherited]

Definition at line 612 of file observer.cpp.

                                                                    {
  (void) ref; (void) p; (void) op;
}

Here is the caller graph for this function:

void observer_rep::announce_insert ( tree ref,
path  p,
tree  ins 
) [virtual, inherited]

Definition at line 592 of file observer.cpp.

                                                          {
  (void) ref; (void) p; (void) ins;
}

Here is the caller graph for this function:

void observer_rep::announce_insert_node ( tree ref,
path  p,
tree  ins 
) [virtual, inherited]

Definition at line 617 of file observer.cpp.

                                                               {
  (void) ref; (void) p; (void) ins;
}

Here is the caller graph for this function:

void observer_rep::announce_join ( tree ref,
path  p 
) [virtual, inherited]

Definition at line 607 of file observer.cpp.

                                              {
  (void) ref; (void) p;
}

Here is the caller graph for this function:

void observer_rep::announce_remove ( tree ref,
path  p,
int  nr 
) [virtual, inherited]

Definition at line 597 of file observer.cpp.

                                                        {
  (void) ref; (void) p; (void) nr;
}

Here is the caller graph for this function:

void observer_rep::announce_remove_node ( tree ref,
path  p 
) [virtual, inherited]

Definition at line 622 of file observer.cpp.

                                                     {
  (void) ref; (void) p;
}

Here is the caller graph for this function:

void observer_rep::announce_set_cursor ( tree ref,
path  p,
tree  data 
) [virtual, inherited]

Definition at line 627 of file observer.cpp.

                                                               {
  (void) ref; (void) p; (void) data;
}

Here is the caller graph for this function:

void observer_rep::announce_split ( tree ref,
path  p 
) [virtual, inherited]

Definition at line 602 of file observer.cpp.

                                               {
  (void) ref; (void) p;
}

Here is the caller graph for this function:

void ip_observer_rep::done ( tree ref,
modification  mod 
) [virtual]

Reimplemented from observer_rep.

Definition at line 70 of file ip_observer.cpp.

                                                  {
  (void) ref;
  //cout << "Done " << ip << ", " << p << "\n";
  if (!has_parent (ip)) return;
  tree& parent (subtree (the_et, reverse (ip->next)));
  parent->obs->done (parent, ip->item * mod);
}

Here is the call graph for this function:

observer & observer_rep::get_child ( int  which) [virtual, inherited]

Reimplemented in list_observer_rep.

Definition at line 716 of file observer.cpp.

                                  {
  (void) which;
  return nil_observer;
}
bool observer_rep::get_contents ( int  kind,
blackbox bb 
) [virtual, inherited]

Reimplemented in list_observer_rep, and tree_addendum_rep.

Definition at line 733 of file observer.cpp.

                                                  {
  (void) kind; (void) bb;
  return false;
}
bool observer_rep::get_highlight ( int  lan,
array< int > &  cols 
) [virtual, inherited]

Reimplemented in list_observer_rep, and highlight_observer_rep.

Definition at line 745 of file observer.cpp.

                                                      {
  (void) lan; (void) cols; return false;
}
bool ip_observer_rep::get_ip ( path ip) [virtual]

Reimplemented from observer_rep.

Definition at line 189 of file ip_observer.cpp.

                                  {
  ip2= ip;
  return true;
}
bool observer_rep::get_position ( tree t,
int &  index 
) [virtual, inherited]

Reimplemented in list_observer_rep, and tree_position_rep.

Definition at line 704 of file observer.cpp.

                                               {
  (void) t; (void) index;
  return false;
}
bool observer_rep::get_tree ( tree t) [virtual, inherited]

Reimplemented in list_observer_rep, tree_addendum_rep, and tree_pointer_rep.

Definition at line 727 of file observer.cpp.

                               {
  (void) t;
  return false;
}
list< observer > observer_rep::get_tree_pointers ( ) [virtual, inherited]

Reimplemented in list_observer_rep, and tree_pointer_rep.

Definition at line 722 of file observer.cpp.

                                 {
  return list<observer> ();
}
int ip_observer_rep::get_type ( ) [inline, virtual]

Reimplemented from observer_rep.

Definition at line 28 of file ip_observer.cpp.

{ return OBSERVER_IP; }
void ip_observer_rep::notify_assign ( tree ref,
tree  t 
) [virtual]

Reimplemented from observer_rep.

Definition at line 92 of file ip_observer.cpp.

                                                 {
  // cout << "Notify assign " << ref << ", " << t << "\n";
  path temp_ip= obtain_ip (ref);
  temp_ip= path (temp_ip->item, temp_ip->next); // prevents overriding temp_ip
  detach_ip (ref);
  attach_ip (t, temp_ip);
}

Here is the call graph for this function:

void ip_observer_rep::notify_assign_node ( tree ref,
tree_label  op 
) [virtual]

Reimplemented from observer_rep.

Definition at line 155 of file ip_observer.cpp.

                                                             {
  // cout << "Notify assign node " << ref << ", " << as_string (op) << "\n";
  (void) ref; (void) op;
}
void ip_observer_rep::notify_detach ( tree ref,
tree  closest,
bool  right 
) [virtual]

Reimplemented from observer_rep.

Definition at line 180 of file ip_observer.cpp.

                                                                   {
  (void) ref; (void) closest; (void) right;
}
void ip_observer_rep::notify_insert ( tree ref,
int  pos,
int  nr 
) [virtual]

Reimplemented from observer_rep.

Definition at line 101 of file ip_observer.cpp.

                                                          {
  // cout << "Notify insert " << ref << ", " << pos << ", " << nr << "\n";
  (void) nr;
  if (is_compound (ref)) {
    int i, n= N(ref);
    for (i=pos; i<n; i++)
      attach_ip (ref[i], path (i, ip));
  }
}

Here is the call graph for this function:

void ip_observer_rep::notify_insert_node ( tree ref,
int  pos 
) [virtual]

Reimplemented from observer_rep.

Definition at line 161 of file ip_observer.cpp.

                                                       {
  // cout << "Notify insert node " << ref << ", " << pos << "\n";
  ip= path (pos, ip);
  attach_ip (ref[pos], ip); // updates children's ips
  attach_ip (ref, ip->next);
}

Here is the call graph for this function:

void ip_observer_rep::notify_join ( tree ref,
int  pos,
tree  next 
) [virtual]

Reimplemented from observer_rep.

Definition at line 139 of file ip_observer.cpp.

                                                           {
  // cout << "Notify join " << ref << ", " << pos << ", " << next << "\n";
  int i, n= N(ref);
  detach_ip (ref[pos]);
  detach_ip (ref[pos+1]);
  for (i=pos+2; i<n; i++)
    attach_ip (ref[i], path (i-1, ip));
  attach_ip (next, path (pos, ip));
}

Here is the call graph for this function:

void ip_observer_rep::notify_remove ( tree ref,
int  pos,
int  nr 
) [virtual]

Reimplemented from observer_rep.

Definition at line 112 of file ip_observer.cpp.

                                                          {
  // cout << "Notify remove " << ref << ", " << pos << ", " << nr << "\n";
  (void) nr;
  if (is_compound (ref)) {
    int i, n= N(ref);
    for (i=pos; i<(pos+nr); i++)
      detach_ip (ref[i]);
    for (; i<n; i++)
      attach_ip (ref[i], path (i-nr, ip));
  }
}

Here is the call graph for this function:

void ip_observer_rep::notify_remove_node ( tree ref,
int  pos 
) [virtual]

Reimplemented from observer_rep.

Definition at line 169 of file ip_observer.cpp.

                                                       {
  // cout << "Notify remove node " << ref << ", " << pos << "\n";
  for (int i=0; i<N(ref); i++)
    if (i != pos)
      detach_ip (ref[i]);
  if ((!is_nil (ip)) && (ip->item>=0)) attach_ip (ref[pos], ip);
  else detach_ip (ref[pos]);
  ip= DETACHED; // detach_ip (ref);
}

Here is the call graph for this function:

void observer_rep::notify_set_cursor ( tree ref,
int  pos,
tree  data 
) [virtual, inherited]

Reimplemented in list_observer_rep.

Definition at line 682 of file observer.cpp.

                                                              {
  (void) ref; (void) pos; (void) data;
}
void ip_observer_rep::notify_split ( tree ref,
int  pos,
tree  prev 
) [virtual]

Reimplemented from observer_rep.

Definition at line 125 of file ip_observer.cpp.

                                                            {
  // cout << "Notify split " << ref << ", " << pos << ", " << prev << "\n";
  int i, n= N(ref);
  detach_ip (prev);
  for (i=pos; i<n; i++)
    attach_ip (ref[i], path (i, ip));
}

Here is the call graph for this function:

void ip_observer_rep::notify_var_join ( tree ref,
tree  t,
int  offset 
) [virtual]

Reimplemented from observer_rep.

Definition at line 150 of file ip_observer.cpp.

                                                               {
  (void) ref; (void) t; (void) offset;
}
void ip_observer_rep::notify_var_split ( tree ref,
tree  t1,
tree  t2 
) [virtual]

Reimplemented from observer_rep.

Definition at line 134 of file ip_observer.cpp.

                                                              {
  (void) ref; (void) t1; (void) t2;
}
tm_ostream& ip_observer_rep::print ( tm_ostream out) [inline, virtual]

Reimplemented from observer_rep.

Definition at line 29 of file ip_observer.cpp.

{ return out << " " << ip; }
bool observer_rep::set_highlight ( int  lan,
int  col,
int  start,
int  end 
) [virtual, inherited]

Reimplemented in list_observer_rep, and highlight_observer_rep.

Definition at line 739 of file observer.cpp.

                                                                 {
  (void) col; (void) start; (void) end; (void) lan;
  return false;
}
bool ip_observer_rep::set_ip ( path  ip) [virtual]

Reimplemented from observer_rep.

Definition at line 195 of file ip_observer.cpp.

                                 {
  if (is_nil (ip) || is_nil (ip2))
    FAILED ("cannot alter global root");
  ip->item= ip2->item;
  ip->next= ip2->next;
  return true;
}

Here is the call graph for this function:

bool observer_rep::set_position ( tree  t,
int  index 
) [virtual, inherited]

Reimplemented in list_observer_rep, and tree_position_rep.

Definition at line 710 of file observer.cpp.

                                             {
  (void) t; (void) index;
  return false;
}
void ip_observer_rep::touched ( tree ref,
path  p 
) [virtual]

Reimplemented from observer_rep.

Definition at line 79 of file ip_observer.cpp.

                                           {
  (void) ref;
  //cout << "Touched " << ip << ", " << p << "\n";
  if (!has_parent (ip)) return;
  tree& parent (subtree (the_et, reverse (ip->next)));
  parent->obs->touched (parent, path (ip->item, p));
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 25 of file ip_observer.cpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.


The documentation for this class was generated from the following file: