209 bool operator==(const
IpAddress& rhs) const noexcept;
211 bool operator==(std::uint32_t rhs) const noexcept;
213 bool operator!=(const
IpAddress& rhs) const noexcept;
215 bool operator<(const
IpAddress& rhs) const noexcept;
220 std::array<std::uint8_t, 4> _bytes;
232 static std::uint32_t cidrToUInt32(
int cidr);
251 return _bytes == rhs._bytes;
261 return !(_bytes == rhs._bytes);
Contains defines controlling the Windows DLL export and import of symbols.
#define OTC_SDK_API
Only needed when working with Windows DLLs.
Definition Api.h:65
Contains the exceptions raised by the SDK.
Encapsulates an IP v4 address.
Definition IpAddress.h:33
bool operator==(const IpAddress &rhs) const noexcept
Equality operator.
Definition IpAddress.h:249
OTC_SDK_API void setFromUInt32(std::uint32_t address) noexcept
Sets the address from an unsigned 32 bit integer in network byte order.
OTC_SDK_API int setFromCidrString(const std::string &address)
Sets the address from a string in classless inter-domain routing (CIDR) notation (a....
OTC_SDK_API IpAddress getBroadcastAddress(const IpAddress &subnetMask) const noexcept
Returns the broadcast address for this IP address with the given subnet mask.
OTC_SDK_API std::uint8_t getByte(int index) const
Returns the value of the byte with the given index.
OTC_SDK_API void reset()
Resets all the bytes of the IP address to 0 (0.0.0.0).
OTC_SDK_API void setByte(int index, std::uint8_t value)
Sets the value of the byte with the given index.
OTC_SDK_API void setFromString(const std::string &address)
Sets the address from a string in dot notation (a.b.c.d).
OTC_SDK_API IpAddress() noexcept
Constructor.
bool operator<(const IpAddress &rhs) const noexcept
Less than operator.
Definition IpAddress.h:264
OTC_SDK_API std::string toString() const noexcept
Returns the address as a string in dot notation (a.b.c.d).
OTC_SDK_API std::string toCidrString(int cidr) const noexcept
Returns the address as a string in classless inter-domain routing (CIDR) notation (a....
OTC_SDK_API std::uint32_t toUInt32() const noexcept
Returns the address as an unsigned 32 bit integer in network byte order.
OTC_SDK_API IpAddress getHostPortion(const IpAddress &subnetMask) const noexcept
Returns the host portion of the IP address according to the given subnet mask.
bool operator!=(const IpAddress &rhs) const noexcept
Unequality operator.
Definition IpAddress.h:259
OTC_SDK_API IpAddress getNetworkPortion(const IpAddress &subnetMask) const noexcept
Returns the network portion of the IP address according to the given subnet mask.
Main SDK namespace.
Definition DeviceInfo.h:24