Back to index

texmacs  1.0.7.15
Functions
transaction.cpp File Reference
#include "tmfs.hpp"

Go to the source code of this file.

Functions

transaction atom (string key, collection val)
void add (transaction &t, string key, string val, int eps)
transaction filter (transaction t, bool file_flag)
transaction simplify (transaction t)
transaction invert (transaction t)
void merge (transaction &t1, transaction t2)
transaction operator* (transaction t1, transaction t2)
int total_size (transaction t)

Function Documentation

void add ( transaction t,
string  key,
string  val,
int  eps 
)

Definition at line 26 of file transaction.cpp.

                                                      {
  //cout << "Add " << key << ", " << val << ", " << eps << "\n";
  if (!t->contains (key)) t (key)= collection ();
  t (key) (val)= eps;
}

Here is the caller graph for this function:

transaction atom ( string  key,
collection  val 
)

Definition at line 19 of file transaction.cpp.

                                  {
  transaction t;
  t(key)= val;
  return t;
}

Here is the caller graph for this function:

transaction filter ( transaction  t,
bool  file_flag 
)

Definition at line 33 of file transaction.cpp.

                                       {
  transaction r;
  iterator<string> it= iterate (t);
  while (it->busy ()) {
    string s= it->next ();
    collection c= filter (t[s], file_flag);
    if (N(c) != 0) r(s)= c;
  }
  return r;
}

Here is the call graph for this function:

Definition at line 57 of file transaction.cpp.

                       {
  transaction r;
  iterator<string> it= iterate (t);
  while (it->busy ()) {
    string s= it->next ();
    r(s)= invert (t[s]);
  }
  return r;
}

Here is the call graph for this function:

void merge ( transaction t1,
transaction  t2 
)

Definition at line 68 of file transaction.cpp.

                                        {
  //cout << "Merge " << t1 << ", " << t2 << "\n";
  iterator<string> it= iterate (t2);
  while (it->busy()) {
    string s= it->next ();
    if (!t1->contains (s)) t1(s)= collection ();
    merge (t1(s), t2[s]);
  }
}

Here is the call graph for this function:

transaction operator* ( transaction  t1,
transaction  t2 
)

Definition at line 79 of file transaction.cpp.

                                            {
  transaction r;
  merge (r, t1);
  merge (r, t2);
  return r;
}

Here is the call graph for this function:

Definition at line 45 of file transaction.cpp.

                         {
  transaction r;
  iterator<string> it= iterate (t);
  while (it->busy ()) {
    string s= it->next ();
    collection c= simplify (t[s]);
    if (N(c) != 0) r(s)= c;
  }
  return r;
}

Here is the call graph for this function:

int total_size ( transaction  t)

Definition at line 87 of file transaction.cpp.

                           {
  int sz= 1;
  iterator<string> it= iterate (t);
  while (it->busy ()) {
    string s= it->next ();
    sz += N(s) + total_size (t[s]);
  }
  return sz;
}

Here is the call graph for this function: