17#ifndef ZMQPP_INET_HPP_
18#define ZMQPP_INET_HPP_
29#include <netinet/in.h>
68 return value_to_check;
74 } value { value_to_check };
76 std::swap(value.bytes[0], value.bytes[7]);
77 std::swap(value.bytes[1], value.bytes[6]);
78 std::swap(value.bytes[2], value.bytes[5]);
79 std::swap(value.bytes[3], value.bytes[4]);
94inline uint64_t
htonll(uint64_t
const hostlonglong)
110inline uint64_t
ntohll(uint64_t
const networklonglong)
124 assert(
sizeof(
float) ==
sizeof(uint32_t));
127 memcpy(&temp, &value,
sizeof(uint32_t));
128 temp = htonl( temp );
129 memcpy(&value, &temp,
sizeof(uint32_t));
142 assert(
sizeof(
float) ==
sizeof(uint32_t));
145 memcpy(&temp, &value,
sizeof(uint32_t));
146 temp = ntohl( temp );
147 memcpy(&value, &temp,
sizeof(uint32_t));
160 assert(
sizeof(
double) ==
sizeof(uint64_t));
163 memcpy(&temp, &value,
sizeof(uint64_t));
165 memcpy(&value, &temp,
sizeof(uint64_t));
178 assert(
sizeof(
double) ==
sizeof(uint64_t));
181 memcpy(&temp, &value,
sizeof(uint64_t));
183 memcpy(&value, &temp,
sizeof(uint64_t));
C++ wrapper around zmq.
Definition: actor.cpp:30
order
Possible byte order types.
Definition: inet.hpp:43
uint64_t htonll(uint64_t const hostlonglong)
Definition: inet.hpp:94
float htonf(float value)
Definition: inet.hpp:122
uint64_t ntohll(uint64_t const networklonglong)
Definition: inet.hpp:110
float ntohf(float value)
Definition: inet.hpp:140
double ntohd(double value)
Definition: inet.hpp:176
double htond(double value)
Definition: inet.hpp:158
uint64_t swap_if_needed(uint64_t const value_to_check)
Definition: inet.hpp:62