Back to index

texmacs  1.0.7.15
Defines | Functions
hashmap.cpp File Reference
#include "hashmap.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define HASHMAP_CC
#define TMPL   template<class T, class U>
#define H   hashentry<T,U>

Functions

TMPL tm_ostreamoperator<< (tm_ostream &out, H h)
TMPL bool operator== (H h1, H h2)
TMPL bool operator!= (H h1, H h2)
TMPL tm_ostreamoperator<< (tm_ostream &out, hashmap< T, U > h)
TMPL bool operator== (hashmap< T, U > h1, hashmap< T, U > h2)
TMPL bool operator!= (hashmap< T, U > h1, hashmap< T, U > h2)

Define Documentation

#define H   hashentry<T,U>

Definition at line 16 of file hashmap.cpp.

#define HASHMAP_CC

Definition at line 13 of file hashmap.cpp.

#define TMPL   template<class T, class U>

Definition at line 15 of file hashmap.cpp.


Function Documentation

TMPL bool operator!= ( H  h1,
H  h2 
)

Definition at line 40 of file hashmap.cpp.

                         {
  return (h1.code!=h2.code) || (h1.key!=h2.key) || (h1.im!=h2.im);
}
TMPL bool operator!= ( hashmap< T, U >  h1,
hashmap< T, U >  h2 
)

Definition at line 187 of file hashmap.cpp.

                                               {
  return !(h1 == h2);
}
TMPL tm_ostream& operator<< ( tm_ostream out,
H  h 
)

Definition at line 29 of file hashmap.cpp.

                                   {
  out << h.key << "->" << h.im;
  return out;
}
TMPL tm_ostream& operator<< ( tm_ostream out,
hashmap< T, U >  h 
)

Definition at line 139 of file hashmap.cpp.

                                              {
  int i= 0, j= 0, n= h->n, size= h->size;
  out << "{ ";
  for (; i<n; i++) {
    list<hashentry<T,U> > l= h->a[i];
    for (; !is_nil (l); l= l->next, j++) {
      out << l->item;
      if (j != size-1) out << ", ";
    }
  }
  out << " }";
  return out;
}

Here is the call graph for this function:

TMPL bool operator== ( H  h1,
H  h2 
)

Definition at line 35 of file hashmap.cpp.

                         {
  return (h1.code==h2.code) && (h1.key==h2.key) && (h1.im==h2.im);
}
TMPL bool operator== ( hashmap< T, U >  h1,
hashmap< T, U >  h2 
)

Definition at line 175 of file hashmap.cpp.

                                               {
  if (h1->size != h2->size) return false;
  int i= 0, n= h1->n;
  for (; i<n; i++) {
    list<hashentry<T,U> > l= h1->a[i];
    for (; !is_nil(l); l=l->next)
      if (h2[l->item.key] != l->item.im) return false;
  }
  return true;
}

Here is the call graph for this function: