UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
control_port.hpp
Go to the documentation of this file.
1#ifndef CONTROL_PORT_7a66c3f43b5f
2#define CONTROL_PORT_7a66c3f43b5f
3
4#include <vector>
5#include <thread>
6#include <string_view>
7#include <functional>
8#include <QTcpSocket>
9#include "line_buffer.hpp"
10
11class Socket;
12
13class ControlPort : public QObject{
14 Q_OBJECT
15public:
17 ~ControlPort() = default;
18
19 void connect(int local_port);
20 void parseLine(std::string_view line);
21
22 void writeLine(std::string_view line);
23
24 QAbstractSocket::SocketState getState() const;
25
26 using LineCallback = std::function<void(std::string_view)>;
28
29signals:
30 void connected();
32
33private slots:
34 void readReady();
35
36private:
37 QTcpSocket socket;
39 std::vector<LineCallback> lineCallbacks;
40};
41
42#endif
std::function< void(std::string_view)> LineCallback
void addLineCallback(LineCallback callback)
void connected()
QTcpSocket socket
LineBuffer lineBuf
QAbstractSocket::SocketState getState() const
void writeLine(std::string_view line)
void disconnected()
~ControlPort()=default
void connect(int local_port)
std::vector< LineCallback > lineCallbacks
void parseLine(std::string_view line)
Option::Callback::fcn_type callback
Definition settings.cpp:251