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::NetByteOrderT< E > Struct Template Reference

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

#include <byte_order.h>

Detailed Description

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

Byte-order management policy for network data transfers.

This class represents the network byte-order behavior and provides the capability to convert to a value type in host byte-order.
Network Byte-Order is defined as Big Endian.


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

Definition at line 315 of file byte_order.h.

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