Alchemy  1.0
A framework to robustly process network messages and structured data
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Static Public Member Functions | List of all members
Hg::EndianType< T, isSwap > Struct Template Reference

Policy class used to perform byte-order operations. More...

#include <byte_order.h>

Static Public Member Functions

static T swap_order (const T &value)
 Swaps the byte-order of value T based on platform endianess. More...
 

Detailed Description

template<typename T, bool isSwap>
struct Hg::EndianType< T, isSwap >

Policy class used to perform byte-order operations.

The EndianType struct is a policy class that provides the swap function. The swap capability is indicated by t0he isSwap template parameter.

Parameters
<typenameT> The type of variable to perform the swap upon.
<boolisSwap> Indicates if the swap should be performed for this EndianType.
  • true: Indicates a swap is required.
  • false: Will not swap byte-order.

Definition at line 199 of file byte_order.h.

Member Function Documentation

template<typename T , bool isSwap>
static T Hg::EndianType< T, isSwap >::swap_order ( const T &  value)
inlinestatic

Swaps the byte-order of value T based on platform endianess.

This swap function will instantiate the proper version of EndianSwap based on the current EndianType and input value type T. If T does not contain a EndianSwap specialization, no operation will be performed.

Parameters
valueThe value whose byte-order will be swapped.
Returns
The input parameter value with a swapped byte-order.

Definition at line 212 of file byte_order.h.


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