Back to index

texmacs  1.0.7.15
Classes | Defines | Functions | Variables
ip_observer.cpp File Reference
#include "modification.hpp"

Go to the source code of this file.

Classes

class  ip_observer_rep

Defines

#define DETACHED   (-5)

Functions

bool has_parent (path ip)
void attach_ip (tree &ref, path ip)
void detach_ip (tree &ref)
path obtain_ip (tree &ref)
bool ip_attached (path ip)
observer ip_observer (path ip)

Variables

tree the_et

Define Documentation

#define DETACHED   (-5)

Definition at line 17 of file ip_observer.cpp.


Function Documentation

void attach_ip ( tree ref,
path  ip 
)

Definition at line 204 of file ip_observer.cpp.

                               {
  // cout << "Set ip of " << ref << " to " << ip << "\n";
  if (is_nil (ref->obs) || !ref->obs->set_ip (ip)) {
    // cout << "Create ip observer " << ip << " for " << ref << "\n";
    ref->obs= list_observer (ip_observer (ip), ref->obs);
  }
  if (is_compound (ref)) {
    int i, n= N(ref);
    for (i=0; i<n; i++) {
      path old_ip= obtain_ip (ref[i]);
      if ((old_ip->item != i) || (!strong_equal (old_ip->next, ip))) {
       attach_ip (ref[i], path (i, ip));
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void detach_ip ( tree ref)

Definition at line 222 of file ip_observer.cpp.

                      {
  // cout << "Detach ip of " << ref << "\n";
  if (!is_nil (ref->obs))
    (void) ref->obs->set_ip (DETACHED);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool has_parent ( path  ip)

Definition at line 56 of file ip_observer.cpp.

                     {
  return !is_nil (ip) && last_item (ip) != DETACHED;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool ip_attached ( path  ip)

Definition at line 237 of file ip_observer.cpp.

                      {
  return is_nil (ip) || last_item (ip) != DETACHED;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 246 of file ip_observer.cpp.

                      {
  return tm_new<ip_observer_rep> (ip);
}

Here is the caller graph for this function:

path obtain_ip ( tree ref)

Definition at line 229 of file ip_observer.cpp.

                      {
  path ip;
  if (is_nil (ref->obs)) return DETACHED;
  if (!ref->obs->get_ip (ip)) return DETACHED;
  return ip;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 18 of file new_document.cpp.