Back to index

texmacs  1.0.7.15
Public Member Functions | Private Member Functions | Private Attributes | Friends
hashtree< K, V > Class Template Reference

#include <hashtree.hpp>

Inheritance diagram for hashtree< K, V >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 hashtree (const hashtree< K, V > &)
 ~hashtree ()
hashtree< K, V > & operator= (hashtree< K, V > x)
 hashtree ()
 hashtree (V val)
hashtree_rep< K, V > * operator-> (void)
hashtree< K, Voperator() (K key)
hashtree< K, Voperator[] (K key)

Private Member Functions

 hashtree (bool)
void realize ()

Private Attributes

hashtree_rep< K, V > * rep

Friends

class hashtree_rep< K, V >
bool is_nil (hashtree< K, V > ht)
int N (hashtree< K, V > ht)

Detailed Description

template<class K, class V>
class hashtree< K, V >

Definition at line 90 of file hashtree.hpp.


Constructor & Destructor Documentation

template<class K, class V>
hashtree< K, V >::hashtree ( bool  ) [inline, private]

Definition at line 95 of file hashtree.hpp.

: rep (NULL) {}
template<class K, class V>
hashtree< K, V >::hashtree ( const hashtree< K, V > &  x) [inline]

Definition at line 24 of file hashtree.cpp.

                                             : rep(x.rep) {
  if (this->rep!=NULL) INC_COUNT (this->rep);
}
template<class K , class V >
hashtree< K, V >::~hashtree ( ) [inline]

Definition at line 29 of file hashtree.cpp.

                         {
  if (this->rep!=NULL) DEC_COUNT (this->rep);
}
template<class K, class V>
hashtree< K, V >::hashtree ( ) [inline]

Definition at line 106 of file hashtree.hpp.

template<class K, class V>
hashtree< K, V >::hashtree ( V  val) [inline]

Definition at line 109 of file hashtree.hpp.

: rep (tm_new<hashtree_rep<K,V> > (val)) {}

Member Function Documentation

template<class K, class V >
hashtree< K, V > hashtree< K, V >::operator() ( key) [inline]

Definition at line 102 of file hashtree.cpp.

                                {
  realize ();
  if (!(*this)->contains (key)) (*this)->add_new_child (key);
  return (*this)->children (key);
}
template<class K , class V >
hashtree_rep< K, V > * hashtree< K, V >::operator-> ( void  ) [inline]

Definition at line 89 of file hashtree.cpp.

                               {
  // always make sure there is a rep!
  realize ();
  return rep;
}
template<class K, class V>
hashtree< K, V > & hashtree< K, V >::operator= ( hashtree< K, V x) [inline]

Definition at line 34 of file hashtree.cpp.

                                         {
  if (this->rep!=NULL) DEC_COUNT (this->rep); 
  this->rep = x.rep;
  if (x.rep!=NULL) INC_COUNT (x.rep);
  return *this;
}
template<class K, class V >
hashtree< K, V > hashtree< K, V >::operator[] ( key) [inline]

Definition at line 96 of file hashtree.cpp.

                                {
  if (*this->contains (key)) return *this->children (key);
  else FAILED ("read-access to non-existent node requested");
}

Here is the call graph for this function:

template<class K , class V >
void hashtree< K, V >::realize ( ) [inline, private]

Definition at line 77 of file hashtree.cpp.

                       {
  if (rep == NULL) {
    rep = tm_new<hashtree_rep<K,V> > ();
    INC_COUNT(rep);
  }
}

Here is the caller graph for this function:


Friends And Related Function Documentation

template<class K, class V>
friend class hashtree_rep< K, V > [friend]

Definition at line 125 of file hashtree.hpp.

template<class K, class V>
bool is_nil ( hashtree< K, V ht) [friend]

Definition at line 113 of file hashtree.cpp.

                          {
  return ht.rep == NULL;
}
template<class K, class V>
int N ( hashtree< K, V ht) [friend]

Definition at line 118 of file hashtree.cpp.

                     {
  return N(ht->children);
}

Member Data Documentation

template<class K, class V>
hashtree_rep<K,V>* hashtree< K, V >::rep [private]

Definition at line 92 of file hashtree.hpp.


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