Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
bridge.h
Go to the documentation of this file.
1#pragma once
2
7
8#include <QtCore/QList>
9#include <QtCore/QString>
10
11#include <optional>
12#include <utility>
13
14namespace Sonde::Bridge {
15
18constexpr int kDefaultHoldSeconds = 15;
20constexpr int kMaxHoldSeconds = 3600;
21
25{
26 bool retry = false;
27 int seconds = 0;
28 bool reconnect = false;
31};
32
36{
37 QString name;
38 QString valueName;
39 QString description;
40};
41
43QList<OptionDoc> commandLineOptions();
47std::pair<QString, QString> commandLineArgument();
48
50std::optional<int> holdSeconds(const QString &text);
51
58int run(const QString &name, const RetryPolicy &policy);
59
60} // namespace Sonde::Bridge
QString commandLineDescription()
One line on what sonde-bridge does.
Definition bridge.cpp:441
std::pair< QString, QString > commandLineArgument()
Its argument's name and description: the local server.
Definition bridge.cpp:446
int run(const QString &name, const RetryPolicy &policy)
Connects to the local server name and copies lines between it and stdin and stdout,...
Definition bridge.cpp:460
std::optional< int > holdSeconds(const QString &text)
The seconds in a –hold value: a number from 0 to kMaxHoldSeconds, or nothing.
Definition bridge.cpp:451
QList< OptionDoc > commandLineOptions()
sonde-bridge's options, in the order its help lists them.
Definition bridge.cpp:422
constexpr int kMaxHoldSeconds
The longest –hold allowed, in seconds.
Definition bridge.h:20
constexpr int kDefaultHoldSeconds
With –reconnect, how long a request sent while the application is away is held by default,...
Definition bridge.h:18
One of sonde-bridge's command-line options, as its parser and sonde's man page for it describe it (de...
Definition bridge.h:36
QString valueName
What its value is called, or empty for a flag: "seconds".
Definition bridge.h:38
QString description
What it does.
Definition bridge.h:39
QString name
The long name, without "--": "wait-timeout".
Definition bridge.h:37
How long to keep retrying a failed connection, and whether to survive a disconnection.
Definition bridge.h:25
int holdSeconds
With reconnect: how long to hold requests while.
Definition bridge.h:29
bool reconnect
Whether to reconnect after the server closes the connection.
Definition bridge.h:28
bool retry
Whether to retry at all.
Definition bridge.h:26
int seconds
Give up after this long; 0 means never.
Definition bridge.h:27