binary_helper< new_table< C, T, V > > Struct Template Reference

#include <new_table.hpp>

Inheritance diagram for binary_helper< new_table< C, T, V > >:
void_binary_helper< new_table< C, T, V > >

List of all members.

Static Public Member Functions


Detailed Description

template<typename C, typename T, typename V>
struct mmx::binary_helper< new_table< C, T, V > >

Definition at line 502 of file new_table.hpp.


Member Function Documentation

static generic access ( const new_table< C, T, V > &  x,
nat  i 
) [inline, static, inherited]

Definition at line 189 of file port.hpp.

00189                                                    {
00190     return vector_access (disassemble (x), i); }

static new_table<C,T,V> assemble ( const generic x  )  [inline, static]

Reimplemented from void_binary_helper< new_table< C, T, V > >.

Definition at line 513 of file new_table.hpp.

References mmx::N(), Table, pair< C1, C2 >::x1, and pair< C1, C2 >::x2.

00513                                                   {
00514     vector<generic> v= as<vector<generic> > (x);
00515     Table t (as<C> (v[0]));
00516     for (nat i=1; i<N(v); i++) {
00517       pair<T,C> p= as<pair<T,C> > (v[i]);
00518       t[p.x1]= p.x2;
00519     }
00520     return t; }

static generic disassemble ( const new_table< C, T, V > &  t  )  [inline, static]

Reimplemented from void_binary_helper< new_table< C, T, V > >.

Definition at line 507 of file new_table.hpp.

References mmx::busy(), mmx::I(), and mmx::iterate().

00507                                                      {
00508     vector<generic> v;
00509     v << as<generic> (I(t));
00510     for (iterator<pair<T,C> > it= iterate (t); busy (it); ++it)
00511       v << as<generic> (*it);
00512     return as<generic> (v); }

static generic full_type_name (  )  [inline, static]

Reimplemented from void_binary_helper< new_table< C, T, V > >.

Definition at line 505 of file new_table.hpp.

References mmx::C, Full_type_name, mmx::gen(), and mmx::T.

00505                                           {
00506     return gen ("Table", Full_type_name (T), Full_type_name (C)); }

static new_table<C,T,V> read ( const port in  )  [inline, static]

Reimplemented from void_binary_helper< new_table< C, T, V > >.

Definition at line 528 of file new_table.hpp.

References mmx::C, Format2, mmx::init(), n, mmx::T, and Table.

00528                                             {
00529     C init= binary_read<C> (in);
00530     Format2 fm2= binary_read<Format2 > (in);
00531     Table t (init, fm2);
00532     nat n= binary_read<nat> (in);
00533     for (nat i=0; i<n; i++) {
00534       T key= binary_read<T> (in);
00535       t[key]= binary_read<C> (in);
00536     }
00537     return t; }

static string short_type_name (  )  [inline, static]

Reimplemented from void_binary_helper< new_table< C, T, V > >.

Definition at line 503 of file new_table.hpp.

References mmx::C, Short_type_name, and mmx::T.

00503                                           {
00504     return "T" * Short_type_name (C) * Short_type_name (T); }

static nat size ( const new_table< C, T, V > &  x  )  [inline, static, inherited]

Definition at line 187 of file port.hpp.

00187                                       {
00188     return vector_size (disassemble (x)); }

static void write ( const port out,
const new_table< C, T, V > &  t 
) [inline, static]

Reimplemented from void_binary_helper< new_table< C, T, V > >.

Definition at line 521 of file new_table.hpp.

References mmx::busy(), mmx::CF2(), mmx::entries(), mmx::I(), and mmx::N().

00521                                                              {
00522     binary_write<C> (out, I (t));
00523     binary_write<Format2 > (out, CF2(t));
00524     binary_write<nat> (out, N (t));
00525     for (iterator<T> it= entries (t); busy (it); ++it) {
00526       binary_write<T> (out, *it);
00527       binary_write<C> (out, t[*it]); } }


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

Generated on 6 Dec 2012 for basix by  doxygen 1.6.1