dispatcher_2_rep< R > Struct Template Reference

#include <dispatcher.hpp>

Inheritance diagram for dispatcher_2_rep< R >:
rep_struct

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<typename R>
struct mmx::dispatcher_2_rep< R >

Definition at line 121 of file dispatcher.hpp.


Member Typedef Documentation

typedef function_0<void> INV

Definition at line 123 of file dispatcher.hpp.

typedef function_2<R,const int&,const int&> LUP

Definition at line 122 of file dispatcher.hpp.


Constructor & Destructor Documentation

dispatcher_2_rep ( LUP lup,
INV inv1,
INV inv2,
int &  l1,
int &  l2,
bool &  r1,
bool &  r2 
) [inline]

Definition at line 135 of file dispatcher.hpp.

References dispatcher_2_rep< R >::invalidate_1, dispatcher_2_rep< R >::invalidate_2, dispatcher_2_rep< R >::len_1, dispatcher_2_rep< R >::len_2, dispatcher_2_rep< R >::n_1, dispatcher_2_rep< R >::n_2, dispatcher_2_rep< R >::refresh_1, dispatcher_2_rep< R >::refresh_2, and dispatcher_2_rep< R >::tab.

00136                                                                 :
00137     lookup (&lup),
00138     invalidate_1 (&inv1), invalidate_2 (&inv2),
00139     len_1 (&l1), len_2 (&l2),
00140     refresh_1 (&r1), refresh_2 (&r2),
00141     tab (mmx_new<R> (l1 * l2)),
00142     n_1 (l1), n_2 (l2) {
00143     *invalidate_1= invalidator_2<R> (*invalidate_1, &tab,
00144                                      &n_1, &n_2, len_1, len_2);
00145     if (refresh_2 != refresh_1)
00146       *invalidate_2= invalidator_2<R> (*invalidate_2, &tab,
00147                                        &n_1, &n_2, len_1, len_2); }
  inline ~dispatcher_2_rep () {

~dispatcher_2_rep (  )  [inline]

Definition at line 148 of file dispatcher.hpp.

References dispatcher_2_rep< R >::n_1, dispatcher_2_rep< R >::n_2, and dispatcher_2_rep< R >::tab.

00148                               {
00149     mmx_delete<R> (tab, n_1 * n_2); }


Member Function Documentation

R& dispatch ( int  i1,
int  i2 
) [inline]

Definition at line 150 of file dispatcher.hpp.

References mmx::is_nil(), dispatcher_2_rep< R >::lookup, dispatcher_2_rep< R >::n_2, dispatcher_2_rep< R >::refresh_1, dispatcher_2_rep< R >::refresh_2, and dispatcher_2_rep< R >::tab.

00150                                       {
00151     //printf ("[%i,%i]\n", i, n);
00152     if (*refresh_1) { (*invalidate_1) (); *refresh_1= false; }
00153     if (*refresh_2) { (*invalidate_2) (); *refresh_2= false; }
00154     R& r= tab[i1 * n_2 + i2];
00155     if (is_nil (r)) r= (*lookup) (i1, i2);
00156     return r; }


Member Data Documentation

Definition at line 125 of file dispatcher.hpp.

Referenced by dispatcher_2_rep< R >::dispatcher_2_rep().

Definition at line 126 of file dispatcher.hpp.

Referenced by dispatcher_2_rep< R >::dispatcher_2_rep().

int* len_1

Definition at line 127 of file dispatcher.hpp.

Referenced by dispatcher_2_rep< R >::dispatcher_2_rep().

int* len_2

Definition at line 128 of file dispatcher.hpp.

Referenced by dispatcher_2_rep< R >::dispatcher_2_rep().

Definition at line 124 of file dispatcher.hpp.

Referenced by dispatcher_2_rep< R >::dispatch().

int n_1
int n_2
MMX_ALLOCATORS int ref_count [inherited]

Definition at line 164 of file basix.hpp.

bool* refresh_1
bool* refresh_2
R* tab

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

Generated on 6 Dec 2012 for basix by  doxygen 1.6.1