1#ifndef CLICONNECTION_HH
2#define CLICONNECTION_HH
17class CommandController;
18class EventDistributor;
24 updateEnabled[type] = value;
27 return updateEnabled[type];
42 virtual void output(std::string_view message) = 0;
66 virtual void run() = 0;
68 void execute(
const std::string& command);
73 std::string_view name, std::string_view value)
noexcept override;
76 int signalEvent(
const Event& event)
override;
83 std::array<bool, CliComm::NUM_UPDATES> updateEnabled;
93 void output(std::string_view message)
override;
96 void close()
override;
106 std::string_view name);
107 ~PipeConnection()
override;
109 void output(std::string_view message)
override;
112 void close()
override;
116 HANDLE shutdownEvent;
128 void output(std::string_view message)
override;
131 void close()
override;
137 bool established =
false;
void end()
End this connection by sending the closing tag and then closing the stream.
~CliConnection() override
virtual void close()=0
Close the connection.
void start()
Starts the helper thread.
void setUpdateEnable(CliComm::UpdateType type, bool value)
AdhocCliCommParser parser
void startOutput()
Send opening XML tag, should be called exactly once by a subclass shortly after opening a connection.
virtual void output(std::string_view message)=0
bool getUpdateEnable(CliComm::UpdateType type) const
CliConnection(CommandController &commandController, EventDistributor &eventDistributor)
Polls for events on a given file descriptor.
SocketConnection(CommandController &commandController, EventDistributor &eventDistributor, SOCKET sd)
~SocketConnection() override
void output(std::string_view message) override
void output(std::string_view message) override
~StdioConnection() override
StdioConnection(CommandController &commandController, EventDistributor &eventDistributor)
This file implemented 3 utility functions: