17 #ifndef ZMQPP_INET_HPP_
18 #define ZMQPP_INET_HPP_
27 #include <netinet/in.h>
66 return value_to_check;
72 } value { value_to_check };
74 std::swap(value.bytes[0], value.bytes[7]);
75 std::swap(value.bytes[1], value.bytes[6]);
76 std::swap(value.bytes[2], value.bytes[5]);
77 std::swap(value.bytes[3], value.bytes[4]);
92 inline uint64_t
htonll(uint64_t
const hostlonglong)
108 inline uint64_t
ntohll(uint64_t
const networklonglong)
122 assert(
sizeof(
float) ==
sizeof(uint32_t));
125 memcpy(&temp, &value,
sizeof(uint32_t));
126 temp = htonl( temp );
127 memcpy(&value, &temp,
sizeof(uint32_t));
140 assert(
sizeof(
float) ==
sizeof(uint32_t));
143 memcpy(&temp, &value,
sizeof(uint32_t));
144 temp = ntohl( temp );
145 memcpy(&value, &temp,
sizeof(uint32_t));
158 assert(
sizeof(
double) ==
sizeof(uint64_t));
161 memcpy(&temp, &value,
sizeof(uint64_t));
163 memcpy(&value, &temp,
sizeof(uint64_t));
176 assert(
sizeof(
double) ==
sizeof(uint64_t));
179 memcpy(&temp, &value,
sizeof(uint64_t));
181 memcpy(&value, &temp,
sizeof(uint64_t));
float htonf(float value)
Definition: inet.hpp:120
C++ wrapper around zmq.
Definition: actor.cpp:29
double htond(double value)
Definition: inet.hpp:156
float ntohf(float value)
Definition: inet.hpp:138
uint64_t swap_if_needed(uint64_t const value_to_check)
Definition: inet.hpp:60
double ntohd(double value)
Definition: inet.hpp:174
uint64_t htonll(uint64_t const hostlonglong)
Definition: inet.hpp:92
order
Possible byte order types.
Definition: inet.hpp:41
uint64_t ntohll(uint64_t const networklonglong)
Definition: inet.hpp:108