133#undef VLINK_PROXY_API_EXPORT
134#ifdef VLINK_PROXY_API_LIBRARY_STATIC
135#define VLINK_PROXY_API_EXPORT
136#elif defined(_WIN32) || defined(__CYGWIN__)
137#ifdef VLINK_PROXY_API_LIBRARY
138#define VLINK_PROXY_API_EXPORT __declspec(dllexport)
140#define VLINK_PROXY_API_EXPORT __declspec(dllimport)
143#define VLINK_PROXY_API_EXPORT __attribute__((visibility("default")))
149#include <unordered_set>
367 using TimeCallback = std::function<void(uint64_t sys_time, uint64_t boot_time)>;
374 using InfoCallback = std::function<void(
const std::vector<Info>& info_list)>;
730 bool send_control_sync(
const Control& control);
732 void sync_direct_maps(
const Control& control);
736 void process_connected(
bool connected);
738 void process_time(uint64_t sys_time, uint64_t boot_time);
740 void process_error(
Error error);
742 std::unique_ptr<struct ProxyAPIImpl> impl_;
Versatile byte buffer with small-buffer optimisation, ownership semantics and compression.
Versatile 128-byte byte buffer with SBO, five ownership modes and compression helpers.
Definition bytes.h:113
MessageLoop()
Constructs a MessageLoop with kNormalType queue.
Error
Compatibility and protocol error codes reported via ErrorCallback.
Definition proxy_api.h:198
@ kUnknownError
Unknown or unclassified error.
Definition proxy_api.h:207
@ kVersionCompError
VLINK_VERSION string differs between client and server.
Definition proxy_api.h:206
@ kTcpCompError
Client and server have mismatched enable_tcp setting.
Definition proxy_api.h:203
@ kControlError
Server responded with a different control_id.
Definition proxy_api.h:201
@ kReliableCompError
Client and server have mismatched reliable setting.
Definition proxy_api.h:202
@ kMultiProxyError
Multiple proxy servers detected on the same domain.
Definition proxy_api.h:205
@ kNoError
No error; connection is healthy.
Definition proxy_api.h:199
@ kModeError
Unsupported mode requested.
Definition proxy_api.h:200
@ kDirectCompError
Client and server have mismatched direct setting.
Definition proxy_api.h:204
Error get_current_error() const
Returns the current error state.
static std::string get_format_sys_time(uint64_t time, bool enable_utc=false)
Formats a microsecond wall-clock timestamp as a human-readable string.
uint32_t get_max_elapsed_time() const override
Returns the maximum allowed task execution time in milliseconds.
const Config & get_current_config() const
Returns the configuration passed at construction.
std::function< void(const Data &data)> DataCallback
Callback delivering raw message data relayed by ProxyServer.
Definition proxy_api.h:384
void on_end() override
Called from the loop thread just after the last task has been processed.
std::string get_current_hostname() const
Returns the hostname of the connected ProxyServer.
ProxyAPI(const Config &config)
Constructs a ProxyAPI with the given configuration.
static bool is_support_shm()
Returns true if the build includes SHM (Iceoryx) support.
bool send_data(const Data &data)
Sends raw message data to the ProxyServer for injection.
uint64_t get_current_sys_time() const
Returns the best estimate of the server's current wall-clock time.
std::unordered_set< std::string > get_proxy_machine_ids() const
Returns the set of all server machine IDs seen during this session.
void register_data_callback(DataCallback &&callback)
Registers a callback for raw message data relayed by the server.
bool is_connected() const
Returns true when a valid connection to ProxyServer exists.
void register_connect_callback(ConnectCallback &&callback)
Registers a callback for connection state changes.
std::function< void(const std::vector< Info > &info_list)> InfoCallback
Callback delivering the per-topic statistics list once per second.
Definition proxy_api.h:374
~ProxyAPI() override
Destructor.
Mode get_current_mode() const
Returns the current proxy operation mode.
std::function< void(Error error)> ErrorCallback
Callback invoked when an error or error-clear event is detected.
Definition proxy_api.h:359
std::function< void(bool connected)> ConnectCallback
Callback invoked when the connection state with ProxyServer changes.
Definition proxy_api.h:350
static bool is_enable_filter()
Returns true if topic filtering support is compiled in.
int64_t get_latency() const
Returns the measured round-trip latency on the data channel.
uint64_t get_current_boot_time() const
Returns the best estimate of the server's current boot time.
std::string get_current_machine_id() const
Returns the machine ID of the connected ProxyServer.
static std::string get_format_boot_time(uint64_t time)
Formats a microsecond boot-time duration as a human-readable string.
void register_time_callback(TimeCallback &&callback)
Registers a callback for heartbeat timestamp delivery.
std::unordered_set< std::string > get_proxy_hostnames() const
Returns the set of all server hostnames seen during this session.
void on_begin() override
Called from the loop thread just before the first task is processed.
double get_current_memory_usage() const
Returns the server's most recently reported memory utilisation.
Mode
Proxy operation modes sent via send_control().
Definition proxy_api.h:179
@ kOffline
Disconnected; server releases all subscriptions.
Definition proxy_api.h:180
@ kObserveAll
Observe all discovered topics on the network.
Definition proxy_api.h:182
@ kEdit
Edit: forward data injected by the controller.
Definition proxy_api.h:185
@ kPlay
Replay: inject previously recorded data.
Definition proxy_api.h:184
@ kAutoAndObserveAll
Auto + observe every discovered topic.
Definition proxy_api.h:187
@ kObserveOne
Observe a single topic from the URL list.
Definition proxy_api.h:181
@ kRecord
Record data from topics in the URL list.
Definition proxy_api.h:183
@ kAuto
Auto: observe specified URLs and forward to subscribers.
Definition proxy_api.h:186
Role
Role of this ProxyAPI instance.
Definition proxy_api.h:229
@ kController
Definition proxy_api.h:229
@ kListener
Definition proxy_api.h:229
void register_error_callback(ErrorCallback &&callback)
Registers a callback for error state transitions.
bool send_control(const Control &control, bool async=true)
Sends a Control message to the ProxyServer.
SampleLostInfo get_lost() const
Returns the sample loss statistics on the data channel.
double get_current_cpu_usage() const
Returns the server's most recently reported CPU utilisation.
size_t get_max_task_count() const override
Returns the maximum queue depth.
std::function< void(uint64_t sys_time, uint64_t boot_time)> TimeCallback
Callback delivering the server's wall-clock and boot-time from each heartbeat.
Definition proxy_api.h:367
void register_info_callback(InfoCallback &&callback)
Registers a callback for per-topic statistics updates.
std::string get_proxy_version() const
Returns the VLINK_VERSION string reported by the server.
Status
Per-topic activity status reported in Info.
Definition proxy_api.h:214
@ kInActive
Topic exists but has not received data recently.
Definition proxy_api.h:216
@ kPending
Topic was just discovered; statistics are still accumulating.
Definition proxy_api.h:217
@ kActive
Topic is actively receiving data.
Definition proxy_api.h:215
@ kInvalid
Topic type does not support observation (e.g., subscriber-only).
Definition proxy_api.h:218
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
Definition macros.h:184
Single-threaded event loop with three queue types, timer management and task scheduling.
SchemaType
Coarse runtime schema family used by discovery, bag metadata, and proxy routing.
Definition types.h:184
@ kUnknown
Decode category is not known.
Definition types.h:185
ImplType
Bitmask identifying the role of a VLink node implementation.
Definition types.h:89
@ kSubscriber
Event subscriber (receive broadcast).
Definition types.h:94
#define VLINK_PROXY_API_EXPORT
Definition proxy_api.h:143
Construction-time configuration for ProxyAPI.
Definition proxy_api.h:327
std::string security_key
Optional security key for encrypted DDS channels; must match the server key.
Definition proxy_api.h:331
bool match_version
Reject connections when the server's VLINK_VERSION differs from the client.
Definition proxy_api.h:336
int domain_id
DDS domain ID; must match the server's domain_id.
Definition proxy_api.h:329
bool direct
Use direct SHM channels for data; must match the server's direct setting.
Definition proxy_api.h:334
bool native
When true, restricts all DDS traffic to 127.0.0.1 (loopback only).
Definition proxy_api.h:332
std::string dds_impl
DDS implementation transport: "dds", "ddsc", "ddsr", etc.
Definition proxy_api.h:330
bool enable_tcp
Use TCP transport for data channels; must match the server's enable_tcp.
Definition proxy_api.h:335
Role role
Role of this client instance.
Definition proxy_api.h:328
int buf_size
Socket send/receive buffer size in bytes; 0 uses the built-in default.
Definition proxy_api.h:339
std::string peer_ip
Unicast peer IP for DDS discovery (empty = multicast).
Definition proxy_api.h:338
int mtu_size
DDS MTU size in bytes; 0 uses the built-in default.
Definition proxy_api.h:340
bool reliable
Use reliable DDS QoS; must match the server's reliable setting.
Definition proxy_api.h:333
std::string allow_ip
Bind DDS sockets to this IP address (empty = any).
Definition proxy_api.h:337
Control message sent from a kController client to ProxyServer.
Definition proxy_api.h:290
bool filter_by_process
When true, filter_str matches process names; otherwise matches URLs.
Definition proxy_api.h:293
std::vector< UrlMeta > url_meta_list
Topics to observe / inject (mode-dependent).
Definition proxy_api.h:292
std::string filter_str
Space-separated filter keywords (case-insensitive).
Definition proxy_api.h:294
uint32_t filter_type
Type filter: 0=all, 1=pub+sub pair, 2=srv+cli pair, etc.
Definition proxy_api.h:295
Mode mode
Target operation mode.
Definition proxy_api.h:291
Raw message payload delivered via DataCallback or sent via send_data().
Definition proxy_api.h:308
std::string url
Topic URL the data was captured on.
Definition proxy_api.h:309
int64_t seq
Publisher sequence number.
Definition proxy_api.h:314
Bytes raw
Raw serialised message bytes.
Definition proxy_api.h:312
SchemaType schema
Coarse schema family of the payload.
Definition proxy_api.h:311
int64_t timestamp
Elapsed time in microseconds since session start; -1 if unset.
Definition proxy_api.h:313
std::string ser
Serialisation type of the payload.
Definition proxy_api.h:310
Statistics and metadata for a single discovered topic endpoint.
Definition proxy_api.h:252
std::string ser
Serialisation type, e.g. "demo.proto.PointCloud".
Definition proxy_api.h:255
std::string url
Full topic URL, e.g. "dds://my/topic".
Definition proxy_api.h:254
SchemaType schema
Coarse schema family of the payload.
Definition proxy_api.h:256
float freq
Observed message frequency in messages/s.
Definition proxy_api.h:258
float loss
Sample loss ratio in the range [0, 1].
Definition proxy_api.h:260
Status status
Activity status of the topic.
Definition proxy_api.h:257
uint64_t rate
Observed throughput in bytes/s.
Definition proxy_api.h:259
uint32_t type
Node type bitmask for this endpoint.
Definition proxy_api.h:253
float latency
End-to-end latency in milliseconds.
Definition proxy_api.h:261
std::vector< Process > process_list
List of connected publisher/subscriber processes.
Definition proxy_api.h:262
Describes a VLink node process attached to a topic endpoint.
Definition proxy_api.h:235
std::string ip
IP address of the network interface.
Definition proxy_api.h:240
uint32_t type
Node type bitmask (kPublisher / kSubscriber / kServer / kClient / kSetter / kGetter).
Definition proxy_api.h:236
uint32_t pid
Operating-system process ID.
Definition proxy_api.h:238
std::string host
Hostname of the machine running the process.
Definition proxy_api.h:237
std::string name
Human-readable process name.
Definition proxy_api.h:239
Cumulative sample delivery statistics for a subscriber or getter.
Definition types.h:217
Core type definitions shared across all VLink node implementations.