Package: GrAL Base        GrAL: Packages | Concepts | Homepage

GrAL::grid_function_hash_base< E, T > Class Template Reference
[Grid Functions]

Implements a grid_function on hash-basis.

This can be used if arrays are not possible, or for partial grid functions. More...

#include </home/guntram/tmp/GrAL/gral/base/include/Gral/Base/grid-function-hash.h>

Inheritance diagram for GrAL::grid_function_hash_base< E, T >:

Inheritance graph
[legend]
Collaboration diagram for GrAL::grid_function_hash_base< E, T >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef element_traits< E > et
typedef E element_type
typedef et::hasher_type hasher_type
typedef et::grid_type grid_type
typedef STDHASH::hash_map< E,
T, hasher_type > 
table_type
typedef table_type::size_type size_type
typedef T value_type
typedef T & reference
typedef T const & const_reference
typedef table_type::pointer pointer
typedef table_type::difference_type difference_type
typedef E const & argument_type
typedef const_reference result_type
typedef
grid_function_hash_base< E, T > 
gfc2dh
typedef table_type::iterator base_it
typedef table_type::const_iterator base_cit
typedef iter iterator
typedef const_iter const_iterator

Public Member Functions

 grid_function_hash_base (const grid_type &gg)
 grid_function_hash_base (ref_ptr< grid_type const > gg)
 grid_function_hash_base (const gfc2dh &rs)
gfc2dhoperator= (const gfc2dh &rs)
void set_grid (ref_ptr< grid_type const > gg)
void set_grid (const grid_type &gg)
const grid_type & TheGrid () const
bool defined (const E &e) const
void undefine (const E &e)
unsigned size () const
bool empty () const
void clear ()
iter begin ()
iter end ()
const_iter begin () const
const_iter end () const

Protected Attributes

ref_ptr< grid_type const > g
table_type table


Detailed Description

template<class E, class T>
class GrAL::grid_function_hash_base< E, T >

Implements a grid_function on hash-basis.

This can be used if arrays are not possible, or for partial grid functions.

Access operations have slightly different semantics for total and partial grid-functions, so corresponding derivations grid_function_hash and partial_grid_function_hash are provided.

The main difference between a partial grid function and a hashed total grid function is the handling of read access to undefined item: in the total version this is an error (program termination in debug mode!), whereas for the partial version a default value (which can be manipulated seperately) is returned.

Todo:
Optimization: Could use hash_table<element_handle,T> instead of hash_table<Element,T>. However, in some cases it is not possible to implement equality testing of the underlying elements without referring to the grid.
See also:
grid_function_vector

Grid Functions

Definition at line 59 of file grid-function-hash.h.


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

©  Guntram Berti 1997-2009. See the GrAL Homepage for up-to-date information.

Generated on Tue Mar 31 19:11:07 2009 for GrAL Base by doxygen 1.5.8