Thermal Camera SDK 11.3.0
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
optris::Port Class Reference

Encapsulates a network port number. More...

#include <Port.h>

Collaboration diagram for optris::Port:
Collaboration graph

Public Types

using Number = std::uint16_t
 Type used to store the port number.
 

Public Member Functions

 Port () noexcept
 Constructor.
 
 Port (Number number) noexcept
 Constructor.
 
 Port (const std::string &port)
 Sets the port number from the given string.
 
void reset () noexcept
 Resets the port number to 0.
 
void setNumber (Number number) noexcept
 Sets the port number to the given value.
 
Number getNumber () const noexcept
 Returns the port number.
 
OTC_SDK_API void setFromString (const std::string &port) noexcept(false)
 Sets the port number from the given string.
 
OTC_SDK_API std::string toString () const noexcept
 Returns the port number as a string.
 
bool operator== (const Port &rhs) const noexcept
 Returns whether this port equals the provided one.
 
bool operator!= (const Port &rhs) const noexcept
 Returns whether this port is different from the provided one.
 
bool operator< (const Port &rhs) const noexcept
 Returns whether this port number is smaller than the provided one.
 

Detailed Description

Encapsulates a network port number.

Port number a usually separated by a : from an IP address like

192.168.0.2:50101

Here the port number is 50101.

Constructor & Destructor Documentation

◆ Port() [1/3]

optris::Port::Port ( )
inlinenoexcept

Constructor.

The port number is set to 0.

◆ Port() [2/3]

optris::Port::Port ( Number number)
inlinenoexcept

Constructor.

Native byte order is expected.

Parameters
[in]numberof the port in [0, 65535].

◆ Port() [3/3]

optris::Port::Port ( const std::string & port)
inline

Sets the port number from the given string.

Parameters
[in]portstring.
Exceptions
SDKExceptionif the given string does not contain a valid port number.

Member Function Documentation

◆ getNumber()

Port::Number optris::Port::getNumber ( ) const
inlinenoexcept

Returns the port number.

Native byte order is used.

Returns
port number.

◆ operator!=()

bool optris::Port::operator!= ( const Port & rhs) const
inlinenoexcept

Returns whether this port is different from the provided one.

Parameters
[in]rhsport to compare this one to.
Returns
true, if this port is different from the provided one.

◆ operator<()

bool optris::Port::operator< ( const Port & rhs) const
inlinenoexcept

Returns whether this port number is smaller than the provided one.

Parameters
[in]rhsport to compare this one to.
Returns
true, if this port is smaller than the provided one.

◆ operator==()

bool optris::Port::operator== ( const Port & rhs) const
inlinenoexcept

Returns whether this port equals the provided one.

Parameters
[in]rhsport to compare this one to.
Returns
true, if this port equals the provided one. False otherwise.

◆ setFromString()

OTC_SDK_API void optris::Port::setFromString ( const std::string & port)

Sets the port number from the given string.

Parameters
[in]portnumber string.
Exceptions
SDKExceptionif the given string does not contain a valid port number.

◆ setNumber()

void optris::Port::setNumber ( Number number)
inlinenoexcept

Sets the port number to the given value.

Native byte order is expected.

Parameters
[in]numberport number to set.

◆ toString()

OTC_SDK_API std::string optris::Port::toString ( ) const
noexcept

Returns the port number as a string.

Returns
port number as a string.

The documentation for this class was generated from the following file: