![]() |
Thermal Camera SDK 10.1.1
SDK for Optris Thermal Cameras
|
Encapsulates an IP v4 address. More...
#include <IpAddress.h>

Public Member Functions | |
| OTC_SDK_API | IpAddress () noexcept |
| Constructor. | |
| OTC_SDK_API | IpAddress (std::uint32_t address) noexcept |
| Constructor. | |
| OTC_SDK_API | IpAddress (const std::string &address) |
| Constructor. | |
| OTC_SDK_API | IpAddress (std::uint8_t a, std::uint8_t b, std::uint8_t c, std::uint8_t d) noexcept |
| Constructor. | |
| OTC_SDK_API void | reset () |
| Resets all the bytes of the IP address to 0 (0.0.0.0). | |
| 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 std::uint32_t | toUInt32 () const noexcept |
| Returns the address as an unsigned 32 bit integer in network byte order. | |
| 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 int | setFromCidrString (const std::string &address) |
| Sets the address from a string in classless inter-domain routing (CIDR) notation (a.b.c.d/cidr). | |
| 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.b.c.d/cidr). | |
| OTC_SDK_API void | setByte (int index, std::uint8_t value) |
| Sets the value of the byte with the given index. | |
| OTC_SDK_API std::uint8_t | getByte (int index) const |
| Returns the value of the byte with the given index. | |
| OTC_SDK_API IpAddress | getNetworkPortion (const IpAddress &subnetMask) const noexcept |
| Returns the network portion of the IP address according to the given subnet mask. | |
| OTC_SDK_API IpAddress | getNetworkPortion (int cidr) const |
| Returns the network portion of the IP address according to the given CIDR bit count. | |
| OTC_SDK_API IpAddress | getHostPortion (const IpAddress &subnetMask) const noexcept |
| Returns the host portion of the IP address according to the given subnet mask. | |
| OTC_SDK_API IpAddress | getHostPortion (int cidr) const |
| Returns the host portion of the IP address according to the given CIDR bit count. | |
| 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 IpAddress | getBroadcastAddress (int cidr) const |
| Returns the broadcast address for this IP address with the given CIDR bit count. | |
| bool | operator== (const IpAddress &rhs) const noexcept |
| Equality operator. | |
| bool | operator== (std::uint32_t rhs) const noexcept |
| Equality operator. | |
| bool | operator!= (const IpAddress &rhs) const noexcept |
| Unequality operator. | |
| bool | operator< (const IpAddress &rhs) const noexcept |
| Less than operator. | |
Encapsulates an IP v4 address.
IP address are stored in an array in the following oder:
a.b.c.d => [0: a, 1: b, 2: c, 3: d]
|
noexcept |
Constructor.
All IP address bytes are set to 0.
|
noexcept |
Constructor.
| [in] | address | as an unsigned 32 bit integer in network byte order. |
| OTC_SDK_API optris::IpAddress::IpAddress | ( | const std::string & | address | ) |
Constructor.
| [in] | address | string in dot notation (a.b.c.d). |
| SDKException | if address string is invalid. |
|
noexcept |
Constructor.
| [in] | a | byte from an a.b.c.d IP address. |
| [in] | b | byte from an a.b.c.d IP address. |
| [in] | c | byte from an a.b.c.d IP address. |
| [in] | d | byte from an a.b.c.d IP address. |
|
noexcept |
Returns the broadcast address for this IP address with the given subnet mask.
| [in] | subnetMask | to apply to the IP address. |
| OTC_SDK_API IpAddress optris::IpAddress::getBroadcastAddress | ( | int | cidr | ) | const |
Returns the broadcast address for this IP address with the given CIDR bit count.
| [in] | cidr | part of the address representing the bit count of the network portion of the address. |
| SDKException | if the value of cidr is not in [0, 32]. |
| OTC_SDK_API std::uint8_t optris::IpAddress::getByte | ( | int | index | ) | const |
Returns the value of the byte with the given index.
| [in] | index | of the desired byte. |
| SDKException | if the index is out of range. |
|
noexcept |
Returns the host portion of the IP address according to the given subnet mask.
| [in] | subnetMask | to apply to the IP address. |
| OTC_SDK_API IpAddress optris::IpAddress::getHostPortion | ( | int | cidr | ) | const |
Returns the host portion of the IP address according to the given CIDR bit count.
| [in] | cidr | part of the address representing the bit count of the network portion of the address. |
| SDKException | if the value of cidr is not in [0, 32]. |
|
noexcept |
Returns the network portion of the IP address according to the given subnet mask.
| [in] | subnetMask | to apply to the IP address. |
| OTC_SDK_API IpAddress optris::IpAddress::getNetworkPortion | ( | int | cidr | ) | const |
Returns the network portion of the IP address according to the given CIDR bit count.
| [in] | cidr | part of the address representing the bit count of the network portion of the address. |
| SDKException | if the value of cidr is not in [0, 32]. |
| OTC_SDK_API void optris::IpAddress::setByte | ( | int | index, |
| std::uint8_t | value ) |
Sets the value of the byte with the given index.
| [in] | index | of the byte to set. |
| [in] | value | to set. |
| SDKException | if index is out of range. |
| OTC_SDK_API int optris::IpAddress::setFromCidrString | ( | const std::string & | address | ) |
Sets the address from a string in classless inter-domain routing (CIDR) notation (a.b.c.d/cidr).
| [in] | address | in CIDR notation. |
| SDKException | if the address string is invalid. |
| OTC_SDK_API void optris::IpAddress::setFromString | ( | const std::string & | address | ) |
Sets the address from a string in dot notation (a.b.c.d).
| [in] | address | in dot notation. |
| SDKException | if the address string is invalid. |
|
noexcept |
Sets the address from an unsigned 32 bit integer in network byte order.
| [in] | address | as an unsigned 32 bit integer with the bytes in network order. |
|
noexcept |
Returns the address as a string in classless inter-domain routing (CIDR) notation (a.b.c.d/cidr).
| [in] | cidr | part of the address representing the bit count of the network portion of the address. |
|
noexcept |
Returns the address as a string in dot notation (a.b.c.d).
|
noexcept |
Returns the address as an unsigned 32 bit integer in network byte order.