8 #ifndef FACEBOOK_NETWORK_ADDRESS4_H
9 #define FACEBOOK_NETWORK_ADDRESS4_H
38 inline Address4(
const uint32_t address);
54 inline Address4(
const uint8_t sub0,
const uint8_t sub1,
const uint8_t sub2,
const uint8_t sub3);
60 inline uint32_t littleEndian()
const;
72 inline bool isValid()
const;
78 inline bool isNull()
const;
91 inline bool operator==(
const Address4& address)
const;
98 inline bool operator!=(
const Address4& address)
const;
104 inline operator uint32_t()
const;
111 inline size_t operator()(
const Address4& address)
const;
116 uint32_t address_ = 0u;
134 address_ = (address >> 24u) | ((address >> 8u) & 0xFF00u) | ((address << 8u) & 0xFF0000u) | (address << 24u);
143 inline Address4::Address4(
const uint8_t sub0,
const uint8_t sub1,
const uint8_t sub2,
const uint8_t sub3) :
144 address_(uint32_t(sub0) | (uint32_t(sub1) << 8u) | (uint32_t(sub2) << 16u) | (uint32_t(sub3) << 24u))
179 inline Address4::operator uint32_t()
const
This class wraps an address number with 32 bits.
Definition: Address4.h:26
uint32_t littleEndian() const
Returns the address number in little-endian order.
Definition: Address4.h:149
uint32_t address_
Address4 number to wrap in big-endian order.
Definition: Address4.h:116
Address4()=default
Creates a new address object with zero as default value.
std::string readable() const
Returns the address number as a readable string.
bool operator!=(const Address4 &address) const
Returns whether two address objects are not identical.
Definition: Address4.h:174
size_t operator()(const Address4 &address) const
Hash function.
Definition: Address4.h:184
bool isNull() const
Returns whether this address hold an invalid address (a zero address).
Definition: Address4.h:159
static Address4 localHost()
Returns the local host address.
Definition: Address4.h:164
bool operator==(const Address4 &address) const
Returns whether two address objects are identical.
Definition: Address4.h:169
bool isValid() const
Returns whether this address hold a valid address.
Definition: Address4.h:154
This class provides function handling different network data.
Definition: Data.h:24
static int toBigEndian(const int32_t value)
Returns a value in big-endian order given in local system bit order.
Definition: Data.h:107
OrderType
Definition of different order types.
Definition: Data.h:31
@ TYPE_BIG_ENDIAN
Big endian type.
Definition: Data.h:33
@ TYPE_LITTLE_ENDIAN
Little endian type.
Definition: Data.h:35
@ TYPE_READABLE
Readable endian type which is platform specific.
Definition: Data.h:37
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15