STTNet
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Static Public Member Functions | List of all members
stt::data::NetworkOrderUtil Class Reference

Responsible for endianness conversion. More...

#include <sttnet_English.h>

Static Public Member Functions

static unsigned long & htonl_ntohl_64 (unsigned long &data)
 Reverse the endianness of a 64-bit unsigned integer (big endian <-> little endian). More...
 

Detailed Description

Responsible for endianness conversion.

Member Function Documentation

static unsigned long& stt::data::NetworkOrderUtil::htonl_ntohl_64 ( unsigned long &  data)
static

Reverse the endianness of a 64-bit unsigned integer (big endian <-> little endian).

This function simulates the 64-bit version of htonl/ntohl, i.e., swaps high and low bytes. Modifies the parameter in place and returns a reference.

Parameters
dataInput 64-bit unsigned integer, returned after byte reversal.
Returns
Reference to the reversed data.
Note
This implementation does not depend on platform library functions and is suitable for scenarios where the machine endianness is uncertain.

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