binary_helper< pair< C1, C2 > > Struct Template Reference

#include <pair.hpp>

Inheritance diagram for binary_helper< pair< C1, C2 > >:
void_binary_helper< pair< C1, C2 > >

List of all members.

Static Public Member Functions


Detailed Description

template<typename C1, typename C2>
struct mmx::binary_helper< pair< C1, C2 > >

Definition at line 68 of file pair.hpp.


Member Function Documentation

static generic access ( const pair< C1, C2 > &  v,
nat  i 
) [inline, static]

Reimplemented from void_binary_helper< pair< C1, C2 > >.

Definition at line 75 of file pair.hpp.

References ERROR.

00075                                                       {
00076     if (i == 0) return as<generic> (v.x1);
00077     else if (i == 1) return as<generic> (v.x2);
00078     else ERROR ("index out of range"); }

static pair<C1,C2> assemble ( const generic v  )  [inline, static]

Reimplemented from void_binary_helper< pair< C1, C2 > >.

Definition at line 81 of file pair.hpp.

References Pair, and mmx::vector_access().

00081                                                  {
00082     return Pair (as<C1> (vector_access (v, 0)),
00083                  as<C2> (vector_access (v, 1))); }

static generic disassemble ( const pair< C1, C2 > &  v  )  [inline, static]

Reimplemented from void_binary_helper< pair< C1, C2 > >.

Definition at line 79 of file pair.hpp.

References mmx::gen_vec().

00079                                                     {
00080     return gen_vec (as<generic> (v.x1), as<generic> (v.x2)); }

static generic full_type_name (  )  [inline, static]

Reimplemented from void_binary_helper< pair< C1, C2 > >.

Definition at line 71 of file pair.hpp.

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

00071                                           {
00072     return gen ("Pair", Full_type_name (C1), Full_type_name (C2)); }

static pair<C1,C2> read ( const port in  )  [inline, static]

Reimplemented from void_binary_helper< pair< C1, C2 > >.

Definition at line 87 of file pair.hpp.

References mmx::C2, and Pair.

00087                                            {
00088     C1 x1= binary_read<C1> (in);
00089     C2 x2= binary_read<C2> (in);
00090     return Pair (x1, x2); }

static string short_type_name (  )  [inline, static]

Reimplemented from void_binary_helper< pair< C1, C2 > >.

Definition at line 69 of file pair.hpp.

References mmx::C2, and Short_type_name.

00069                                           {
00070     return "Pa" * Short_type_name (C1) * Short_type_name (C2); }

static nat size ( const pair< C1, C2 > &  v  )  [inline, static]

Reimplemented from void_binary_helper< pair< C1, C2 > >.

Definition at line 73 of file pair.hpp.

00073                                          {
00074     (void) v; return 2; }

static void write ( const port out,
const pair< C1, C2 > &  p 
) [inline, static]

Reimplemented from void_binary_helper< pair< C1, C2 > >.

Definition at line 84 of file pair.hpp.

00084                                                             {
00085     binary_write<C1> (out, p.x1);
00086     binary_write<C2> (out, p.x2); }


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

Generated on 6 Dec 2012 for basix by  doxygen 1.6.1