Alchemy  1.0
A framework to robustly process network messages and structured data
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
List of all members
Hg::HostByteOrderT< E > Struct Template Reference

Byte-order management policy for network data transfers. More...

#include <byte_order.h>

Detailed Description

template<Endianess E>
struct Hg::HostByteOrderT< E >

Byte-order management policy for network data transfers.

This class represents the host byte-order behavior and provides the capability to convert to a value type in network byte-order.
Host Byte-Order is determined by the platform byte-order.

Usage:

using std::cout;
using std::hex;
long hostInput = 0x12345678;
cout << hex << "HostByteOrder: " << netInput << "\n";
cout << "to_host(): " << Hg::HostByteOrder::to_host(hostInput) << "\n";
cout << "to_network(): " << Hg::HostByteOrder::to_network(hostInput)<< "\n";
// Prints to the console:
// HostByteOrder: 12345678
// to_host: 12345678
// to_network: 78563412

Definition at line 262 of file byte_order.h.


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