binary_helper< chain< C > > Struct Template Reference

#include <chain.hpp>

Inheritance diagram for binary_helper< chain< C > >:
void_binary_helper< chain< C > >

List of all members.

Static Public Member Functions


Detailed Description

template<typename C>
struct mmx::binary_helper< chain< C > >

Definition at line 156 of file chain.hpp.


Member Function Documentation

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

Definition at line 189 of file port.hpp.

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

static chain<C> assemble ( const generic g  )  [inline, static]

Reimplemented from void_binary_helper< chain< C > >.

Definition at line 167 of file chain.hpp.

References Chain, and mmx::N().

00167                                            {
00168     vector<generic> v= as<vector<generic> > (g);
00169     if (N(v) == 0) return Chain ();
00170     else if (N(v) == 1) return Chain (as<C> (v[0]));
00171     else return Chain (as<Chain > (v[0]), as<C> (v[1]), as<Chain > (v[2])); }

static generic disassemble ( const chain< C > &  c  )  [inline, static]

Reimplemented from void_binary_helper< chain< C > >.

Definition at line 161 of file chain.hpp.

References mmx::gen_vec(), mmx::left(), mmx::middle(), mmx::N(), and mmx::right().

00161                                               {
00162     if (N(c) == 0) return gen_vec ();
00163     else if (N(c) == 1) return gen_vec (as<generic> (middle (c)));
00164     else return gen_vec (as<generic> (left (c)),
00165                          as<generic> (middle (c)),
00166                          as<generic> (right (c))); }

static generic full_type_name (  )  [inline, static]

Reimplemented from void_binary_helper< chain< C > >.

Definition at line 159 of file chain.hpp.

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

00159                                           {
00160     return gen ("Chain", Full_type_name (C)); }

static chain<C> read ( const port in  )  [inline, static]

Reimplemented from void_binary_helper< chain< C > >.

Definition at line 185 of file chain.hpp.

References n, and void_binary_helper< C >::read().

00185                                             {
00186     nat n = binary_read<nat> (in);
00187     return read (in, n); }

static chain<C> read ( const port in,
nat  n 
) [inline, static]

Definition at line 179 of file chain.hpp.

References Chain.

00179                                             {
00180     if (n == 0) return Chain ();
00181     else if (n == 1) return Chain (binary_read<C> (in));
00182     else return Chain (binary_read<Chain > (in, n >> 1),
00183                        binary_read<C> (in),
00184                        binary_read<Chain > (in, (n-1) >> 1)); }

static string short_type_name (  )  [inline, static]

Reimplemented from void_binary_helper< chain< C > >.

Definition at line 157 of file chain.hpp.

References mmx::C, and Short_type_name.

00157                                           {
00158     return "Ch" * Short_type_name (C); }

static nat size ( const chain< C > &  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 chain< C > &  c 
) [inline, static]

Reimplemented from void_binary_helper< chain< C > >.

Definition at line 176 of file chain.hpp.

References mmx::N().

00176                                                              {
00177     binary_write<nat> (out, N(c));
00178     write_bis (out, c); }

static void write_bis ( const port out,
const chain< C > &  c 
) [inline, static]

Definition at line 172 of file chain.hpp.

References mmx::left(), mmx::middle(), and mmx::right().

00172                                                           {
00173     write_bis (out, left (c));
00174     binary_write<C> (out, middle (c));
00175     write_bis (out, right (c)); }


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

Generated on 6 Dec 2012 for basix by  doxygen 1.6.1