Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Private Attributes
hashfunc_rep< T, U > Class Template Reference

#include <hashfunc.hpp>

Inheritance diagram for hashfunc_rep< T, U >:
Inheritance graph
[legend]
Collaboration diagram for hashfunc_rep< T, U >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 hashfunc_rep (U(*func2)(T), U init)
apply (T x)

Public Attributes

int ref_count

Private Attributes

U(* func )(T)
hashmap< T, U > remember

Detailed Description

template<class T, class U>
class hashfunc_rep< T, U >

Definition at line 16 of file hashfunc.hpp.


Constructor & Destructor Documentation

template<class T , class U >
hashfunc_rep< T, U >::hashfunc_rep ( U(*)(T func2,
init 
) [inline]

Definition at line 20 of file hashfunc.hpp.

                                              :
    func (func2), remember (init) {}

Member Function Documentation

template<class T , class U >
U hashfunc_rep< T, U >::apply ( T  x)

Definition at line 17 of file hashfunc.cpp.

                             {
  if (remember->contains (x)) return remember[x];
  U y= func (x);
  remember(x)= y;
  return y;
}

Member Data Documentation

template<class T , class U >
U(* hashfunc_rep< T, U >::func)(T) [private]

Definition at line 17 of file hashfunc.hpp.

int concrete_struct::ref_count [inherited]

Definition at line 135 of file basic.hpp.

template<class T , class U >
hashmap<T,U> hashfunc_rep< T, U >::remember [private]

Definition at line 18 of file hashfunc.hpp.


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