8 #ifndef FACEBOOK_NETWORK_PORT_H
9 #define FACEBOOK_NETWORK_PORT_H
38 explicit inline Port(
const uint16_t port);
69 inline bool isNull()
const;
89 inline operator uint16_t()
const;
112 port_ = uint16_t((port >> 8u) | (port << 8u));
123 return uint16_t((
port_ >> 8u) | (
port_ << 8u));
151 inline Port::operator uint16_t()
const
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
static int32_t fromBigEndian(const int32_t value)
Returns a value in local system bit order given as big-endian bit order.
Definition: Data.h:135
This class wraps a port number with 16 bits.
Definition: Port.h:26
bool operator!=(const Port &port) const
Returns whether two port number are not identical.
Definition: Port.h:146
uint16_t port_
Port number to wrap in big-endian order.
Definition: Port.h:94
bool isNull() const
Returns whether this port holds a zero value.
Definition: Port.h:136
uint16_t readable() const
Returns the port number in a readable order.
Definition: Port.h:126
uint16_t littleEndian() const
Returns the port number in little-endian order.
Definition: Port.h:121
bool isValid() const
Returns whether this port hold a non-zero value.
Definition: Port.h:131
bool operator==(const Port &port) const
Returns whether two port number are identical.
Definition: Port.h:141
Port()=default
Creates a new port object with zero as default value.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15