Back to index

texmacs  1.0.7.15
Classes | Defines | Functions
tree_position.cpp File Reference
#include "tree.hpp"
#include "path.hpp"

Go to the source code of this file.

Classes

class  tree_position_rep

Defines

#define DETACHED   (-5)

Functions

void reattach_at (tree_position_rep *rep, tree t, int index)
void reattach_left (tree_position_rep *rep, tree t)
void reattach_right (tree_position_rep *rep, tree t)
observer tree_position (tree ref, int index)
path obtain_position (observer o)

Define Documentation

#define DETACHED   (-5)

Definition at line 18 of file tree_position.cpp.


Function Documentation

Definition at line 191 of file tree_position.cpp.

                             {
  tree t;
  int  index;
  if (!o->get_position (t, index)) return path ();
  path ip= obtain_ip (t);
  if (ip == path (DETACHED)) return path ();
  return reverse (ip) * index;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void reattach_at ( tree_position_rep rep,
tree  t,
int  index 
)

Definition at line 71 of file tree_position.cpp.

                                                        {
  rep->set_position (t, index);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void reattach_left ( tree_position_rep rep,
tree  t 
)

Definition at line 75 of file tree_position.cpp.

                                                    {
  reattach_at (rep, t, 0); }

Here is the call graph for this function:

Here is the caller graph for this function:

void reattach_right ( tree_position_rep rep,
tree  t 
)

Definition at line 77 of file tree_position.cpp.

                                                     {
  reattach_at (rep, t, right_index (t)); }

Here is the call graph for this function:

Here is the caller graph for this function:

observer tree_position ( tree  ref,
int  index 
)

Definition at line 186 of file tree_position.cpp.

                                    {
  return tm_new<tree_position_rep> (ref, index);
}

Here is the call graph for this function:

Here is the caller graph for this function: