NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
port.h
Go to the documentation of this file.
1#ifndef PORT_H
2#define PORT_H
3
4#include <QString>
5
9
10namespace NetSim {
11
14
24class Port {
25public:
27 Port() = default;
28
30 explicit Port(quint16 portNumber);
31
33 quint16 portNumber() const;
34
36 QVector<quint8> toArray() const;
37
39 static Port getRandomPort();
40
42 bool operator<(const Port &other) const;
43
44private:
46 quint16 m_portNumber{0};
47};
48} // namespace NetSim
49
50#endif // PORT_H
Represents a network port.
Definition port.h:24
Port()=default
Default constructor.
QVector< quint8 > toArray() const
Converts the port number to an array of bytes.
Definition port.cpp:11
quint16 portNumber() const
Returns the port number.
Definition port.cpp:9
bool operator<(const Port &other) const
Compares the port number with another port.
Definition port.cpp:23
static Port getRandomPort()
Returns a random port.
Definition port.cpp:19
Definition logger.h:12