Editor → Protocol → loopback_transport.h
loopback_client
| Type | Class |
| Namespace | conjure::editor |
| Include File Path | engine/include/conjure/editor/protocol/loopback_transport.h |
| Source File Path | engine/src/editor/core/protocol/loopback_transport.cpp |
| API ↗ | The AI control protocol, The editor |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| private | explicit loopback_client(
std::shared_ptr<state> shared) noexcept; | |
| public | loopback_client(); | |
| public | loopback_client(
const loopback_client &) = default; |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~loopback_client(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mState | std::shared_ptr<state> | nullptr |
Functions
Public
client_id
client_id[[nodiscard]] u32 client_id() const;The id the server assigned (0 until the server's first poll() accepted the client).
disconnect
disconnectvoid disconnect();Closes the client side; the server sees the disconnect at its next poll().
is_connected
is_connected[[nodiscard]] bool is_connected() const;receive
receive[[nodiscard]] std::optional<std::string> receive();The next line the server sent, without its newline; nullopt when none is waiting.
receive_all
receive_all[[nodiscard]] std::vector<std::string> receive_all();Every waiting line.
send
sendvoid send(
std::string_view line);Queues one line (a newline is appended when missing) for the server's next poll().
send_raw
send_rawvoid send_raw(
std::string_view bytes);Queues raw bytes without framing (partial lines, several lines in one chunk).
Operator Overloads
Public
operator=
operator=loopback_client &operator=(
const loopback_client &) = default;