Back to index

texmacs  1.0.7.15
Classes | Defines | Functions
list_observer.cpp File Reference
#include "modification.hpp"
#include "blackbox.hpp"

Go to the source code of this file.

Classes

class  list_observer_rep

Defines

#define DETACHED   (-5)

Functions

observer list_observer (observer o1, observer o2)
void insert_observer (observer &o, observer what)
void remove_observer (observer &o, observer what)
void clean_observers (observer &o)
void attach_observer (tree &ref, observer o)
void detach_observer (tree &ref, observer o)
void clean_observers (tree &ref)

Define Documentation

#define DETACHED   (-5)

Definition at line 18 of file list_observer.cpp.


Function Documentation

void attach_observer ( tree ref,
observer  o 
)

Definition at line 269 of file list_observer.cpp.

                                        {
  insert_observer (ref->obs, o);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void clean_observers ( observer o)

Definition at line 256 of file list_observer.cpp.

                              {
  if (is_nil (o)) return;
  if (o->get_type () == OBSERVER_IP) return;
  if (o->get_type () == OBSERVER_LIST) {
    clean_observers (o->get_child (0));
    clean_observers (o->get_child (1));
    if (is_nil (o->get_child (0))) o= o->get_child (1);
    else if (is_nil (o->get_child (1))) o= o->get_child (0);
  }
  else o= nil_observer;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void clean_observers ( tree ref)

Definition at line 279 of file list_observer.cpp.

                            {
  clean_observers (ref->obs);
}

Here is the call graph for this function:

void detach_observer ( tree ref,
observer  o 
)

Definition at line 274 of file list_observer.cpp.

                                        {
  remove_observer (ref->obs, o);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void insert_observer ( observer o,
observer  what 
)

Definition at line 241 of file list_observer.cpp.

                                             {
  o= list_observer (o, what);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 234 of file list_observer.cpp.

                                         {
  if (is_nil (o1)) return o2;
  if (is_nil (o2)) return o1;
  return tm_new<list_observer_rep> (o1, o2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void remove_observer ( observer o,
observer  what 
)

Definition at line 246 of file list_observer.cpp.

                                             {
  if (is_nil (o)) return;
  else if (o == what) o= nil_observer;
  else {
    remove_observer (o->get_child (0), what);
    remove_observer (o->get_child (1), what);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function: