Deskflow 1.24.0.365
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
NetworkAddress.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
4 * SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
5 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6 */
7
8#pragma once
9
10#include "arch/IArchNetwork.h"
11
13
17{
18public:
22 NetworkAddress() = default;
23
28 explicit NetworkAddress(int port);
29
40 explicit NetworkAddress(const std::string &hostname, int port = 0);
41
43
45
47
49
50
52
60 size_t resolve(size_t index = 0);
61
63
65
67
70 bool operator==(const NetworkAddress &address) const;
71
73
76 bool isValid() const;
77
79
83 const ArchNetAddress &getAddress() const;
84
86
90 int getPort() const;
91
93
96 std::string getHostname() const;
97
99
100private:
101 void checkPort() const;
102
103private:
104 ArchNetAddress m_address = nullptr;
105 std::string m_hostname;
106 int m_port = 0;
107};
ArchNetAddressImpl * ArchNetAddress
Opaque network address type. An opaque type representing a network address.
Definition IArchNetwork.h:45
const ArchNetAddress & getAddress() const
Get address.
Definition NetworkAddress.cpp:186
bool isValid() const
Check address validity.
Definition NetworkAddress.cpp:181
size_t resolve(size_t index=0)
Resolve address.
Definition NetworkAddress.cpp:115
std::string getHostname() const
Get hostname.
Definition NetworkAddress.cpp:196
int getPort() const
Get port.
Definition NetworkAddress.cpp:191
bool operator==(const NetworkAddress &address) const
Check address equality.
Definition NetworkAddress.cpp:176
NetworkAddress & operator=(const NetworkAddress &)
Definition NetworkAddress.cpp:97
~NetworkAddress()
Definition NetworkAddress.cpp:89
NetworkAddress()=default