From f5daca16d8f451326fe170c5bc4ba9ab8e24a062 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Fri, 29 Nov 2024 10:34:25 +0100 Subject: [PATCH 01/12] add querier support and corresponding examples; align z_queruyable, z_get and z_pub examples with rust; --- Cargo.lock | 60 +- Cargo.toml | 8 +- Cargo.toml.in | 8 +- build-resources/opaque-types/Cargo.lock | 60 +- build-resources/opaque-types/Cargo.toml | 6 +- build-resources/opaque-types/src/lib.rs | 19 +- examples/parse_args.h | 13 + examples/z_get.c | 45 +- examples/z_pub.c | 24 +- examples/z_pub_shm.c | 4 +- examples/z_querier.c | 206 ++++++ examples/z_queryable.c | 18 +- include/zenoh_commons.h | 828 ++++++++++++++++++------ include/zenoh_macros.h | 339 +--------- src/lib.rs | 6 + src/matching.rs | 58 ++ src/publisher.rs | 71 +- src/querier.rs | 401 ++++++++++++ 18 files changed, 1492 insertions(+), 682 deletions(-) create mode 100644 examples/z_querier.c create mode 100644 src/matching.rs create mode 100644 src/querier.rs diff --git a/Cargo.lock b/Cargo.lock index bffa1489a..132f41cfc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3718,7 +3718,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "ahash", "async-trait", @@ -3765,7 +3765,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "zenoh-collections", ] @@ -3801,7 +3801,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "tracing", "uhlc", @@ -3813,12 +3813,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "json5", "num_cpus", @@ -3839,7 +3839,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "lazy_static", "tokio", @@ -3850,7 +3850,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "aes", "hmac", @@ -3863,7 +3863,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "bincode", "flume", @@ -3880,7 +3880,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3894,7 +3894,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3914,7 +3914,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "flume", @@ -3938,7 +3938,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "base64 0.22.1", @@ -3964,7 +3964,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "tokio", @@ -3982,7 +3982,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3999,7 +3999,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "base64 0.22.1", @@ -4028,7 +4028,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "socket2 0.5.7", @@ -4047,7 +4047,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "advisory-lock", "async-trait", @@ -4069,7 +4069,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "nix 0.29.0", @@ -4087,7 +4087,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "libc", @@ -4105,7 +4105,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "futures-util", @@ -4125,7 +4125,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "proc-macro2", "quote", @@ -4136,7 +4136,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "git-version", "libloading", @@ -4152,7 +4152,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "const_format", "rand", @@ -4166,7 +4166,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "anyhow", ] @@ -4174,7 +4174,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "lazy_static", "ron", @@ -4187,7 +4187,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "advisory-lock", "async-trait", @@ -4210,7 +4210,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "event-listener 5.3.1", "futures", @@ -4223,7 +4223,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "futures", "tokio", @@ -4236,7 +4236,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "crossbeam-utils", @@ -4270,7 +4270,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "const_format", diff --git a/Cargo.toml b/Cargo.toml index 11653c34a..f213af100 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,10 +72,10 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } -zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", features=["internal"], branch = "querier" } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } flume = "*" [build-dependencies] diff --git a/Cargo.toml.in b/Cargo.toml.in index 66de70f82..39e82cace 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -72,10 +72,10 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } -zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", features=["internal"], branch = "querier" } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } flume = "*" [build-dependencies] diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index e7ea5f841..bf29a3c5a 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -3110,7 +3110,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "ahash", "async-trait", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "zenoh-collections", ] @@ -3165,7 +3165,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "tracing", "uhlc", @@ -3177,12 +3177,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "json5", "num_cpus", @@ -3203,7 +3203,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "lazy_static", "tokio", @@ -3214,7 +3214,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "aes", "hmac", @@ -3227,7 +3227,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "bincode", "flume", @@ -3244,7 +3244,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "hashbrown", "keyed-set", @@ -3258,7 +3258,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3278,7 +3278,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "flume", @@ -3302,7 +3302,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "base64 0.22.1", @@ -3328,7 +3328,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "tokio", @@ -3346,7 +3346,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "socket2", @@ -3363,7 +3363,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "base64 0.22.1", @@ -3392,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "socket2", @@ -3411,7 +3411,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "advisory-lock", "async-trait", @@ -3433,7 +3433,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "nix 0.29.0", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "libc", @@ -3469,7 +3469,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "futures-util", @@ -3489,7 +3489,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "proc-macro2", "quote", @@ -3500,7 +3500,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "git-version", "libloading", @@ -3516,7 +3516,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "const_format", "rand", @@ -3530,7 +3530,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "anyhow", ] @@ -3538,7 +3538,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "lazy_static", "ron", @@ -3551,7 +3551,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "advisory-lock", "async-trait", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "event-listener", "futures", @@ -3587,7 +3587,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "futures", "tokio", @@ -3600,7 +3600,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "crossbeam-utils", @@ -3634,7 +3634,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#075f2ad30f4143104bf917246f1f90f100770c3b" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.toml b/build-resources/opaque-types/Cargo.toml index 57370d988..38d7b38d7 100644 --- a/build-resources/opaque-types/Cargo.toml +++ b/build-resources/opaque-types/Cargo.toml @@ -30,8 +30,8 @@ panic = [ default = ["zenoh/default"] [dependencies] -zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } -zenoh-protocol = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", features=["internal"], branch = "querier" } +zenoh-protocol = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } const_format = "0.2.32" flume = "*" diff --git a/build-resources/opaque-types/src/lib.rs b/build-resources/opaque-types/src/lib.rs index 29c81353b..2a396f898 100644 --- a/build-resources/opaque-types/src/lib.rs +++ b/build-resources/opaque-types/src/lib.rs @@ -14,7 +14,7 @@ use zenoh::{ handlers::{FifoChannelHandler, RingChannelHandler}, key_expr::KeyExpr, pubsub::{Publisher, Subscriber}, - query::{Query, Queryable, Reply, ReplyError}, + query::{Querier, Query, Queryable, Reply, ReplyError}, sample::Sample, scouting::Hello, session::{Session, ZenohId}, @@ -22,10 +22,8 @@ use zenoh::{ }; #[cfg(feature = "unstable")] use zenoh::{ - liveliness::LivelinessToken, - pubsub::MatchingListener, - sample::SourceInfo, - session::EntityGlobalId + liveliness::LivelinessToken, matching::MatchingListener, sample::SourceInfo, + session::EntityGlobalId, }; #[cfg(all(feature = "shared-memory", feature = "unstable"))] use zenoh::{ @@ -131,6 +129,14 @@ get_opaque_type_data!(Query, z_loaned_query_t); get_opaque_type_data!(Option>, z_owned_queryable_t); /// A loaned Zenoh queryable. get_opaque_type_data!(Queryable<()>, z_loaned_queryable_t); + +/// An owned Zenoh querier. +/// +/// Sends queries to matching queryables. +get_opaque_type_data!(Option, z_owned_querier_t); +/// A loaned Zenoh queryable. +get_opaque_type_data!(Querier, z_loaned_querier_t); + #[cfg(feature = "unstable")] /// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. /// @brief An owned Zenoh querying subscriber. @@ -209,7 +215,7 @@ get_opaque_type_data!(Publisher<'static>, z_loaned_publisher_t); /// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. /// @brief An owned Zenoh matching listener. /// -/// A listener that sends notifications when the [`MatchingStatus`] of a publisher changes. +/// A listener that sends notifications when the [`MatchingStatus`] of a publisher or querier changes. /// Dropping the corresponding publisher, also drops matching listener. get_opaque_type_data!(Option>, zc_owned_matching_listener_t); @@ -314,7 +320,6 @@ get_opaque_type_data!(MemoryLayout, z_loaned_memory_layout_t); /// @brief An owned ChunkAllocResult. get_opaque_type_data!(Option, z_owned_chunk_alloc_result_t); #[cfg(all(feature = "shared-memory", feature = "unstable"))] - #[cfg(all(feature = "shared-memory", feature = "unstable"))] /// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. /// @brief An owned ZShm slice. diff --git a/examples/parse_args.h b/examples/parse_args.h index 259d786cd..ca3002fe3 100644 --- a/examples/parse_args.h +++ b/examples/parse_args.h @@ -214,3 +214,16 @@ void parse_zenoh_common_args(const int argc, char** argv, z_owned_config_t* conf exit(-1); } } + +z_query_target_t parse_query_target(const char* arg) { + if (strcasecmp(arg, "BEST_MATCHING") == 0) { + return Z_QUERY_TARGET_BEST_MATCHING; + } else if (strcasecmp(arg, "ALL") == 0) { + return Z_QUERY_TARGET_ALL; + } else if (strcasecmp(arg, "ALL_COMPLETE") == 0) { + return Z_QUERY_TARGET_ALL_COMPLETE; + } else { + printf("Unsupported query target value [%s]\n", arg); + exit(-1); + } +} diff --git a/examples/z_get.c b/examples/z_get.c index ba43ab71a..76af1f654 100644 --- a/examples/z_get.c +++ b/examples/z_get.c @@ -19,10 +19,13 @@ #define DEFAULT_SELECTOR "demo/example/**" #define DEFAULT_VALUE NULL +#define DEFAULT_TIMEOUT_MS 10000 struct args_t { - char* selector; // -s - char* value; // -v + char* selector; // -s + char* value; // -v + z_query_target_t target; // -t + uint64_t timeout_ms; // -o }; struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); @@ -32,9 +35,18 @@ int main(int argc, char** argv) { z_owned_config_t config; struct args_t args = parse_args(argc, argv, &config); + const char* ke = args.selector; + size_t ke_len = strlen(ke); + const char* params = strchr(args.selector, "?"); + if (params != NULL) { + ke_len = params - ke; + params += 1; + } + z_view_keyexpr_t keyexpr; - if (z_view_keyexpr_from_str(&keyexpr, args.selector) < 0) { - printf("%s is not a valid key expression", args.selector); + + if (z_view_keyexpr_from_str(&keyexpr, ke) < 0) { + printf("%s is not a valid key expression", ke); exit(-1); } @@ -52,13 +64,15 @@ int main(int argc, char** argv) { z_get_options_t opts; z_get_options_default(&opts); + opts.target = args.target; + opts.timeout_ms = args.timeout_ms; z_owned_bytes_t payload; if (args.value != NULL) { z_bytes_from_static_str(&payload, args.value); opts.payload = z_move(payload); } - z_get(z_loan(s), z_loan(keyexpr), "", z_move(closure), + z_get(z_loan(s), z_loan(keyexpr), ke, z_move(closure), &opts); // here, the send is moved and will be dropped by zenoh when adequate z_owned_reply_t reply; @@ -92,8 +106,10 @@ void print_help() { Usage: z_get [OPTIONS]\n\n\ Options:\n\ -s (optional, string, default='%s'): The selection of resources to query\n\ - -v (optional, string): An optional value to put in the query\n", - DEFAULT_SELECTOR); + -p (optional, string): An optional value to put in the query\n\ + -t (optional, BEST_MATCHING | ALL | ALL_COMPLETE): Query target\n\ + -o (optional, number, default = '%d'): Query timeout in milliseconds\n" DEFAULT_SELECTOR, + DEFAULT_TIMEOUT_MS); printf(COMMON_HELP); printf( "\ @@ -109,10 +125,20 @@ struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { if (!selector) { selector = DEFAULT_SELECTOR; } - const char* value = parse_opt(argc, argv, "v", true); + const char* value = parse_opt(argc, argv, "p", true); if (!value) { value = DEFAULT_VALUE; } + const char* timeout_arg = parse_opt(argc, argv, "o", true); + uint64_t timeout_ms = DEFAULT_TIMEOUT_MS; + if (timeout_arg) { + timeout_ms = atoi(timeout_arg); + } + const char* target_arg = parse_opt(argc, argv, "t", true); + z_query_target_t target = z_query_target_default(); + if (target_arg) { + target = parse_query_target(target_arg); + } parse_zenoh_common_args(argc, argv, config); const char* arg = check_unknown_opts(argc, argv); if (arg) { @@ -126,5 +152,6 @@ struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { exit(-1); } free(pos_args); - return (struct args_t){.selector = (char*)selector, .value = (char*)value}; + return (struct args_t){ + .selector = (char*)selector, .value = (char*)value, .timeout_ms = timeout_ms, .target = target}; } diff --git a/examples/z_pub.c b/examples/z_pub.c index 2b7da9f98..43b0ff827 100644 --- a/examples/z_pub.c +++ b/examples/z_pub.c @@ -30,9 +30,9 @@ struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); #if defined(Z_FEATURE_UNSTABLE_API) void matching_status_handler(const zc_matching_status_t* matching_status, void* arg) { if (matching_status->matching) { - printf("Subscriber matched\n"); + printf("Publisher has matching subscribers.\n"); } else { - printf("No Subscribers matched\n"); + printf("Publisher has NO MORE matching subscribers.\n"); } } #endif @@ -60,16 +60,10 @@ int main(int argc, char** argv) { } #if defined(Z_FEATURE_UNSTABLE_API) - zc_owned_matching_listener_t listener; if (args.add_matching_listener) { zc_owned_closure_matching_status_t callback; z_closure(&callback, matching_status_handler, NULL, NULL); - zc_publisher_declare_matching_listener(z_loan(pub), &listener, z_move(callback)); - } -#else - if (args.add_matching_listener) { - printf("To enable matching listener you must compile Zenoh-c with unstable feature support!\n"); - exit(-1); + zc_publisher_declare_background_matching_listener(z_loan(pub), z_move(callback)); } #endif @@ -87,11 +81,6 @@ int main(int argc, char** argv) { z_publisher_put(z_loan(pub), z_move(payload), &options); } -#if defined(Z_FEATURE_UNSTABLE_API) - if (args.add_matching_listener) { - z_drop(z_move(listener)); - } -#endif z_drop(z_move(pub)); z_drop(z_move(s)); @@ -104,8 +93,11 @@ void print_help() { Usage: z_pub [OPTIONS]\n\n\ Options:\n\ -k (optional, string, default='%s'): The key expression to write to\n\ - -v (optional, string, default='%s'): The value to write\n\ - --add-matching-listener (optional): Add matching listener\n", + -v (optional, string, default='%s'): The value to write\n" +#if defined(Z_FEATURE_UNSTABLE_API) + "--add-matching-listener (optional): Add matching listener\n" +#endif + , DEFAULT_KEYEXPR, DEFAULT_VALUE); printf(COMMON_HELP); printf( diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index 8a22fbeec..0cd88abe0 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -31,9 +31,9 @@ struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); #if defined(Z_FEATURE_UNSTABLE_API) void matching_status_handler(const zc_matching_status_t* matching_status, void* arg) { if (matching_status->matching) { - printf("Subscriber matched\n"); + printf("Publisher has matching subscribers.\n"); } else { - printf("No Subscribers matched\n"); + printf("Publisher has NO MORE matching subscribers.\n"); } } #endif diff --git a/examples/z_querier.c b/examples/z_querier.c new file mode 100644 index 000000000..ce3ec104d --- /dev/null +++ b/examples/z_querier.c @@ -0,0 +1,206 @@ +// +// Copyright (c) 2024 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, +// +#include +#include + +#include "parse_args.h" +#include "zenoh.h" + +#define DEFAULT_SELECTOR "demo/example/**" +#define DEFAULT_VALUE NULL +#define DEFAULT_TIMEOUT_MS 10000 + +struct args_t { + char* selector; // -s + char* value; // -v + bool add_matching_listener; // --add-matching-listener + z_query_target_t target; // -t + uint64_t timeout_ms; // -o +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +#if defined(Z_FEATURE_UNSTABLE_API) +void matching_status_handler(const zc_matching_status_t* matching_status, void* arg) { + if (matching_status->matching) { + printf("Querier has matching queryables.\n"); + } else { + printf("Querier has NO MORE matching queryables.\n"); + } +} +#endif + +int main(int argc, char** argv) { + zc_init_log_from_env_or("error"); + + z_owned_config_t config; + struct args_t args = parse_args(argc, argv, &config); + + printf("Opening session...\n"); + z_owned_session_t s; + if (z_open(&s, z_move(config), NULL) < 0) { + printf("Unable to open session!\n"); + exit(-1); + } + + const char* ke = args.selector; + size_t ke_len = strlen(ke); + const char* params = strchr(args.selector, '?'); + if (params != NULL) { + ke_len = params - ke; + params += 1; + } + + z_view_keyexpr_t keyexpr; + if (z_view_keyexpr_from_str(&keyexpr, ke) < 0) { + printf("%s is not a valid key expression", ke); + exit(-1); + } + + printf("Declaring Querier on '%s'...\n", ke); + z_owned_querier_t querier; + + z_querier_options_t opts; + z_querier_options_default(&opts); + opts.timeout_ms = args.timeout_ms; + opts.target = args.target; + + if (z_declare_querier(z_loan(s), &querier, z_loan(keyexpr), &opts) < 0) { + printf("Unable to declare Querier for key expression!\n"); + exit(-1); + } + +#if defined(Z_FEATURE_UNSTABLE_API) + if (args.add_matching_listener) { + zc_owned_closure_matching_status_t callback; + z_closure(&callback, matching_status_handler, NULL, NULL); + zc_querier_declare_background_matching_listener(z_loan(querier), z_move(callback)); + } +#endif + + printf("Press CTRL-C to quit...\n"); + char buf[256] = {}; + for (int idx = 0; 1; ++idx) { + z_sleep_s(1); + sprintf(buf, "[%4d] %s", idx, args.value ? args.value : ""); + printf("Querying '%s' with payload '%s'...\n", args.selector, buf); + z_querier_get_options_t get_options; + z_querier_get_options_default(&get_options); + + if (args.value) { + z_owned_bytes_t payload; + z_bytes_copy_from_str(&payload, buf); + get_options.payload = z_move(payload); + } + + z_owned_fifo_handler_reply_t handler; + z_owned_closure_reply_t closure; + z_fifo_channel_reply_new(&closure, &handler, 16); + + z_querier_get(z_loan(querier), params, z_move(closure), &get_options); + + z_owned_reply_t reply; + for (z_result_t res = z_recv(z_loan(handler), &reply); res == Z_OK; res = z_recv(z_loan(handler), &reply)) { + if (z_reply_is_ok(z_loan(reply))) { + const z_loaned_sample_t* sample = z_reply_ok(z_loan(reply)); + + z_view_string_t key_str; + z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_str); + + z_owned_string_t reply_str; + z_bytes_to_string(z_sample_payload(sample), &reply_str); + + printf(">> Received ('%.*s': '%.*s')\n", (int)z_string_len(z_loan(key_str)), + z_string_data(z_loan(key_str)), (int)z_string_len(z_loan(reply_str)), + z_string_data(z_loan(reply_str))); + z_drop(z_move(reply_str)); + } else { + printf("Received an error\n"); + } + z_drop(z_move(reply)); + } + z_drop(z_move(handler)); + } + + z_drop(z_move(querier)); + z_drop(z_move(s)); + return 0; +} + +void print_help() { + printf( + "\ + Usage: z_querier [OPTIONS]\n\n\ + Options:\n\ + -s (optional, string, default='%s'): The selection of resources to query\n\ + -p (optional, string): An optional value to put in the query\n\ + -t (optional, BEST_MATCHING | ALL | ALL_COMPLETE): Query target\n\ + -o (optional, number, default = '%d'): Query timeout in milliseconds\n" +#if defined(Z_FEATURE_UNSTABLE_API) + "--add-matching-listener (optional): Add matching listener\n" +#endif + , + DEFAULT_SELECTOR, DEFAULT_TIMEOUT_MS); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* selector = parse_opt(argc, argv, "s", true); + if (!selector) { + selector = DEFAULT_SELECTOR; + } + const char* value = parse_opt(argc, argv, "p", true); + if (!value) { + value = DEFAULT_VALUE; + } + const char* timeout_arg = parse_opt(argc, argv, "o", true); + uint64_t timeout_ms = DEFAULT_TIMEOUT_MS; + if (timeout_arg) { + timeout_ms = atoi(timeout_arg); + } + const char* target_arg = parse_opt(argc, argv, "t", true); + z_query_target_t target = z_query_target_default(); + if (target_arg) { + target = parse_query_target(target_arg); + } + const char* matching_listener_arg = parse_opt(argc, argv, "add-matching-listener", false); + bool add_matching_listener = false; + if (matching_listener_arg) { + add_matching_listener = true; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.selector = (char*)selector, + .value = (char*)value, + .timeout_ms = timeout_ms, + .target = target, + .add_matching_listener = add_matching_listener}; +} diff --git a/examples/z_queryable.c b/examples/z_queryable.c index 13d381334..503f332a1 100644 --- a/examples/z_queryable.c +++ b/examples/z_queryable.c @@ -24,6 +24,7 @@ z_view_keyexpr_t ke; struct args_t { char *keyexpr; // -k char *value; // -v + bool complete; // --complete }; char *value; @@ -58,6 +59,7 @@ void query_handler(z_loaned_query_t *query, void *context) { z_view_keyexpr_t reply_keyexpr; z_view_keyexpr_from_str(&reply_keyexpr, (const char *)context); + printf(">> [Queryable ] Responding ('%s': '%s')\n", (const char *)context, value); z_query_reply(query, z_loan(reply_keyexpr), z_move(reply_payload), &options); } @@ -86,7 +88,11 @@ int main(int argc, char **argv) { z_closure(&callback, query_handler, NULL, (void *)args.keyexpr); z_owned_queryable_t qable; - if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(callback), NULL) < 0) { + z_queryable_options_t opts; + z_queryable_options_default(&opts); + opts.complete = args.complete; + + if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(callback), &opts) < 0) { printf("Unable to create queryable.\n"); exit(-1); } @@ -107,7 +113,8 @@ void print_help() { Usage: z_queryable [OPTIONS]\n\n\ Options:\n\ -k (optional, string, default='%s'): The key expression matching queries to reply to\n\ - -v (optional, string, default='%s'): The value to reply to queries with\n", + -v (optional, string, default='%s'): The value to reply to queries with\n\ + --complete (optional, flag to indicate whether queryable is complete or not)", DEFAULT_KEYEXPR, DEFAULT_VALUE); printf(COMMON_HELP); printf( @@ -128,6 +135,11 @@ struct args_t parse_args(int argc, char **argv, z_owned_config_t *config) { if (!value) { value = DEFAULT_VALUE; } + const char *complete_arg = parse_opt(argc, argv, "complete", false); + bool complete = false; + if (complete_arg) { + complete = true; + } parse_zenoh_common_args(argc, argv, config); const char *arg = check_unknown_opts(argc, argv); if (arg) { @@ -141,5 +153,5 @@ struct args_t parse_args(int argc, char **argv, z_owned_config_t *config) { exit(-1); } free(pos_args); - return (struct args_t){.keyexpr = (char *)keyexpr, .value = (char *)value}; + return (struct args_t){.keyexpr = (char *)keyexpr, .value = (char *)value, .complete = complete}; } diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 627d0a658..fb7eae956 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,6 +16,32 @@ #define ALIGN(n) #define ZENOHC_API #endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Allocation errors + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef enum z_alloc_error_t { +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Defragmentation needed. + */ + Z_ALLOC_ERROR_NEED_DEFRAGMENT, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * The provider is out of memory. + */ + Z_ALLOC_ERROR_OUT_OF_MEMORY, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Other error. + */ + Z_ALLOC_ERROR_OTHER, +#endif +} z_alloc_error_t; +#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -77,6 +103,26 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Layouting errors + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef enum z_layout_error_t { +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Layout arguments are incorrect. + */ + Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Layout incompatible with provider. + */ + Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, +#endif +} z_layout_error_t; +#endif /** * The priority of zenoh messages. */ @@ -169,6 +215,52 @@ typedef enum z_whatami_t { Z_WHATAMI_PEER = 2, Z_WHATAMI_CLIENT = 4, } z_whatami_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Status of SHM buffer allocation operation. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef enum zc_buf_alloc_status_t { +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Allocation ok + */ + ZC_BUF_ALLOC_STATUS_OK = 0, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Allocation error + */ + ZC_BUF_ALLOC_STATUS_ALLOC_ERROR = 1, +#endif +} zc_buf_alloc_status_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Status of SHM buffer layouting + allocation operation. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef enum zc_buf_layout_alloc_status_t { +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Allocation ok + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_OK = 0, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Allocation error + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_ALLOC_ERROR = 1, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Layouting error + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_LAYOUT_ERROR = 2, +#endif +} zc_buf_layout_alloc_status_t; +#endif /** * The locality of samples to be received by subscribers or targeted by publishers. */ @@ -237,19 +329,56 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -typedef struct z_moved_alloc_layout_t { - struct z_owned_alloc_layout_t _this; -} z_moved_alloc_layout_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief A result of SHM buffer allocation operation. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_buf_alloc_result_t { + enum zc_buf_alloc_status_t status; + z_owned_shm_mut_t buf; + enum z_alloc_error_t error; +} z_buf_alloc_result_t; +#endif typedef int8_t z_result_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief An AllocAlignment. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_alloc_alignment_t { + uint8_t pow; +} z_alloc_alignment_t; +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_threadsafe_context_data_t { + void *ptr; +} zc_threadsafe_context_data_t; +#endif +/** + * A tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a thread-safe context - the associated callbacks may be executed concurrently with the same + * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be + * thread-safe. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_threadsafe_context_t { + struct zc_threadsafe_context_data_t context; + void (*delete_fn)(void*); +} zc_threadsafe_context_t; +#endif typedef struct z_moved_bytes_t { struct z_owned_bytes_t _this; } z_moved_bytes_t; -typedef struct z_moved_shm_t { - struct z_owned_shm_t _this; -} z_moved_shm_t; -typedef struct z_moved_shm_mut_t { - struct z_owned_shm_mut_t _this; -} z_moved_shm_mut_t; typedef struct z_moved_slice_t { struct z_owned_slice_t _this; } z_moved_slice_t; @@ -265,9 +394,41 @@ typedef struct ALIGN(8) z_bytes_slice_iterator_t { typedef struct z_moved_bytes_writer_t { struct z_owned_bytes_writer_t _this; } z_moved_bytes_writer_t; -typedef struct z_moved_chunk_alloc_result_t { - struct z_owned_chunk_alloc_result_t _this; -} z_moved_chunk_alloc_result_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Unique segment identifier. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef uint32_t z_segment_id_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Chunk id within it's segment. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef uint32_t z_chunk_id_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief A ChunkDescriptor. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_chunk_descriptor_t { + z_segment_id_t segment; + z_chunk_id_t chunk; + size_t len; +} z_chunk_descriptor_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief An AllocatedChunk. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_allocated_chunk_t { + struct z_chunk_descriptor_t descriptpr; + void *data; +} z_allocated_chunk_t; +#endif /** * Monotonic clock */ @@ -425,6 +586,65 @@ typedef struct z_publisher_options_t { enum zc_locality_t allowed_destination; #endif } z_publisher_options_t; +/** + * An owned Zenoh querier. + * + * Sends queries to matching queryables. + */ +typedef struct ALIGN(8) z_owned_querier_t { + uint8_t _0[72]; +} z_owned_querier_t; +/** + * The replies consolidation strategy to apply on replies to a `z_get()`. + */ +typedef struct z_query_consolidation_t { + enum z_consolidation_mode_t mode; +} z_query_consolidation_t; +/** + * Options passed to the `z_declare_querier()` function. + */ +typedef struct z_querier_options_t { + /** + * The Queryables that should be target of the querier queries. + */ + enum z_query_target_t target; + /** + * The replies consolidation strategy to apply on replies to the querier queries. + */ + struct z_query_consolidation_t consolidation; + /** + * The congestion control to apply when routing the querier queries. + */ + enum z_congestion_control_t congestion_control; + /** + * If true, Zenoh will not wait to batch the querier queries with others to reduce the bandwith. + */ + bool is_express; +#if defined(Z_FEATURE_UNSTABLE_API) + /** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * + * The allowed destination for the querier queries. + */ + enum zc_locality_t allowed_destination; +#endif +#if defined(Z_FEATURE_UNSTABLE_API) + /** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * + * The accepted replies for the querier queries. + */ + enum zc_reply_keyexpr_t accept_replies; +#endif + /** + * The priority of the querier queries. + */ + enum z_priority_t priority; + /** + * The timeout for the querier queries in milliseconds. 0 means default query timeout from zenoh configuration. + */ + uint64_t timeout_ms; +} z_querier_options_t; /** * Options passed to the `z_delete()` function. */ @@ -471,15 +691,6 @@ typedef struct z_moved_fifo_handler_reply_t { typedef struct z_moved_fifo_handler_sample_t { struct z_owned_fifo_handler_sample_t _this; } z_moved_fifo_handler_sample_t; -/** - * The replies consolidation strategy to apply on replies to a `z_get()`. - */ -typedef struct z_query_consolidation_t { - enum z_consolidation_mode_t mode; -} z_query_consolidation_t; -typedef struct z_moved_source_info_t { - struct z_owned_source_info_t _this; -} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -534,7 +745,7 @@ typedef struct z_get_options_t { * * The source info for the query. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * An optional attachment to attach to the query. @@ -578,12 +789,6 @@ typedef struct z_liveliness_get_options_t { uint32_t timeout_ms; } z_liveliness_get_options_t; #endif -typedef struct z_moved_liveliness_token_t { - struct z_owned_liveliness_token_t _this; -} z_moved_liveliness_token_t; -typedef struct z_moved_memory_layout_t { - struct z_owned_memory_layout_t _this; -} z_moved_memory_layout_t; typedef struct z_moved_mutex_t { struct z_owned_mutex_t _this; } z_moved_mutex_t; @@ -624,7 +829,7 @@ typedef struct z_publisher_put_options_t { * * The source info for the publication. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to attach to the publication. @@ -677,13 +882,47 @@ typedef struct z_put_options_t { * * The source info for the message. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this message. */ struct z_moved_bytes_t *attachment; } z_put_options_t; +typedef struct z_moved_querier_t { + struct z_owned_querier_t _this; +} z_moved_querier_t; +/** + * A loaned Zenoh queryable. + */ +typedef struct ALIGN(8) z_loaned_querier_t { + uint8_t _0[72]; +} z_loaned_querier_t; +/** + * Options passed to the `z_querier_get()` function. + */ +typedef struct z_querier_get_options_t { + /** + * An optional payload to attach to the query. + */ + struct z_moved_bytes_t *payload; + /** + * An optional encoding of the query payload and or attachment. + */ + struct z_moved_encoding_t *encoding; +#if defined(Z_FEATURE_UNSTABLE_API) + /** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * + * The source info for the query. + */ + z_moved_source_info_t *source_info; +#endif + /** + * An optional attachment to attach to the query. + */ + struct z_moved_bytes_t *attachment; +} z_querier_get_options_t; typedef struct z_moved_query_t { struct z_owned_query_t _this; } z_moved_query_t; @@ -718,7 +957,7 @@ typedef struct z_query_reply_options_t { * * The source info for the reply. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -752,7 +991,7 @@ typedef struct z_query_reply_del_options_t { * * The source info for the reply. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -806,15 +1045,52 @@ typedef struct z_scout_options_t { typedef struct z_moved_session_t { struct z_owned_session_t _this; } z_moved_session_t; -typedef struct z_moved_shm_client_t { - struct z_owned_shm_client_t _this; -} z_moved_shm_client_t; -typedef struct z_moved_shm_client_storage_t { - struct z_owned_shm_client_storage_t _this; -} z_moved_shm_client_storage_t; -typedef struct z_moved_shm_provider_t { - struct z_owned_shm_provider_t _this; -} z_moved_shm_provider_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Callbacks for ShmSegment. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_shm_segment_callbacks_t { + /** + * Obtain the actual region of memory identified by it's id. + */ + uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); +} zc_shm_segment_callbacks_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief An ShmSegment. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_shm_segment_t { + struct zc_threadsafe_context_t context; + struct zc_shm_segment_callbacks_t callbacks; +} z_shm_segment_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Callback for ShmClient. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_shm_client_callbacks_t { + /** + * Attach to particular shared memory segment + */ + bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); +} zc_shm_client_callbacks_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief A result of SHM buffer layouting + allocation operation. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_buf_layout_alloc_result_t { + enum zc_buf_layout_alloc_status_t status; + z_owned_shm_mut_t buf; + enum z_alloc_error_t alloc_error; + enum z_layout_error_t layout_error; +} z_buf_layout_alloc_result_t; +#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Unique protocol identifier. @@ -824,6 +1100,47 @@ typedef struct z_moved_shm_provider_t { #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) typedef uint32_t z_protocol_id_t; #endif +/** + * A non-tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same + * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated + * with this context data are not required to be thread-safe. + * + * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can + * still be executed concurrently. The exact behavior depends on user's application, but we strongly + * discourage our users from pinning to some specific behavior unless they _really_ understand what they + * are doing. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_context_t { + void *context; + void (*delete_fn)(void*); +} zc_context_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Callbacks for ShmProviderBackend. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_shm_provider_backend_callbacks_t { + void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, + const z_loaned_memory_layout_t *layout, + void *context); + void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); + size_t (*defragment_fn)(void *context); + size_t (*available_fn)(void *context); + void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); +} zc_shm_provider_backend_callbacks_t; +#endif typedef struct z_moved_string_array_t { struct z_owned_string_array_t _this; } z_moved_string_array_t; @@ -860,12 +1177,12 @@ typedef struct zc_moved_closure_log_t { } zc_moved_closure_log_t; /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression. + * @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression or Queryables matching Queriers key expression and target. */ #if defined(Z_FEATURE_UNSTABLE_API) typedef struct zc_matching_status_t { /** - * True if there exist Subscribers matching the Publisher's key expression, false otherwise. + * True if there exist matching Zenoh entities, false otherwise. */ bool matching; } zc_matching_status_t; @@ -883,6 +1200,15 @@ typedef struct zc_owned_closure_matching_status_t { void (*_drop)(void *context); } zc_owned_closure_matching_status_t; #endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Loaned closure. + */ +#if defined(Z_FEATURE_UNSTABLE_API) +typedef struct zc_loaned_closure_matching_status_t { + size_t _0[3]; +} zc_loaned_closure_matching_status_t; +#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Moved closure. @@ -892,12 +1218,6 @@ typedef struct zc_moved_closure_matching_status_t { struct zc_owned_closure_matching_status_t _this; } zc_moved_closure_matching_status_t; #endif -typedef struct zc_moved_matching_listener_t { - struct zc_owned_matching_listener_t _this; -} zc_moved_matching_listener_t; -typedef struct zc_moved_shm_client_list_t { - struct zc_owned_shm_client_list_t _this; -} zc_moved_shm_client_list_t; /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Options passed to the `ze_declare_publication_cache()` function. @@ -966,19 +1286,6 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif -typedef struct ze_moved_publication_cache_t { - struct ze_owned_publication_cache_t _this; -} ze_moved_publication_cache_t; -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief A loaned Zenoh publication cache. - */ -typedef struct ALIGN(8) ze_loaned_publication_cache_t { - uint8_t _0[96]; -} ze_loaned_publication_cache_t; -typedef struct ze_moved_querying_subscriber_t { - struct ze_owned_querying_subscriber_t _this; -} ze_moved_querying_subscriber_t; typedef struct ze_moved_serializer_t { struct ze_owned_serializer_t _this; } ze_moved_serializer_t; @@ -1005,7 +1312,7 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1014,7 +1321,7 @@ void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1023,7 +1330,7 @@ void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1032,7 +1339,7 @@ void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1041,7 +1348,7 @@ void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_re #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1049,7 +1356,7 @@ void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_res */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_alloc_layout_drop(struct z_moved_alloc_layout_t *this_); +void z_alloc_layout_drop(z_moved_alloc_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1057,7 +1364,7 @@ void z_alloc_layout_drop(struct z_moved_alloc_layout_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); +const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1065,8 +1372,8 @@ const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_a */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -1078,7 +1385,7 @@ z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout, + const z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1093,7 +1400,7 @@ z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_re #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_as_loaned_shm(const struct z_loaned_bytes_t *this_, - const struct z_loaned_shm_t **dst); + const z_loaned_shm_t **dst); #endif /** * Constructs an owned shallow copy of data in provided uninitialized memory location. @@ -1160,7 +1467,7 @@ z_result_t z_bytes_from_buf(struct z_owned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_from_shm(struct z_owned_bytes_t *this_, - struct z_moved_shm_t *shm); + z_moved_shm_t *shm); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1169,7 +1476,7 @@ z_result_t z_bytes_from_shm(struct z_owned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_from_shm_mut(struct z_owned_bytes_t *this_, - struct z_moved_shm_mut_t *shm); + z_moved_shm_mut_t *shm); #endif /** * Converts a slice into `z_owned_bytes_t`. @@ -1296,7 +1603,7 @@ bool z_bytes_slice_iterator_next(struct z_bytes_slice_iterator_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_to_mut_loaned_shm(struct z_loaned_bytes_t *this_, - struct z_loaned_shm_t **dst); + z_loaned_shm_t **dst); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1308,7 +1615,7 @@ z_result_t z_bytes_to_mut_loaned_shm(struct z_loaned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_to_owned_shm(const struct z_loaned_bytes_t *this_, - struct z_owned_shm_t *dst); + z_owned_shm_t *dst); #endif /** * Converts data into an owned slice. @@ -1381,7 +1688,7 @@ z_result_t z_bytes_writer_write_all(struct z_loaned_bytes_writer_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); +void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1389,7 +1696,7 @@ void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1398,7 +1705,7 @@ void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** @@ -1731,7 +2038,7 @@ z_result_t z_declare_keyexpr(const struct z_loaned_session_t *session, * `z_publisher_put()` and `z_publisher_delete()` functions. * * @param session: The Zenoh session. - * @param publisher: An unitilized location in memory where publisher will be constructed. + * @param publisher: An uninitialized location in memory where publisher will be constructed. * @param key_expr: The key expression to publish. * @param options: Additional options for the publisher. * @@ -1742,6 +2049,23 @@ z_result_t z_declare_publisher(const struct z_loaned_session_t *session, struct z_owned_publisher_t *publisher, const struct z_loaned_keyexpr_t *key_expr, struct z_publisher_options_t *options); +/** + * Constructs and declares a querier on the given key expression. + * + * The queries can be send with the help of the `z_querier_get()` function. + * + * @param session: The Zenoh session. + * @param querier: An uninitialized location in memory where querier will be constructed. + * @param key_expr: The key expression to send queries on. + * @param options: Additional options for the querier. + * + * @return 0 in case of success, negative error code otherwise. + */ +ZENOHC_API +z_result_t z_declare_querier(const struct z_loaned_session_t *session, + struct z_owned_querier_t *querier, + const struct z_loaned_keyexpr_t *key_expr, + struct z_querier_options_t *options); /** * Constructs a Queryable for the given key expression. * @@ -2196,7 +2520,7 @@ const struct z_loaned_encoding_t *z_encoding_zenoh_string(void); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); +uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2204,7 +2528,7 @@ uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); +struct z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2394,7 +2718,7 @@ ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); +bool z_internal_alloc_layout_check(const z_owned_alloc_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2402,7 +2726,7 @@ bool z_internal_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_alloc_layout_null(struct z_owned_alloc_layout_t *this_); +void z_internal_alloc_layout_null(z_owned_alloc_layout_t *this_); #endif /** * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. @@ -2426,7 +2750,7 @@ ZENOHC_API void z_internal_bytes_writer_null(struct z_owned_bytes_writer_t *this */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); +bool z_internal_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2434,7 +2758,7 @@ bool z_internal_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); +void z_internal_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -2549,7 +2873,7 @@ ZENOHC_API void z_internal_keyexpr_null(struct z_owned_keyexpr_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool z_internal_liveliness_token_check(const struct z_owned_liveliness_token_t *this_); +bool z_internal_liveliness_token_check(const z_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2557,7 +2881,7 @@ bool z_internal_liveliness_token_check(const struct z_owned_liveliness_token_t * */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_internal_liveliness_token_null(struct z_owned_liveliness_token_t *this_); +void z_internal_liveliness_token_null(z_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2565,7 +2889,7 @@ void z_internal_liveliness_token_null(struct z_owned_liveliness_token_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_memory_layout_check(const struct z_owned_memory_layout_t *this_); +bool z_internal_memory_layout_check(const z_owned_memory_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2573,7 +2897,7 @@ bool z_internal_memory_layout_check(const struct z_owned_memory_layout_t *this_) */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_memory_layout_null(struct z_owned_memory_layout_t *this_); +void z_internal_memory_layout_null(z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2591,6 +2915,14 @@ ZENOHC_API bool z_internal_publisher_check(const struct z_owned_publisher_t *thi * Constructs a publisher in a gravestone state. */ ZENOHC_API void z_internal_publisher_null(struct z_owned_publisher_t *this_); +/** + * Returns ``true`` if querier is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_querier_check(const struct z_owned_querier_t *this_); +/** + * Constructs a querier in a gravestone state. + */ +ZENOHC_API void z_internal_querier_null(struct z_owned_querier_t *this_); /** * Returns `false` if `this` is in a gravestone state, `true` otherwise. */ @@ -2672,7 +3004,7 @@ ZENOHC_API void z_internal_session_null(struct z_owned_session_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_check(const struct z_owned_shm_t *this_); +bool z_internal_shm_check(const z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2680,7 +3012,7 @@ bool z_internal_shm_check(const struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_client_check(const struct z_owned_shm_client_t *this_); +bool z_internal_shm_client_check(const z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2688,7 +3020,7 @@ bool z_internal_shm_client_check(const struct z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_client_null(struct z_owned_shm_client_t *this_); +void z_internal_shm_client_null(z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2696,7 +3028,7 @@ void z_internal_shm_client_null(struct z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); +bool z_internal_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2704,7 +3036,7 @@ bool z_internal_shm_client_storage_check(const struct z_owned_shm_client_storage */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); +void z_internal_shm_client_storage_null(z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2712,7 +3044,7 @@ void z_internal_shm_client_storage_null(struct z_owned_shm_client_storage_t *thi */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_mut_check(const struct z_owned_shm_mut_t *this_); +bool z_internal_shm_mut_check(const z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2720,7 +3052,7 @@ bool z_internal_shm_mut_check(const struct z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_mut_null(struct z_owned_shm_mut_t *this_); +void z_internal_shm_mut_null(z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2728,7 +3060,7 @@ void z_internal_shm_mut_null(struct z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_null(struct z_owned_shm_t *this_); +void z_internal_shm_null(z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2736,7 +3068,7 @@ void z_internal_shm_null(struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_provider_check(const struct z_owned_shm_provider_t *this_); +bool z_internal_shm_provider_check(const z_owned_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2744,7 +3076,7 @@ bool z_internal_shm_provider_check(const struct z_owned_shm_provider_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_provider_null(struct z_owned_shm_provider_t *this_); +void z_internal_shm_provider_null(z_owned_shm_provider_t *this_); #endif /** * @return ``true`` if slice is not empty, ``false`` otherwise. @@ -2760,7 +3092,7 @@ ZENOHC_API void z_internal_slice_null(struct z_owned_slice_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool z_internal_source_info_check(const struct z_owned_source_info_t *this_); +bool z_internal_source_info_check(const z_owned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2768,7 +3100,7 @@ bool z_internal_source_info_check(const struct z_owned_source_info_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_internal_source_info_null(struct z_owned_source_info_t *this_); +void z_internal_source_info_null(z_owned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -2974,7 +3306,7 @@ z_result_t z_liveliness_declare_subscriber(const struct z_loaned_session_t *sess #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t z_liveliness_declare_token(const struct z_loaned_session_t *session, - struct z_owned_liveliness_token_t *token, + z_owned_liveliness_token_t *token, const struct z_loaned_keyexpr_t *key_expr, const struct z_liveliness_token_options_t *_options); #endif @@ -3016,7 +3348,7 @@ void z_liveliness_subscriber_options_default(struct z_liveliness_subscriber_opti */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_liveliness_token_drop(struct z_moved_liveliness_token_t *this_); +void z_liveliness_token_drop(z_moved_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3024,7 +3356,7 @@ void z_liveliness_token_drop(struct z_moved_liveliness_token_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_liveliness_token_t *z_liveliness_token_loan(const struct z_owned_liveliness_token_t *this_); +const z_loaned_liveliness_token_t *z_liveliness_token_loan(const z_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3040,7 +3372,7 @@ void z_liveliness_token_options_default(struct z_liveliness_token_options_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t z_liveliness_undeclare_token(struct z_moved_liveliness_token_t *this_); +z_result_t z_liveliness_undeclare_token(z_moved_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3048,7 +3380,7 @@ z_result_t z_liveliness_undeclare_token(struct z_moved_liveliness_token_t *this_ */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); +void z_memory_layout_drop(z_moved_memory_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3056,7 +3388,7 @@ void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_memory_layout_get_data(const struct z_loaned_memory_layout_t *this_, +void z_memory_layout_get_data(const z_loaned_memory_layout_t *this_, size_t *out_size, struct z_alloc_alignment_t *out_alignment); #endif @@ -3066,7 +3398,7 @@ void z_memory_layout_get_data(const struct z_loaned_memory_layout_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); +const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3074,7 +3406,7 @@ const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3130,7 +3462,7 @@ ZENOHC_API void z_open_options_default(struct z_open_options_t *this_); ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_moved_config_t *config, - const struct z_loaned_shm_client_storage_t *shm_clients); + const z_loaned_shm_client_storage_t *shm_clients); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3138,7 +3470,7 @@ z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); +void z_posix_shm_client_new(z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3146,8 +3478,8 @@ void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, - const struct z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, + const z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -3176,7 +3508,7 @@ ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -3235,6 +3567,56 @@ z_result_t z_put(const struct z_loaned_session_t *session, * Constructs the default value for `z_put_options_t`. */ ZENOHC_API void z_put_options_default(struct z_put_options_t *this_); +/** + * Frees memory and resets querier to its gravestone state. + * This is equivalent to calling `z_undeclare_querier()` and discarding its return value. + */ +ZENOHC_API void z_querier_drop(struct z_moved_querier_t *this_); +/** + * Query data from the matching queryables in the system. + * Replies are provided through a callback function. + * + * @param querier: The querier to make query from. + * @param parameters: The query's parameters, similar to a url's query segment. + * @param callback: The callback function that will be called on reception of replies for this query. It will be automatically dropped once all replies are processed. + * @param options: Additional options for the get. All owned fields will be consumed. + * + * @return 0 in case of success, a negative error value upon failure. + */ +ZENOHC_API +z_result_t z_querier_get(const struct z_loaned_querier_t *querier, + const char *parameters, + struct z_moved_closure_reply_t *callback, + struct z_querier_get_options_t *options); +/** + * Constructs the default value for `z_querier_get_options_t`. + */ +ZENOHC_API void z_querier_get_options_default(struct z_querier_get_options_t *this_); +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Returns the ID of the querier. + */ +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +z_entity_global_id_t z_querier_id(const struct z_loaned_querier_t *querier); +#endif +/** + * Returns the key expression of the querier. + */ +ZENOHC_API +const struct z_loaned_keyexpr_t *z_querier_keyexpr(const struct z_loaned_querier_t *querier); +/** + * Borrows querier. + */ +ZENOHC_API const struct z_loaned_querier_t *z_querier_loan(const struct z_owned_querier_t *this_); +/** + * Mutably borrows querier. + */ +ZENOHC_API struct z_loaned_querier_t *z_querier_loan_mut(struct z_owned_querier_t *this_); +/** + * Constructs the default value for `z_querier_options_t`. + */ +ZENOHC_API void z_querier_options_default(struct z_querier_options_t *this_); /** * Gets query attachment. * @@ -3397,7 +3779,7 @@ ZENOHC_API void z_queryable_drop(struct z_moved_queryable_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_entity_global_id_t z_queryable_id(const struct z_loaned_queryable_t *queryable); +z_entity_global_id_t z_queryable_id(const struct z_loaned_queryable_t *queryable); #endif ZENOHC_API const struct z_loaned_queryable_t *z_queryable_loan(const struct z_owned_queryable_t *this_); @@ -3431,7 +3813,7 @@ ZENOHC_API uint8_t z_random_u8(void); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); +void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3666,7 +4048,7 @@ enum z_reliability_t z_sample_reliability(const struct z_loaned_sample_t *this_) */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3712,7 +4094,7 @@ ZENOHC_API struct z_loaned_session_t *z_session_loan_mut(struct z_owned_session_ */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_drop(struct z_moved_shm_client_t *this_); +void z_shm_client_drop(z_moved_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3720,7 +4102,7 @@ void z_shm_client_drop(struct z_moved_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_new(struct z_owned_shm_client_t *this_, +void z_shm_client_new(z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3730,8 +4112,8 @@ void z_shm_client_new(struct z_owned_shm_client_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, - const struct z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, + const z_loaned_shm_client_storage_t *from); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3739,7 +4121,7 @@ void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); +void z_shm_client_storage_drop(z_moved_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3747,7 +4129,7 @@ void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); +const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3755,8 +4137,8 @@ const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const stru */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, - const struct zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, + const zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif /** @@ -3765,7 +4147,7 @@ z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); +void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3773,8 +4155,8 @@ void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_ */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_clone(struct z_owned_shm_t *out, - const struct z_loaned_shm_t *this_); +void z_shm_clone(z_owned_shm_t *out, + const z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3782,7 +4164,7 @@ void z_shm_clone(struct z_owned_shm_t *out, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); +const unsigned char *z_shm_data(const z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3790,7 +4172,7 @@ const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_drop(struct z_moved_shm_t *this_); +void z_shm_drop(z_moved_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3798,8 +4180,8 @@ void z_shm_drop(struct z_moved_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_from_mut(struct z_owned_shm_t *this_, - struct z_moved_shm_mut_t *that); +void z_shm_from_mut(z_owned_shm_t *this_, + z_moved_shm_mut_t *that); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3807,7 +4189,7 @@ void z_shm_from_mut(struct z_owned_shm_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_len(const struct z_loaned_shm_t *this_); +size_t z_shm_len(const z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3815,7 +4197,7 @@ size_t z_shm_len(const struct z_loaned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); +const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3823,7 +4205,7 @@ const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); +z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3831,7 +4213,7 @@ struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); +const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3839,7 +4221,7 @@ const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); +unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3847,7 +4229,7 @@ unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); +void z_shm_mut_drop(z_moved_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3855,7 +4237,7 @@ void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); +size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3863,7 +4245,7 @@ size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); +const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3871,7 +4253,7 @@ const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t * */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); +z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3885,9 +4267,9 @@ struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, - struct z_moved_shm_t *that, - struct z_owned_shm_t *immut); +z_result_t z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, + z_moved_shm_t *that, + z_owned_shm_t *immut); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3896,7 +4278,7 @@ z_result_t z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3907,7 +4289,7 @@ void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3918,7 +4300,7 @@ void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3930,7 +4312,7 @@ void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_resu #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3944,7 +4326,7 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3955,7 +4337,7 @@ void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3965,7 +4347,7 @@ void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t * */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); +size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3974,7 +4356,7 @@ size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); +size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3982,7 +4364,7 @@ size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider) */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_provider_drop(struct z_moved_shm_provider_t *this_); +void z_shm_provider_drop(z_moved_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3990,7 +4372,7 @@ void z_shm_provider_drop(struct z_moved_shm_provider_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); +size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3998,7 +4380,7 @@ size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *prov */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); +const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4006,8 +4388,8 @@ const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_s */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, + const z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -4017,7 +4399,7 @@ z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_provider_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -4028,7 +4410,7 @@ void z_shm_provider_new(struct z_owned_shm_provider_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -4039,7 +4421,7 @@ void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); +z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4047,7 +4429,7 @@ struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); +z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -4120,7 +4502,7 @@ ZENOHC_API const struct z_loaned_slice_t *z_slice_loan(const struct z_owned_slic */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_source_info_drop(struct z_moved_source_info_t *this_); +void z_source_info_drop(z_moved_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4128,7 +4510,7 @@ void z_source_info_drop(struct z_moved_source_info_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); +z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4136,7 +4518,7 @@ struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); +const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4144,8 +4526,8 @@ const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_sou */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t z_source_info_new(struct z_owned_source_info_t *this_, - const struct z_entity_global_id_t *source_id, +z_result_t z_source_info_new(z_owned_source_info_t *this_, + const z_entity_global_id_t *source_id, uint32_t source_sn); #endif /** @@ -4154,7 +4536,7 @@ z_result_t z_source_info_new(struct z_owned_source_info_t *this_, */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -uint32_t z_source_info_sn(const struct z_loaned_source_info_t *this_); +uint32_t z_source_info_sn(const z_loaned_source_info_t *this_); #endif /** * Constructs an owned copy of a string array. @@ -4369,6 +4751,12 @@ z_result_t z_undeclare_keyexpr(const struct z_loaned_session_t *session, * @return 0 in case of success, negative error code otherwise. */ ZENOHC_API z_result_t z_undeclare_publisher(struct z_moved_publisher_t *this_); +/** + * @brief Undeclares the given querier. + * + * @return 0 in case of success, negative error code otherwise. + */ +ZENOHC_API z_result_t z_undeclare_querier(struct z_moved_querier_t *this_); /** * Undeclares a `z_owned_queryable_t`. * Returns 0 in case of success, negative error code otherwise. @@ -4748,7 +5136,7 @@ void zc_internal_closure_matching_status_null(struct zc_owned_closure_matching_s */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool zc_internal_matching_listener_check(const struct zc_owned_matching_listener_t *this_); +bool zc_internal_matching_listener_check(const zc_owned_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4756,7 +5144,7 @@ bool zc_internal_matching_listener_check(const struct zc_owned_matching_listener */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_internal_matching_listener_null(struct zc_owned_matching_listener_t *this_); +void zc_internal_matching_listener_null(zc_owned_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4764,7 +5152,7 @@ void zc_internal_matching_listener_null(struct zc_owned_matching_listener_t *thi */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool zc_internal_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); +bool zc_internal_shm_client_list_check(const zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4772,7 +5160,7 @@ bool zc_internal_shm_client_list_check(const struct zc_owned_shm_client_list_t * */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_internal_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); +void zc_internal_shm_client_list_null(zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4800,13 +5188,21 @@ z_result_t zc_liveliness_declare_background_subscriber(const struct z_loaned_ses ZENOHC_API enum zc_locality_t zc_locality_default(void); #endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Undeclares the given matching listener, droping and invalidating it. + */ +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +void zc_matching_listener_drop(zc_moved_matching_listener_t *this_); +#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Declares a matching listener, registering a callback for notifying subscribers matching with a given publisher. * The callback will be run in the background until the corresponding publisher is dropped. * * @param publisher: A publisher to associate with matching listener. - * @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber, disconnects or when the first subscriber connects). + * @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber disconnects or when the first subscriber connects). * * @return 0 in case of success, negative error code otherwise. */ @@ -4820,15 +5216,15 @@ z_result_t zc_publisher_declare_background_matching_listener(const struct z_loan * @brief Constructs matching listener, registering a callback for notifying subscribers matching with a given publisher. * * @param publisher: A publisher to associate with matching listener. - * @param matching_listener: An unitilized memory location where matching listener will be constructed. The matching listener will be automatically dropped when publisher is dropped. - * @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber, disconnects or when the first subscriber connects). + * @param matching_listener: An uninitialized memory location where matching listener will be constructed. The matching listener's callback will be automatically dropped when the publisher is dropped. + * @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber disconnects or when the first subscriber connects). * * @return 0 in case of success, negative error code otherwise. */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t zc_publisher_declare_matching_listener(const struct z_loaned_publisher_t *publisher, - struct zc_owned_matching_listener_t *matching_listener, + zc_owned_matching_listener_t *matching_listener, struct zc_moved_closure_matching_status_t *callback); #endif /** @@ -4844,11 +5240,45 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Undeclares the given matching listener, droping and invalidating it. + * @brief Declares a matching listener, registering a callback for notifying queryables matching the given querier key expression and target. + * The callback will be run in the background until the corresponding querier is dropped. + * + * @param querier: A querier to associate with matching listener. + * @param callback: A closure that will be called every time the matching status of the querier changes (If last queryable disconnects or when the first queryable connects). + * + * @return 0 in case of success, negative error code otherwise. + */ +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +z_result_t zc_querier_declare_background_matching_listener(const struct z_loaned_querier_t *querier, + struct zc_moved_closure_matching_status_t *callback); +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Constructs matching listener, registering a callback for notifying queryables matching with a given querier's key expression and target. + * + * @param querier: A querier to associate with matching listener. + * @param matching_listener: An uninitialized memory location where matching listener will be constructed. The matching listener's callback will be automatically dropped when the querier is dropped. + * @param callback: A closure that will be called every time the matching status of the querier changes (If last queryable disconnects or when the first queryable connects). + * + * @return 0 in case of success, negative error code otherwise. + */ +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +z_result_t zc_querier_declare_matching_listener(const struct z_loaned_querier_t *querier, + zc_owned_matching_listener_t *matching_listener, + struct zc_moved_closure_matching_status_t *callback); +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Gets querier matching status - i.e. if there are any queryables matching its key expression and target. + * + * @return 0 in case of success, negative error code otherwise (in this case matching_status is not updated). */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t *this_); +z_result_t zc_querier_get_matching_status(const struct z_loaned_querier_t *this_, + struct zc_matching_status_t *matching_status); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4864,9 +5294,9 @@ enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_shm_client_list_add_client(struct zc_loaned_shm_client_list_t *this_, +z_result_t zc_shm_client_list_add_client(zc_loaned_shm_client_list_t *this_, z_protocol_id_t id, - struct z_moved_shm_client_t *client); + z_moved_shm_client_t *client); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4874,7 +5304,7 @@ z_result_t zc_shm_client_list_add_client(struct zc_loaned_shm_client_list_t *thi */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); +void zc_shm_client_list_drop(zc_moved_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4882,7 +5312,7 @@ void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); +const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4890,7 +5320,7 @@ const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct z */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); +zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4898,7 +5328,7 @@ struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_ */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); +void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -4966,7 +5396,7 @@ z_result_t ze_declare_background_querying_subscriber(const struct z_loaned_sessi #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t ze_declare_publication_cache(const struct z_loaned_session_t *session, - struct ze_owned_publication_cache_t *pub_cache, + ze_owned_publication_cache_t *pub_cache, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); #endif @@ -4985,7 +5415,7 @@ z_result_t ze_declare_publication_cache(const struct z_loaned_session_t *session #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t ze_declare_querying_subscriber(const struct z_loaned_session_t *session, - struct ze_owned_querying_subscriber_t *querying_subscriber, + ze_owned_querying_subscriber_t *querying_subscriber, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t *callback, struct ze_querying_subscriber_options_t *options); @@ -5169,7 +5599,7 @@ ZENOHC_API bool ze_deserializer_is_done(const struct ze_deserializer_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool ze_internal_publication_cache_check(const struct ze_owned_publication_cache_t *this_); +bool ze_internal_publication_cache_check(const ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5177,7 +5607,7 @@ bool ze_internal_publication_cache_check(const struct ze_owned_publication_cache */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_internal_publication_cache_null(struct ze_owned_publication_cache_t *this_); +void ze_internal_publication_cache_null(ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5185,13 +5615,13 @@ void ze_internal_publication_cache_null(struct ze_owned_publication_cache_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool ze_internal_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); +bool ze_internal_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(Z_FEATURE_UNSTABLE_API) -ZENOHC_API void ze_internal_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_internal_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); #endif /** * @brief Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. @@ -5208,7 +5638,7 @@ ZENOHC_API void ze_internal_serializer_null(struct ze_owned_serializer_t *this_) */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); +void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5216,7 +5646,7 @@ void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const struct ze_loaned_publication_cache_t *this_); +const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const ze_loaned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5224,7 +5654,7 @@ const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const struct ze_lo */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct ze_loaned_publication_cache_t *ze_publication_cache_loan(const struct ze_owned_publication_cache_t *this_); +const ze_loaned_publication_cache_t *ze_publication_cache_loan(const ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5241,7 +5671,7 @@ void ze_publication_cache_options_default(struct ze_publication_cache_options_t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); +void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5251,7 +5681,7 @@ void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, struct z_get_options_t *options); #endif @@ -5261,7 +5691,7 @@ z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); +const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5506,7 +5936,7 @@ z_result_t ze_serializer_serialize_uint8(struct ze_loaned_serializer_t *this_, */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *this_); +z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5516,5 +5946,5 @@ z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t *this_); +z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t *this_); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index eccc03a77..9dda86b8b 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,10 +4,8 @@ #ifndef __cplusplus -static inline z_moved_alloc_layout_t* z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t*)(x); } static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t*)(x); } static inline z_moved_bytes_writer_t* z_bytes_writer_move(z_owned_bytes_writer_t* x) { return (z_moved_bytes_writer_t*)(x); } -static inline z_moved_chunk_alloc_result_t* z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t*)(x); } static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t*)(x); } static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t*)(x); } static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t*)(x); } @@ -21,10 +19,9 @@ static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fi static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t*)(x); } static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t*)(x); } static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t*)(x); } -static inline z_moved_liveliness_token_t* z_liveliness_token_move(z_owned_liveliness_token_t* x) { return (z_moved_liveliness_token_t*)(x); } -static inline z_moved_memory_layout_t* z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t*)(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t*)(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t*)(x); } +static inline z_moved_querier_t* z_querier_move(z_owned_querier_t* x) { return (z_moved_querier_t*)(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return (z_moved_query_t*)(x); } static inline z_moved_queryable_t* z_queryable_move(z_owned_queryable_t* x) { return (z_moved_queryable_t*)(x); } static inline z_moved_reply_t* z_reply_move(z_owned_reply_t* x) { return (z_moved_reply_t*)(x); } @@ -34,29 +31,17 @@ static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ri static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t*)(x); } static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t*)(x); } static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return (z_moved_session_t*)(x); } -static inline z_moved_shm_client_t* z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t*)(x); } -static inline z_moved_shm_client_storage_t* z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t*)(x); } -static inline z_moved_shm_t* z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t*)(x); } -static inline z_moved_shm_mut_t* z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t*)(x); } -static inline z_moved_shm_provider_t* z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t*)(x); } static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t*)(x); } -static inline z_moved_source_info_t* z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t*)(x); } static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t*)(x); } static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return (z_moved_string_t*)(x); } static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t*)(x); } static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return (z_moved_task_t*)(x); } static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t*)(x); } -static inline zc_moved_closure_matching_status_t* zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t*)(x); } -static inline zc_moved_matching_listener_t* zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t*)(x); } -static inline zc_moved_shm_client_list_t* zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t*)(x); } -static inline ze_moved_publication_cache_t* ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t*)(x); } -static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t*)(x); } static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x) { return (ze_moved_serializer_t*)(x); } #define z_loan(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ z_owned_bytes_writer_t : z_bytes_writer_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ @@ -72,9 +57,8 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ - z_owned_liveliness_token_t : z_liveliness_token_loan, \ - z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ + z_owned_querier_t : z_querier_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ z_owned_reply_err_t : z_reply_err_loan, \ @@ -84,12 +68,7 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ - z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ - z_owned_shm_t : z_shm_loan, \ - z_owned_shm_mut_t : z_shm_mut_loan, \ - z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ - z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ @@ -97,10 +76,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_view_slice_t : z_view_slice_loan, \ z_view_string_t : z_view_string_loan, \ zc_owned_closure_log_t : zc_closure_log_loan, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ - ze_owned_publication_cache_t : ze_publication_cache_loan, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_loan, \ ze_owned_serializer_t : ze_serializer_loan \ )(&this_) @@ -117,20 +92,16 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ + z_owned_querier_t : z_querier_loan_mut, \ z_owned_session_t : z_session_loan_mut, \ - z_owned_shm_t : z_shm_loan_mut, \ - z_owned_shm_mut_t : z_shm_mut_loan_mut, \ z_owned_string_array_t : z_string_array_loan_mut, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut, \ ze_owned_serializer_t : ze_serializer_loan_mut \ )(&this_) #define z_drop(this_) \ _Generic((this_), \ - z_moved_alloc_layout_t* : z_alloc_layout_drop, \ z_moved_bytes_t* : z_bytes_drop, \ z_moved_bytes_writer_t* : z_bytes_writer_drop, \ - z_moved_chunk_alloc_result_t* : z_chunk_alloc_result_drop, \ z_moved_closure_hello_t* : z_closure_hello_drop, \ z_moved_closure_query_t* : z_closure_query_drop, \ z_moved_closure_reply_t* : z_closure_reply_drop, \ @@ -144,10 +115,9 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_moved_fifo_handler_sample_t* : z_fifo_handler_sample_drop, \ z_moved_hello_t* : z_hello_drop, \ z_moved_keyexpr_t* : z_keyexpr_drop, \ - z_moved_liveliness_token_t* : z_liveliness_token_drop, \ - z_moved_memory_layout_t* : z_memory_layout_drop, \ z_moved_mutex_t* : z_mutex_drop, \ z_moved_publisher_t* : z_publisher_drop, \ + z_moved_querier_t* : z_querier_drop, \ z_moved_query_t* : z_query_drop, \ z_moved_queryable_t* : z_queryable_drop, \ z_moved_reply_t* : z_reply_drop, \ @@ -157,32 +127,19 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_moved_ring_handler_sample_t* : z_ring_handler_sample_drop, \ z_moved_sample_t* : z_sample_drop, \ z_moved_session_t* : z_session_drop, \ - z_moved_shm_client_t* : z_shm_client_drop, \ - z_moved_shm_client_storage_t* : z_shm_client_storage_drop, \ - z_moved_shm_t* : z_shm_drop, \ - z_moved_shm_mut_t* : z_shm_mut_drop, \ - z_moved_shm_provider_t* : z_shm_provider_drop, \ z_moved_slice_t* : z_slice_drop, \ - z_moved_source_info_t* : z_source_info_drop, \ z_moved_string_array_t* : z_string_array_drop, \ z_moved_string_t* : z_string_drop, \ z_moved_subscriber_t* : z_subscriber_drop, \ z_moved_task_t* : z_task_drop, \ zc_moved_closure_log_t* : zc_closure_log_drop, \ - zc_moved_closure_matching_status_t* : zc_closure_matching_status_drop, \ - zc_moved_matching_listener_t* : zc_publisher_matching_listener_drop, \ - zc_moved_shm_client_list_t* : zc_shm_client_list_drop, \ - ze_moved_publication_cache_t* : ze_publication_cache_drop, \ - ze_moved_querying_subscriber_t* : ze_querying_subscriber_drop, \ ze_moved_serializer_t* : ze_serializer_drop \ )(this_) #define z_move(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_move, \ z_owned_bytes_t : z_bytes_move, \ z_owned_bytes_writer_t : z_bytes_writer_move, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ z_owned_closure_hello_t : z_closure_hello_move, \ z_owned_closure_query_t : z_closure_query_move, \ z_owned_closure_reply_t : z_closure_reply_move, \ @@ -196,10 +153,9 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ z_owned_hello_t : z_hello_move, \ z_owned_keyexpr_t : z_keyexpr_move, \ - z_owned_liveliness_token_t : z_liveliness_token_move, \ - z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ z_owned_publisher_t : z_publisher_move, \ + z_owned_querier_t : z_querier_move, \ z_owned_query_t : z_query_move, \ z_owned_queryable_t : z_queryable_move, \ z_owned_reply_t : z_reply_move, \ @@ -209,32 +165,19 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ z_owned_sample_t : z_sample_move, \ z_owned_session_t : z_session_move, \ - z_owned_shm_client_t : z_shm_client_move, \ - z_owned_shm_client_storage_t : z_shm_client_storage_move, \ - z_owned_shm_t : z_shm_move, \ - z_owned_shm_mut_t : z_shm_mut_move, \ - z_owned_shm_provider_t : z_shm_provider_move, \ z_owned_slice_t : z_slice_move, \ - z_owned_source_info_t : z_source_info_move, \ z_owned_string_array_t : z_string_array_move, \ z_owned_string_t : z_string_move, \ z_owned_subscriber_t : z_subscriber_move, \ z_owned_task_t : z_task_move, \ zc_owned_closure_log_t : zc_closure_log_move, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ - zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ - zc_owned_shm_client_list_t : zc_shm_client_list_move, \ - ze_owned_publication_cache_t : ze_publication_cache_move, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_move, \ ze_owned_serializer_t : ze_serializer_move \ )(&this_) #define z_internal_null(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_internal_alloc_layout_null, \ z_owned_bytes_t* : z_internal_bytes_null, \ z_owned_bytes_writer_t* : z_internal_bytes_writer_null, \ - z_owned_chunk_alloc_result_t* : z_internal_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_internal_closure_hello_null, \ z_owned_closure_query_t* : z_internal_closure_query_null, \ z_owned_closure_reply_t* : z_internal_closure_reply_null, \ @@ -248,10 +191,9 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_fifo_handler_sample_t* : z_internal_fifo_handler_sample_null, \ z_owned_hello_t* : z_internal_hello_null, \ z_owned_keyexpr_t* : z_internal_keyexpr_null, \ - z_owned_liveliness_token_t* : z_internal_liveliness_token_null, \ - z_owned_memory_layout_t* : z_internal_memory_layout_null, \ z_owned_mutex_t* : z_internal_mutex_null, \ z_owned_publisher_t* : z_internal_publisher_null, \ + z_owned_querier_t* : z_internal_querier_null, \ z_owned_query_t* : z_internal_query_null, \ z_owned_queryable_t* : z_internal_queryable_null, \ z_owned_reply_err_t* : z_internal_reply_err_null, \ @@ -261,30 +203,17 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_ring_handler_sample_t* : z_internal_ring_handler_sample_null, \ z_owned_sample_t* : z_internal_sample_null, \ z_owned_session_t* : z_internal_session_null, \ - z_owned_shm_client_t* : z_internal_shm_client_null, \ - z_owned_shm_client_storage_t* : z_internal_shm_client_storage_null, \ - z_owned_shm_mut_t* : z_internal_shm_mut_null, \ - z_owned_shm_t* : z_internal_shm_null, \ - z_owned_shm_provider_t* : z_internal_shm_provider_null, \ z_owned_slice_t* : z_internal_slice_null, \ - z_owned_source_info_t* : z_internal_source_info_null, \ z_owned_string_array_t* : z_internal_string_array_null, \ z_owned_string_t* : z_internal_string_null, \ z_owned_subscriber_t* : z_internal_subscriber_null, \ z_owned_task_t* : z_internal_task_null, \ zc_owned_closure_log_t* : zc_internal_closure_log_null, \ - zc_owned_closure_matching_status_t* : zc_internal_closure_matching_status_null, \ - zc_owned_matching_listener_t* : zc_internal_matching_listener_null, \ - zc_owned_shm_client_list_t* : zc_internal_shm_client_list_null, \ - ze_owned_publication_cache_t* : ze_internal_publication_cache_null, \ - ze_owned_querying_subscriber_t* : ze_internal_querying_subscriber_null, \ ze_owned_serializer_t* : ze_internal_serializer_null \ )(this_) -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { *this_ = x->_this; z_internal_alloc_layout_null(&x->_this); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_internal_bytes_null(&x->_this); } static inline void z_bytes_writer_take(z_owned_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { *this_ = x->_this; z_internal_bytes_writer_null(&x->_this); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { *this_ = x->_this; z_internal_chunk_alloc_result_null(&x->_this); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_internal_closure_hello_null(&x->_this); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_internal_closure_query_null(&x->_this); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_internal_closure_reply_null(&x->_this); } @@ -298,10 +227,9 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_internal_fifo_handler_sample_null(&x->_this); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_internal_hello_null(&x->_this); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } -static inline void z_liveliness_token_take(z_owned_liveliness_token_t* this_, z_moved_liveliness_token_t* x) { *this_ = x->_this; z_internal_liveliness_token_null(&x->_this); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { *this_ = x->_this; z_internal_memory_layout_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } +static inline void z_querier_take(z_owned_querier_t* this_, z_moved_querier_t* x) { *this_ = x->_this; z_internal_querier_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_internal_queryable_null(&x->_this); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_internal_reply_null(&x->_this); } @@ -311,32 +239,19 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_internal_ring_handler_sample_null(&x->_this); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_internal_sample_null(&x->_this); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_internal_session_null(&x->_this); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_internal_shm_client_null(&x->_this); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { *this_ = x->_this; z_internal_shm_client_storage_null(&x->_this); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t* x) { *this_ = x->_this; z_internal_shm_null(&x->_this); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { *this_ = x->_this; z_internal_shm_mut_null(&x->_this); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { *this_ = x->_this; z_internal_shm_provider_null(&x->_this); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_internal_slice_null(&x->_this); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { *this_ = x->_this; z_internal_source_info_null(&x->_this); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_internal_string_array_null(&x->_this); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_internal_string_null(&x->_this); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_internal_subscriber_null(&x->_this); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_internal_task_null(&x->_this); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_internal_closure_log_null(&x->_this); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { *closure_ = x->_this; zc_internal_closure_matching_status_null(&x->_this); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_internal_matching_listener_null(&x->_this); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { *this_ = x->_this; zc_internal_shm_client_list_null(&x->_this); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { *this_ = x->_this; ze_internal_publication_cache_null(&x->_this); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { *this_ = x->_this; ze_internal_querying_subscriber_null(&x->_this); } static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { *this_ = x->_this; ze_internal_serializer_null(&x->_this); } #define z_take(this_, x) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_take, \ z_owned_bytes_t* : z_bytes_take, \ z_owned_bytes_writer_t* : z_bytes_writer_take, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ z_owned_closure_hello_t* : z_closure_hello_take, \ z_owned_closure_query_t* : z_closure_query_take, \ z_owned_closure_reply_t* : z_closure_reply_take, \ @@ -350,10 +265,9 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ z_owned_hello_t* : z_hello_take, \ z_owned_keyexpr_t* : z_keyexpr_take, \ - z_owned_liveliness_token_t* : z_liveliness_token_take, \ - z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ z_owned_publisher_t* : z_publisher_take, \ + z_owned_querier_t* : z_querier_take, \ z_owned_query_t* : z_query_take, \ z_owned_queryable_t* : z_queryable_take, \ z_owned_reply_t* : z_reply_take, \ @@ -363,32 +277,19 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ z_owned_sample_t* : z_sample_take, \ z_owned_session_t* : z_session_take, \ - z_owned_shm_client_t* : z_shm_client_take, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ - z_owned_shm_t* : z_shm_take, \ - z_owned_shm_mut_t* : z_shm_mut_take, \ - z_owned_shm_provider_t* : z_shm_provider_take, \ z_owned_slice_t* : z_slice_take, \ - z_owned_source_info_t* : z_source_info_take, \ z_owned_string_array_t* : z_string_array_take, \ z_owned_string_t* : z_string_take, \ z_owned_subscriber_t* : z_subscriber_take, \ z_owned_task_t* : z_task_take, \ zc_owned_closure_log_t* : zc_closure_log_take, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ - zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ - ze_owned_publication_cache_t* : ze_publication_cache_take, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_take, \ ze_owned_serializer_t* : ze_serializer_take \ )(this_, x) #define z_internal_check(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_internal_alloc_layout_check, \ z_owned_bytes_t : z_internal_bytes_check, \ z_owned_bytes_writer_t : z_internal_bytes_writer_check, \ - z_owned_chunk_alloc_result_t : z_internal_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_internal_closure_hello_check, \ z_owned_closure_query_t : z_internal_closure_query_check, \ z_owned_closure_reply_t : z_internal_closure_reply_check, \ @@ -402,10 +303,9 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_fifo_handler_sample_t : z_internal_fifo_handler_sample_check, \ z_owned_hello_t : z_internal_hello_check, \ z_owned_keyexpr_t : z_internal_keyexpr_check, \ - z_owned_liveliness_token_t : z_internal_liveliness_token_check, \ - z_owned_memory_layout_t : z_internal_memory_layout_check, \ z_owned_mutex_t : z_internal_mutex_check, \ z_owned_publisher_t : z_internal_publisher_check, \ + z_owned_querier_t : z_internal_querier_check, \ z_owned_query_t : z_internal_query_check, \ z_owned_queryable_t : z_internal_queryable_check, \ z_owned_reply_t : z_internal_reply_check, \ @@ -415,23 +315,12 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_ring_handler_sample_t : z_internal_ring_handler_sample_check, \ z_owned_sample_t : z_internal_sample_check, \ z_owned_session_t : z_internal_session_check, \ - z_owned_shm_t : z_internal_shm_check, \ - z_owned_shm_client_t : z_internal_shm_client_check, \ - z_owned_shm_client_storage_t : z_internal_shm_client_storage_check, \ - z_owned_shm_mut_t : z_internal_shm_mut_check, \ - z_owned_shm_provider_t : z_internal_shm_provider_check, \ z_owned_slice_t : z_internal_slice_check, \ - z_owned_source_info_t : z_internal_source_info_check, \ z_owned_string_array_t : z_internal_string_array_check, \ z_owned_string_t : z_internal_string_check, \ z_owned_subscriber_t : z_internal_subscriber_check, \ z_owned_task_t : z_internal_task_check, \ zc_owned_closure_log_t : zc_internal_closure_log_check, \ - zc_owned_closure_matching_status_t : zc_internal_closure_matching_status_check, \ - zc_owned_matching_listener_t : zc_internal_matching_listener_check, \ - zc_owned_shm_client_list_t : zc_internal_shm_client_list_check, \ - ze_owned_publication_cache_t : ze_internal_publication_cache_check, \ - ze_owned_querying_subscriber_t : ze_internal_querying_subscriber_check, \ ze_owned_serializer_t : ze_internal_serializer_check \ )(&this_) @@ -441,8 +330,7 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ const z_loaned_closure_sample_t* : z_closure_sample_call, \ - const z_loaned_closure_zid_t* : z_closure_zid_call, \ - const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ + const z_loaned_closure_zid_t* : z_closure_zid_call \ )(closure, hello) typedef void(*z_closure_drop_callback_t)(void *context); @@ -452,7 +340,6 @@ typedef void(*z_closure_reply_callback_t)(z_loaned_reply_t *reply, void *context typedef void(*z_closure_sample_callback_t)(z_loaned_sample_t *sample, void *context); typedef void(*z_closure_zid_callback_t)(const z_id_t *z_id, void *context); typedef void(*zc_closure_log_callback_t)(zc_log_severity_t severity, const z_loaned_string_t *msg, void *context); -typedef void(*zc_closure_matching_status_callback_t)(const zc_matching_status_t *matching_status, void *context); #define z_closure(this_, call, drop, context) \ _Generic((this_), \ @@ -461,8 +348,7 @@ typedef void(*zc_closure_matching_status_callback_t)(const zc_matching_status_t z_owned_closure_reply_t* : z_closure_reply, \ z_owned_closure_sample_t* : z_closure_sample, \ z_owned_closure_zid_t* : z_closure_zid, \ - zc_owned_closure_log_t* : zc_closure_log, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status \ + zc_owned_closure_log_t* : zc_closure_log \ )(this_, call, drop, context) #define z_try_recv(this_, query) \ @@ -496,8 +382,6 @@ typedef void(*zc_closure_matching_status_callback_t)(const zc_matching_status_t z_owned_reply_t* : z_reply_clone, \ z_owned_reply_err_t* : z_reply_err_clone, \ z_owned_sample_t* : z_sample_clone, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_clone, \ - z_owned_shm_t* : z_shm_clone, \ z_owned_slice_t* : z_slice_clone, \ z_owned_string_array_t* : z_string_array_clone, \ z_owned_string_t* : z_string_clone \ @@ -505,10 +389,8 @@ typedef void(*zc_closure_matching_status_callback_t)(const zc_matching_status_t #else // #ifndef __cplusplus -static inline z_moved_alloc_layout_t* z_alloc_layout_move(z_owned_alloc_layout_t* x) { return reinterpret_cast(x); } static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return reinterpret_cast(x); } static inline z_moved_bytes_writer_t* z_bytes_writer_move(z_owned_bytes_writer_t* x) { return reinterpret_cast(x); } -static inline z_moved_chunk_alloc_result_t* z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return reinterpret_cast(x); } @@ -522,10 +404,9 @@ static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fi static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return reinterpret_cast(x); } static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return reinterpret_cast(x); } -static inline z_moved_liveliness_token_t* z_liveliness_token_move(z_owned_liveliness_token_t* x) { return reinterpret_cast(x); } -static inline z_moved_memory_layout_t* z_memory_layout_move(z_owned_memory_layout_t* x) { return reinterpret_cast(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return reinterpret_cast(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return reinterpret_cast(x); } +static inline z_moved_querier_t* z_querier_move(z_owned_querier_t* x) { return reinterpret_cast(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return reinterpret_cast(x); } static inline z_moved_queryable_t* z_queryable_move(z_owned_queryable_t* x) { return reinterpret_cast(x); } static inline z_moved_reply_t* z_reply_move(z_owned_reply_t* x) { return reinterpret_cast(x); } @@ -535,28 +416,16 @@ static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ri static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_client_t* z_shm_client_move(z_owned_shm_client_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_client_storage_t* z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_t* z_shm_move(z_owned_shm_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_mut_t* z_shm_mut_move(z_owned_shm_mut_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_provider_t* z_shm_provider_move(z_owned_shm_provider_t* x) { return reinterpret_cast(x); } static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return reinterpret_cast(x); } -static inline z_moved_source_info_t* z_source_info_move(z_owned_source_info_t* x) { return reinterpret_cast(x); } static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return reinterpret_cast(x); } static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return reinterpret_cast(x); } static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return reinterpret_cast(x); } static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return reinterpret_cast(x); } static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return reinterpret_cast(x); } -static inline zc_moved_closure_matching_status_t* zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return reinterpret_cast(x); } -static inline zc_moved_matching_listener_t* zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return reinterpret_cast(x); } -static inline zc_moved_shm_client_list_t* zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return reinterpret_cast(x); } -static inline ze_moved_publication_cache_t* ze_publication_cache_move(ze_owned_publication_cache_t* x) { return reinterpret_cast(x); } -static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return reinterpret_cast(x); } static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x) { return reinterpret_cast(x); } -inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; inline const z_loaned_bytes_writer_t* z_loan(const z_owned_bytes_writer_t& this_) { return z_bytes_writer_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; @@ -572,9 +441,8 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; -inline const z_loaned_liveliness_token_t* z_loan(const z_owned_liveliness_token_t& this_) { return z_liveliness_token_loan(&this_); }; -inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; +inline const z_loaned_querier_t* z_loan(const z_owned_querier_t& this_) { return z_querier_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; inline const z_loaned_reply_err_t* z_loan(const z_owned_reply_err_t& this_) { return z_reply_err_loan(&this_); }; @@ -584,12 +452,7 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; -inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; -inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; -inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; -inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; -inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; @@ -597,10 +460,6 @@ inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; -inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; -inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; -inline const ze_loaned_publication_cache_t* z_loan(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_loan(&this_); }; -inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline const ze_loaned_serializer_t* z_loan(const ze_owned_serializer_t& this_) { return ze_serializer_loan(&this_); }; @@ -615,18 +474,14 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; +inline z_loaned_querier_t* z_loan_mut(z_owned_querier_t& this_) { return z_querier_loan_mut(&this_); }; inline z_loaned_session_t* z_loan_mut(z_owned_session_t& this_) { return z_session_loan_mut(&this_); }; -inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; -inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; -inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; inline ze_loaned_serializer_t* z_loan_mut(ze_owned_serializer_t& this_) { return ze_serializer_loan_mut(&this_); }; -inline void z_drop(z_moved_alloc_layout_t* this_) { z_alloc_layout_drop(this_); }; inline void z_drop(z_moved_bytes_t* this_) { z_bytes_drop(this_); }; inline void z_drop(z_moved_bytes_writer_t* this_) { z_bytes_writer_drop(this_); }; -inline void z_drop(z_moved_chunk_alloc_result_t* this_) { z_chunk_alloc_result_drop(this_); }; inline void z_drop(z_moved_closure_hello_t* this_) { z_closure_hello_drop(this_); }; inline void z_drop(z_moved_closure_query_t* closure_) { z_closure_query_drop(closure_); }; inline void z_drop(z_moved_closure_reply_t* closure_) { z_closure_reply_drop(closure_); }; @@ -640,10 +495,9 @@ inline void z_drop(z_moved_fifo_handler_reply_t* this_) { z_fifo_handler_reply_d inline void z_drop(z_moved_fifo_handler_sample_t* this_) { z_fifo_handler_sample_drop(this_); }; inline void z_drop(z_moved_hello_t* this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t* this_) { z_keyexpr_drop(this_); }; -inline void z_drop(z_moved_liveliness_token_t* this_) { z_liveliness_token_drop(this_); }; -inline void z_drop(z_moved_memory_layout_t* this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t* this_) { z_mutex_drop(this_); }; inline void z_drop(z_moved_publisher_t* this_) { z_publisher_drop(this_); }; +inline void z_drop(z_moved_querier_t* this_) { z_querier_drop(this_); }; inline void z_drop(z_moved_query_t* this_) { z_query_drop(this_); }; inline void z_drop(z_moved_queryable_t* this_) { z_queryable_drop(this_); }; inline void z_drop(z_moved_reply_t* this_) { z_reply_drop(this_); }; @@ -653,30 +507,17 @@ inline void z_drop(z_moved_ring_handler_reply_t* this_) { z_ring_handler_reply_d inline void z_drop(z_moved_ring_handler_sample_t* this_) { z_ring_handler_sample_drop(this_); }; inline void z_drop(z_moved_sample_t* this_) { z_sample_drop(this_); }; inline void z_drop(z_moved_session_t* this_) { z_session_drop(this_); }; -inline void z_drop(z_moved_shm_client_t* this_) { z_shm_client_drop(this_); }; -inline void z_drop(z_moved_shm_client_storage_t* this_) { z_shm_client_storage_drop(this_); }; -inline void z_drop(z_moved_shm_t* this_) { z_shm_drop(this_); }; -inline void z_drop(z_moved_shm_mut_t* this_) { z_shm_mut_drop(this_); }; -inline void z_drop(z_moved_shm_provider_t* this_) { z_shm_provider_drop(this_); }; inline void z_drop(z_moved_slice_t* this_) { z_slice_drop(this_); }; -inline void z_drop(z_moved_source_info_t* this_) { z_source_info_drop(this_); }; inline void z_drop(z_moved_string_array_t* this_) { z_string_array_drop(this_); }; inline void z_drop(z_moved_string_t* this_) { z_string_drop(this_); }; inline void z_drop(z_moved_subscriber_t* this_) { z_subscriber_drop(this_); }; inline void z_drop(z_moved_task_t* this_) { z_task_drop(this_); }; inline void z_drop(zc_moved_closure_log_t* closure_) { zc_closure_log_drop(closure_); }; -inline void z_drop(zc_moved_closure_matching_status_t* closure_) { zc_closure_matching_status_drop(closure_); }; -inline void z_drop(zc_moved_matching_listener_t* this_) { zc_publisher_matching_listener_drop(this_); }; -inline void z_drop(zc_moved_shm_client_list_t* this_) { zc_shm_client_list_drop(this_); }; -inline void z_drop(ze_moved_publication_cache_t* this_) { ze_publication_cache_drop(this_); }; -inline void z_drop(ze_moved_querying_subscriber_t* this_) { ze_querying_subscriber_drop(this_); }; inline void z_drop(ze_moved_serializer_t* this_) { ze_serializer_drop(this_); }; -inline z_moved_alloc_layout_t* z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t* z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; inline z_moved_bytes_writer_t* z_move(z_owned_bytes_writer_t& this_) { return z_bytes_writer_move(&this_); }; -inline z_moved_chunk_alloc_result_t* z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; inline z_moved_closure_hello_t* z_move(z_owned_closure_hello_t& this_) { return z_closure_hello_move(&this_); }; inline z_moved_closure_query_t* z_move(z_owned_closure_query_t& closure_) { return z_closure_query_move(&closure_); }; inline z_moved_closure_reply_t* z_move(z_owned_closure_reply_t& closure_) { return z_closure_reply_move(&closure_); }; @@ -690,10 +531,9 @@ inline z_moved_fifo_handler_reply_t* z_move(z_owned_fifo_handler_reply_t& this_) inline z_moved_fifo_handler_sample_t* z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; inline z_moved_hello_t* z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; inline z_moved_keyexpr_t* z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; -inline z_moved_liveliness_token_t* z_move(z_owned_liveliness_token_t& this_) { return z_liveliness_token_move(&this_); }; -inline z_moved_memory_layout_t* z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t* z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; inline z_moved_publisher_t* z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; +inline z_moved_querier_t* z_move(z_owned_querier_t& this_) { return z_querier_move(&this_); }; inline z_moved_query_t* z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; inline z_moved_queryable_t* z_move(z_owned_queryable_t& this_) { return z_queryable_move(&this_); }; inline z_moved_reply_t* z_move(z_owned_reply_t& this_) { return z_reply_move(&this_); }; @@ -703,30 +543,17 @@ inline z_moved_ring_handler_reply_t* z_move(z_owned_ring_handler_reply_t& this_) inline z_moved_ring_handler_sample_t* z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; inline z_moved_sample_t* z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; inline z_moved_session_t* z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; -inline z_moved_shm_client_t* z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; -inline z_moved_shm_client_storage_t* z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; -inline z_moved_shm_t* z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; -inline z_moved_shm_mut_t* z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; -inline z_moved_shm_provider_t* z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; inline z_moved_slice_t* z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; -inline z_moved_source_info_t* z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; inline z_moved_string_array_t* z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; inline z_moved_string_t* z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t* z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t* z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; inline zc_moved_closure_log_t* z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; -inline zc_moved_closure_matching_status_t* z_move(zc_owned_closure_matching_status_t& closure_) { return zc_closure_matching_status_move(&closure_); }; -inline zc_moved_matching_listener_t* z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; -inline zc_moved_shm_client_list_t* z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; -inline ze_moved_publication_cache_t* z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; -inline ze_moved_querying_subscriber_t* z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; inline ze_moved_serializer_t* z_move(ze_owned_serializer_t& this_) { return ze_serializer_move(&this_); }; -inline void z_internal_null(z_owned_alloc_layout_t* this_) { z_internal_alloc_layout_null(this_); }; inline void z_internal_null(z_owned_bytes_t* this_) { z_internal_bytes_null(this_); }; inline void z_internal_null(z_owned_bytes_writer_t* this_) { z_internal_bytes_writer_null(this_); }; -inline void z_internal_null(z_owned_chunk_alloc_result_t* this_) { z_internal_chunk_alloc_result_null(this_); }; inline void z_internal_null(z_owned_closure_hello_t* this_) { z_internal_closure_hello_null(this_); }; inline void z_internal_null(z_owned_closure_query_t* this_) { z_internal_closure_query_null(this_); }; inline void z_internal_null(z_owned_closure_reply_t* this_) { z_internal_closure_reply_null(this_); }; @@ -740,10 +567,9 @@ inline void z_internal_null(z_owned_fifo_handler_reply_t* this_) { z_internal_fi inline void z_internal_null(z_owned_fifo_handler_sample_t* this_) { z_internal_fifo_handler_sample_null(this_); }; inline void z_internal_null(z_owned_hello_t* this_) { z_internal_hello_null(this_); }; inline void z_internal_null(z_owned_keyexpr_t* this_) { z_internal_keyexpr_null(this_); }; -inline void z_internal_null(z_owned_liveliness_token_t* this_) { z_internal_liveliness_token_null(this_); }; -inline void z_internal_null(z_owned_memory_layout_t* this_) { z_internal_memory_layout_null(this_); }; inline void z_internal_null(z_owned_mutex_t* this_) { z_internal_mutex_null(this_); }; inline void z_internal_null(z_owned_publisher_t* this_) { z_internal_publisher_null(this_); }; +inline void z_internal_null(z_owned_querier_t* this_) { z_internal_querier_null(this_); }; inline void z_internal_null(z_owned_query_t* this_) { z_internal_query_null(this_); }; inline void z_internal_null(z_owned_queryable_t* this_) { z_internal_queryable_null(this_); }; inline void z_internal_null(z_owned_reply_err_t* this_) { z_internal_reply_err_null(this_); }; @@ -753,29 +579,16 @@ inline void z_internal_null(z_owned_ring_handler_reply_t* this_) { z_internal_ri inline void z_internal_null(z_owned_ring_handler_sample_t* this_) { z_internal_ring_handler_sample_null(this_); }; inline void z_internal_null(z_owned_sample_t* this_) { z_internal_sample_null(this_); }; inline void z_internal_null(z_owned_session_t* this_) { z_internal_session_null(this_); }; -inline void z_internal_null(z_owned_shm_client_t* this_) { z_internal_shm_client_null(this_); }; -inline void z_internal_null(z_owned_shm_client_storage_t* this_) { z_internal_shm_client_storage_null(this_); }; -inline void z_internal_null(z_owned_shm_mut_t* this_) { z_internal_shm_mut_null(this_); }; -inline void z_internal_null(z_owned_shm_t* this_) { z_internal_shm_null(this_); }; -inline void z_internal_null(z_owned_shm_provider_t* this_) { z_internal_shm_provider_null(this_); }; inline void z_internal_null(z_owned_slice_t* this_) { z_internal_slice_null(this_); }; -inline void z_internal_null(z_owned_source_info_t* this_) { z_internal_source_info_null(this_); }; inline void z_internal_null(z_owned_string_array_t* this_) { z_internal_string_array_null(this_); }; inline void z_internal_null(z_owned_string_t* this_) { z_internal_string_null(this_); }; inline void z_internal_null(z_owned_subscriber_t* this_) { z_internal_subscriber_null(this_); }; inline void z_internal_null(z_owned_task_t* this_) { z_internal_task_null(this_); }; inline void z_internal_null(zc_owned_closure_log_t* this_) { zc_internal_closure_log_null(this_); }; -inline void z_internal_null(zc_owned_closure_matching_status_t* this_) { zc_internal_closure_matching_status_null(this_); }; -inline void z_internal_null(zc_owned_matching_listener_t* this_) { zc_internal_matching_listener_null(this_); }; -inline void z_internal_null(zc_owned_shm_client_list_t* this_) { zc_internal_shm_client_list_null(this_); }; -inline void z_internal_null(ze_owned_publication_cache_t* this_) { ze_internal_publication_cache_null(this_); }; -inline void z_internal_null(ze_owned_querying_subscriber_t* this_) { ze_internal_querying_subscriber_null(this_); }; inline void z_internal_null(ze_owned_serializer_t* this_) { ze_internal_serializer_null(this_); }; -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { *this_ = x->_this; z_internal_alloc_layout_null(&x->_this); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_internal_bytes_null(&x->_this); } static inline void z_bytes_writer_take(z_owned_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { *this_ = x->_this; z_internal_bytes_writer_null(&x->_this); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { *this_ = x->_this; z_internal_chunk_alloc_result_null(&x->_this); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_internal_closure_hello_null(&x->_this); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_internal_closure_query_null(&x->_this); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_internal_closure_reply_null(&x->_this); } @@ -789,10 +602,9 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_internal_fifo_handler_sample_null(&x->_this); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_internal_hello_null(&x->_this); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } -static inline void z_liveliness_token_take(z_owned_liveliness_token_t* this_, z_moved_liveliness_token_t* x) { *this_ = x->_this; z_internal_liveliness_token_null(&x->_this); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { *this_ = x->_this; z_internal_memory_layout_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } +static inline void z_querier_take(z_owned_querier_t* this_, z_moved_querier_t* x) { *this_ = x->_this; z_internal_querier_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_internal_queryable_null(&x->_this); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_internal_reply_null(&x->_this); } @@ -802,39 +614,22 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_internal_ring_handler_sample_null(&x->_this); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_internal_sample_null(&x->_this); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_internal_session_null(&x->_this); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_internal_shm_client_null(&x->_this); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { *this_ = x->_this; z_internal_shm_client_storage_null(&x->_this); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t* x) { *this_ = x->_this; z_internal_shm_null(&x->_this); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { *this_ = x->_this; z_internal_shm_mut_null(&x->_this); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { *this_ = x->_this; z_internal_shm_provider_null(&x->_this); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_internal_slice_null(&x->_this); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { *this_ = x->_this; z_internal_source_info_null(&x->_this); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_internal_string_array_null(&x->_this); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_internal_string_null(&x->_this); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_internal_subscriber_null(&x->_this); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_internal_task_null(&x->_this); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_internal_closure_log_null(&x->_this); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { *closure_ = x->_this; zc_internal_closure_matching_status_null(&x->_this); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_internal_matching_listener_null(&x->_this); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { *this_ = x->_this; zc_internal_shm_client_list_null(&x->_this); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { *this_ = x->_this; ze_internal_publication_cache_null(&x->_this); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { *this_ = x->_this; ze_internal_querying_subscriber_null(&x->_this); } static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { *this_ = x->_this; ze_internal_serializer_null(&x->_this); } -inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { - z_alloc_layout_take(this_, x); -}; inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { z_bytes_take(this_, x); }; inline void z_take(z_owned_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { z_bytes_writer_take(this_, x); }; -inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { - z_chunk_alloc_result_take(this_, x); -}; inline void z_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { z_closure_hello_take(this_, x); }; @@ -874,18 +669,15 @@ inline void z_take(z_owned_hello_t* this_, z_moved_hello_t* x) { inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { z_keyexpr_take(this_, x); }; -inline void z_take(z_owned_liveliness_token_t* this_, z_moved_liveliness_token_t* x) { - z_liveliness_token_take(this_, x); -}; -inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { - z_memory_layout_take(this_, x); -}; inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { z_mutex_take(this_, x); }; inline void z_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { z_publisher_take(this_, x); }; +inline void z_take(z_owned_querier_t* this_, z_moved_querier_t* x) { + z_querier_take(this_, x); +}; inline void z_take(z_owned_query_t* this_, z_moved_query_t* x) { z_query_take(this_, x); }; @@ -913,27 +705,9 @@ inline void z_take(z_owned_sample_t* this_, z_moved_sample_t* x) { inline void z_take(z_owned_session_t* this_, z_moved_session_t* x) { z_session_take(this_, x); }; -inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { - z_shm_client_take(this_, x); -}; -inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { - z_shm_client_storage_take(this_, x); -}; -inline void z_take(z_owned_shm_t* this_, z_moved_shm_t* x) { - z_shm_take(this_, x); -}; -inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { - z_shm_mut_take(this_, x); -}; -inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { - z_shm_provider_take(this_, x); -}; inline void z_take(z_owned_slice_t* this_, z_moved_slice_t* x) { z_slice_take(this_, x); }; -inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { - z_source_info_take(this_, x); -}; inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { z_string_array_take(this_, x); }; @@ -949,30 +723,13 @@ inline void z_take(z_owned_task_t* this_, z_moved_task_t* x) { inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { zc_closure_log_take(closure_, x); }; -inline void z_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { - zc_closure_matching_status_take(closure_, x); -}; -inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { - zc_publisher_matching_listener_take(this_, x); -}; -inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { - zc_shm_client_list_take(this_, x); -}; -inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { - ze_publication_cache_take(this_, x); -}; -inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { - ze_querying_subscriber_take(this_, x); -}; inline void z_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { ze_serializer_take(this_, x); }; -inline bool z_internal_check(const z_owned_alloc_layout_t& this_) { return z_internal_alloc_layout_check(&this_); }; inline bool z_internal_check(const z_owned_bytes_t& this_) { return z_internal_bytes_check(&this_); }; inline bool z_internal_check(const z_owned_bytes_writer_t& this_) { return z_internal_bytes_writer_check(&this_); }; -inline bool z_internal_check(const z_owned_chunk_alloc_result_t& this_) { return z_internal_chunk_alloc_result_check(&this_); }; inline bool z_internal_check(const z_owned_closure_hello_t& this_) { return z_internal_closure_hello_check(&this_); }; inline bool z_internal_check(const z_owned_closure_query_t& this_) { return z_internal_closure_query_check(&this_); }; inline bool z_internal_check(const z_owned_closure_reply_t& this_) { return z_internal_closure_reply_check(&this_); }; @@ -986,10 +743,9 @@ inline bool z_internal_check(const z_owned_fifo_handler_reply_t& this_) { return inline bool z_internal_check(const z_owned_fifo_handler_sample_t& this_) { return z_internal_fifo_handler_sample_check(&this_); }; inline bool z_internal_check(const z_owned_hello_t& this_) { return z_internal_hello_check(&this_); }; inline bool z_internal_check(const z_owned_keyexpr_t& this_) { return z_internal_keyexpr_check(&this_); }; -inline bool z_internal_check(const z_owned_liveliness_token_t& this_) { return z_internal_liveliness_token_check(&this_); }; -inline bool z_internal_check(const z_owned_memory_layout_t& this_) { return z_internal_memory_layout_check(&this_); }; inline bool z_internal_check(const z_owned_mutex_t& this_) { return z_internal_mutex_check(&this_); }; inline bool z_internal_check(const z_owned_publisher_t& this_) { return z_internal_publisher_check(&this_); }; +inline bool z_internal_check(const z_owned_querier_t& this_) { return z_internal_querier_check(&this_); }; inline bool z_internal_check(const z_owned_query_t& query) { return z_internal_query_check(&query); }; inline bool z_internal_check(const z_owned_queryable_t& this_) { return z_internal_queryable_check(&this_); }; inline bool z_internal_check(const z_owned_reply_t& this_) { return z_internal_reply_check(&this_); }; @@ -999,23 +755,12 @@ inline bool z_internal_check(const z_owned_ring_handler_reply_t& this_) { return inline bool z_internal_check(const z_owned_ring_handler_sample_t& this_) { return z_internal_ring_handler_sample_check(&this_); }; inline bool z_internal_check(const z_owned_sample_t& this_) { return z_internal_sample_check(&this_); }; inline bool z_internal_check(const z_owned_session_t& this_) { return z_internal_session_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_t& this_) { return z_internal_shm_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_client_t& this_) { return z_internal_shm_client_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_client_storage_t& this_) { return z_internal_shm_client_storage_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_mut_t& this_) { return z_internal_shm_mut_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_provider_t& this_) { return z_internal_shm_provider_check(&this_); }; inline bool z_internal_check(const z_owned_slice_t& this_) { return z_internal_slice_check(&this_); }; -inline bool z_internal_check(const z_owned_source_info_t& this_) { return z_internal_source_info_check(&this_); }; inline bool z_internal_check(const z_owned_string_array_t& this_) { return z_internal_string_array_check(&this_); }; inline bool z_internal_check(const z_owned_string_t& this_) { return z_internal_string_check(&this_); }; inline bool z_internal_check(const z_owned_subscriber_t& this_) { return z_internal_subscriber_check(&this_); }; inline bool z_internal_check(const z_owned_task_t& this_) { return z_internal_task_check(&this_); }; inline bool z_internal_check(const zc_owned_closure_log_t& this_) { return zc_internal_closure_log_check(&this_); }; -inline bool z_internal_check(const zc_owned_closure_matching_status_t& this_) { return zc_internal_closure_matching_status_check(&this_); }; -inline bool z_internal_check(const zc_owned_matching_listener_t& this_) { return zc_internal_matching_listener_check(&this_); }; -inline bool z_internal_check(const zc_owned_shm_client_list_t& this_) { return zc_internal_shm_client_list_check(&this_); }; -inline bool z_internal_check(const ze_owned_publication_cache_t& this_) { return ze_internal_publication_cache_check(&this_); }; -inline bool z_internal_check(const ze_owned_querying_subscriber_t& this_) { return ze_internal_querying_subscriber_check(&this_); }; inline bool z_internal_check(const ze_owned_serializer_t& this_) { return ze_internal_serializer_check(&this_); }; @@ -1034,9 +779,6 @@ inline void z_call(const z_loaned_closure_sample_t* closure, z_loaned_sample_t* inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { z_closure_zid_call(closure, z_id); }; -inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { - zc_closure_matching_status_call(closure, mathing_status); -}; extern "C" using z_closure_drop_callback_t = void(void* context); extern "C" using z_closure_hello_callback_t = void(z_loaned_hello_t *hello, void *context); @@ -1045,7 +787,6 @@ extern "C" using z_closure_reply_callback_t = void(z_loaned_reply_t *reply, void extern "C" using z_closure_sample_callback_t = void(z_loaned_sample_t *sample, void *context); extern "C" using z_closure_zid_callback_t = void(const z_id_t *z_id, void *context); extern "C" using zc_closure_log_callback_t = void(zc_log_severity_t severity, const z_loaned_string_t *msg, void *context); -extern "C" using zc_closure_matching_status_callback_t = void(const zc_matching_status_t *matching_status, void *context); inline void z_closure(z_owned_closure_hello_t* this_, z_closure_hello_callback_t* call, z_closure_drop_callback_t* drop, void* context) { @@ -1071,10 +812,6 @@ inline void z_closure(zc_owned_closure_log_t* this_, zc_closure_log_callback_t* z_closure_drop_callback_t* drop, void* context) { zc_closure_log(this_, call, drop, context); }; -inline void z_closure(zc_owned_closure_matching_status_t* this_, zc_closure_matching_status_callback_t* call, - z_closure_drop_callback_t* drop, void* context) { - zc_closure_matching_status(this_, call, drop, context); -}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -1144,12 +881,6 @@ inline void z_clone(z_owned_reply_err_t* dst, z_loaned_reply_err_t* this_) { inline void z_clone(z_owned_sample_t* dst, z_loaned_sample_t* this_) { z_sample_clone(dst, this_); }; -inline void z_clone(z_owned_shm_client_storage_t* this_, z_loaned_shm_client_storage_t* from) { - z_shm_client_storage_clone(this_, from); -}; -inline void z_clone(z_owned_shm_t* out, z_loaned_shm_t* this_) { - z_shm_clone(out, this_); -}; inline void z_clone(z_owned_slice_t* dst, z_loaned_slice_t* this_) { z_slice_clone(dst, this_); }; @@ -1162,8 +893,6 @@ inline void z_clone(z_owned_string_t* dst, z_loaned_string_t* this_) { template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_writer_t type; }; @@ -1194,12 +923,10 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_liveliness_token_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_liveliness_token_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_querier_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_querier_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_query_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_queryable_t type; }; @@ -1218,18 +945,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; @@ -1238,14 +955,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef ze_owned_publication_cache_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_publication_cache_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef ze_owned_serializer_t type; }; template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_serializer_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; diff --git a/src/lib.rs b/src/lib.rs index 997e0c3cc..5edb0cc92 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,6 +41,8 @@ mod info; pub use crate::info::*; mod get; pub use crate::get::*; +mod querier; +pub use crate::querier::*; mod queryable; pub use crate::queryable::*; mod put; @@ -62,6 +64,10 @@ mod liveliness; #[cfg(feature = "unstable")] pub use liveliness::*; #[cfg(feature = "unstable")] +mod matching; +#[cfg(feature = "unstable")] +pub use matching::*; +#[cfg(feature = "unstable")] mod publication_cache; #[cfg(feature = "unstable")] pub use publication_cache::*; diff --git a/src/matching.rs b/src/matching.rs new file mode 100644 index 000000000..d66613ab6 --- /dev/null +++ b/src/matching.rs @@ -0,0 +1,58 @@ +// +// Copyright (c) 2017, 2024 ZettaScale Technology. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh team, +// + +use std::mem::MaybeUninit; + +use zenoh::matching::MatchingListener; + +pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_owned_matching_listener_t}; +use crate::transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}; +decl_c_type!( + owned(zc_owned_matching_listener_t, option MatchingListener<()>), +); + +#[no_mangle] +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Constructs an empty matching listener. +pub extern "C" fn zc_internal_matching_listener_null( + this_: &mut MaybeUninit, +) { + this_.as_rust_type_mut_uninit().write(None); +} + +#[no_mangle] +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Checks the matching listener is for the gravestone state +pub extern "C" fn zc_internal_matching_listener_check( + this_: &zc_owned_matching_listener_t, +) -> bool { + this_.as_rust_type_ref().is_some() +} + +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression or Queryables matching Queriers key expression and target. +#[repr(C)] +#[derive(Debug, Clone, Copy)] +pub struct zc_matching_status_t { + /// True if there exist matching Zenoh entities, false otherwise. + pub matching: bool, +} + +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Undeclares the given matching listener, droping and invalidating it. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn zc_matching_listener_drop(this: &mut zc_moved_matching_listener_t) { + std::mem::drop(this.take_rust_type()) +} diff --git a/src/publisher.rs b/src/publisher.rs index 70f8282a2..ce604593c 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -15,10 +15,7 @@ use std::mem::MaybeUninit; #[cfg(feature = "unstable")] -use zenoh::{ - handlers::Callback, - pubsub::{MatchingListener, MatchingStatus}, -}; +use zenoh::{handlers::Callback, matching::MatchingStatus}; use zenoh::{ pubsub::Publisher, qos::{CongestionControl, Priority}, @@ -26,8 +23,6 @@ use zenoh::{ Wait, }; -#[cfg(feature = "unstable")] -use crate::z_moved_source_info_t; #[cfg(feature = "unstable")] use crate::zc_moved_closure_matching_status_t; use crate::{ @@ -42,6 +37,8 @@ use crate::{ zc_closure_matching_status_call, zc_closure_matching_status_loan, zc_locality_default, zc_locality_t, }; +#[cfg(feature = "unstable")] +use crate::{z_moved_source_info_t, zc_matching_status_t, zc_owned_matching_listener_t}; /// Options passed to the `z_declare_publisher()` function. #[repr(C)] @@ -93,7 +90,7 @@ decl_c_type!( /// `z_publisher_put()` and `z_publisher_delete()` functions. /// /// @param session: The Zenoh session. -/// @param publisher: An unitilized location in memory where publisher will be constructed. +/// @param publisher: An uninitialized location in memory where publisher will be constructed. /// @param key_expr: The key expression to publish. /// @param options: Additional options for the publisher. /// @@ -309,54 +306,17 @@ pub extern "C" fn z_publisher_keyexpr(publisher: &z_loaned_publisher_t) -> &z_lo } #[cfg(feature = "unstable")] -pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_owned_matching_listener_t}; -#[cfg(feature = "unstable")] -decl_c_type!( - owned(zc_owned_matching_listener_t, option MatchingListener<()>), -); - -#[no_mangle] -#[cfg(feature = "unstable")] -/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. -/// @brief Constructs an empty matching listener. -pub extern "C" fn zc_internal_matching_listener_null( - this_: &mut MaybeUninit, -) { - this_.as_rust_type_mut_uninit().write(None); -} - -#[no_mangle] -#[cfg(feature = "unstable")] -/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. -/// @brief Checks the matching listener is for the gravestone state -pub extern "C" fn zc_internal_matching_listener_check( - this_: &zc_owned_matching_listener_t, -) -> bool { - this_.as_rust_type_ref().is_some() -} - -#[cfg(feature = "unstable")] -/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. -/// @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression. -#[repr(C)] -#[derive(Debug, Clone, Copy)] -pub struct zc_matching_status_t { - /// True if there exist Subscribers matching the Publisher's key expression, false otherwise. - pub matching: bool, -} - -#[cfg(feature = "unstable")] -fn _publisher_matching_listener_declare_inner<'a, 'b>( +fn _publisher_matching_listener_declare_inner<'a>( publisher: &'a z_loaned_publisher_t, callback: &mut zc_moved_closure_matching_status_t, -) -> zenoh::pubsub::MatchingListenerBuilder<'a, 'b, Callback> { +) -> zenoh::matching::MatchingListenerBuilder<'a, Callback> { let publisher = publisher.as_rust_type_ref(); let callback = callback.take_rust_type(); let listener = publisher .matching_listener() .callback_mut(move |matching_status| { let status = zc_matching_status_t { - matching: matching_status.matching_subscribers(), + matching: matching_status.matching(), }; zc_closure_matching_status_call(zc_closure_matching_status_loan(&callback), &status); }); @@ -368,8 +328,8 @@ fn _publisher_matching_listener_declare_inner<'a, 'b>( /// @brief Constructs matching listener, registering a callback for notifying subscribers matching with a given publisher. /// /// @param publisher: A publisher to associate with matching listener. -/// @param matching_listener: An unitilized memory location where matching listener will be constructed. The matching listener will be automatically dropped when publisher is dropped. -/// @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber, disconnects or when the first subscriber connects). +/// @param matching_listener: An uninitialized memory location where matching listener will be constructed. The matching listener's callback will be automatically dropped when the publisher is dropped. +/// @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber disconnects or when the first subscriber connects). /// /// @return 0 in case of success, negative error code otherwise. #[no_mangle] @@ -399,7 +359,7 @@ pub extern "C" fn zc_publisher_declare_matching_listener( /// The callback will be run in the background until the corresponding publisher is dropped. /// /// @param publisher: A publisher to associate with matching listener. -/// @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber, disconnects or when the first subscriber connects). +/// @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber disconnects or when the first subscriber connects). /// /// @return 0 in case of success, negative error code otherwise. #[no_mangle] @@ -417,15 +377,6 @@ pub extern "C" fn zc_publisher_declare_background_matching_listener( } } -#[cfg(feature = "unstable")] -/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. -/// @brief Undeclares the given matching listener, droping and invalidating it. -#[no_mangle] -#[allow(clippy::missing_safety_doc)] -pub extern "C" fn zc_publisher_matching_listener_drop(this: &mut zc_moved_matching_listener_t) { - std::mem::drop(this.take_rust_type()) -} - #[cfg(feature = "unstable")] /// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. /// @brief Gets publisher matching status - i.e. if there are any subscribers matching its key expression. @@ -440,7 +391,7 @@ pub extern "C" fn zc_publisher_get_matching_status( match this.as_rust_type_ref().matching_status().wait() { Ok(s) => { matching_status.write(zc_matching_status_t { - matching: s.matching_subscribers(), + matching: s.matching(), }); result::Z_OK } diff --git a/src/querier.rs b/src/querier.rs new file mode 100644 index 000000000..7b0a8fe5d --- /dev/null +++ b/src/querier.rs @@ -0,0 +1,401 @@ +// +// Copyright (c) 2017, 2024 ZettaScale Technology. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh team, +// + +use std::{ffi::CStr, mem::MaybeUninit}; + +use libc::c_char; +#[cfg(feature = "unstable")] +use zenoh::{handlers::Callback, matching::MatchingStatus}; +use zenoh::{ + qos::{CongestionControl, Priority}, + query::{Querier, QueryConsolidation, QueryTarget}, + session::SessionClosedError, + Wait, +}; + +use crate::{ + result, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, + z_closure_reply_call, z_closure_reply_loan, z_congestion_control_t, z_loaned_keyexpr_t, + z_loaned_querier_t, z_loaned_session_t, z_moved_bytes_t, z_moved_closure_reply_t, + z_moved_encoding_t, z_moved_querier_t, z_owned_querier_t, z_priority_t, + z_query_consolidation_t, z_query_target_t, +}; +#[cfg(feature = "unstable")] +use crate::{ + transmute::IntoCType, z_entity_global_id_t, z_moved_source_info_t, + zc_closure_matching_status_call, zc_closure_matching_status_loan, zc_locality_default, + zc_locality_t, zc_matching_status_t, zc_moved_closure_matching_status_t, + zc_owned_matching_listener_t, zc_reply_keyexpr_default, zc_reply_keyexpr_t, +}; + +/// Options passed to the `z_declare_querier()` function. +#[repr(C)] +pub struct z_querier_options_t { + /// The Queryables that should be target of the querier queries. + pub target: z_query_target_t, + /// The replies consolidation strategy to apply on replies to the querier queries. + pub consolidation: z_query_consolidation_t, + /// The congestion control to apply when routing the querier queries. + pub congestion_control: z_congestion_control_t, + /// If true, Zenoh will not wait to batch the querier queries with others to reduce the bandwith. + pub is_express: bool, + #[cfg(feature = "unstable")] + /// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + /// + /// The allowed destination for the querier queries. + pub allowed_destination: zc_locality_t, + #[cfg(feature = "unstable")] + /// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + /// + /// The accepted replies for the querier queries. + pub accept_replies: zc_reply_keyexpr_t, + /// The priority of the querier queries. + pub priority: z_priority_t, + /// The timeout for the querier queries in milliseconds. 0 means default query timeout from zenoh configuration. + pub timeout_ms: u64, +} + +/// Constructs the default value for `z_querier_options_t`. +#[no_mangle] +pub extern "C" fn z_querier_options_default(this_: &mut MaybeUninit) { + this_.write(z_querier_options_t { + target: QueryTarget::default().into(), + consolidation: QueryConsolidation::default().into(), + congestion_control: CongestionControl::default().into(), + priority: Priority::default().into(), + is_express: false, + #[cfg(feature = "unstable")] + allowed_destination: zc_locality_default(), + #[cfg(feature = "unstable")] + accept_replies: zc_reply_keyexpr_default(), + timeout_ms: 0, + }); +} + +decl_c_type!( + owned(z_owned_querier_t, option Querier<'static>), + loaned(z_loaned_querier_t), +); + +/// Constructs and declares a querier on the given key expression. +/// +/// The queries can be send with the help of the `z_querier_get()` function. +/// +/// @param session: The Zenoh session. +/// @param querier: An uninitialized location in memory where querier will be constructed. +/// @param key_expr: The key expression to send queries on. +/// @param options: Additional options for the querier. +/// +/// @return 0 in case of success, negative error code otherwise. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn z_declare_querier( + session: &z_loaned_session_t, + querier: &mut MaybeUninit, + key_expr: &z_loaned_keyexpr_t, + options: Option<&mut z_querier_options_t>, +) -> result::z_result_t { + let this = querier.as_rust_type_mut_uninit(); + let session = session.as_rust_type_ref(); + let key_expr = key_expr.as_rust_type_ref().clone().into_owned(); + let mut q = session.declare_querier(key_expr); + if let Some(options) = options { + q = q + .congestion_control(options.congestion_control.into()) + .priority(options.priority.into()) + .express(options.is_express) + .target(options.target.into()) + .consolidation(options.consolidation); + if options.timeout_ms != 0 { + q = q.timeout(std::time::Duration::from_millis(options.timeout_ms)); + } + #[cfg(feature = "unstable")] + { + q = q + .accept_replies(options.accept_replies.into()) + .allowed_destination(options.allowed_destination.into()); + } + } + match q.wait() { + Err(e) => { + tracing::error!("{}", e); + this.write(None); + result::Z_EGENERIC + } + Ok(querier) => { + this.write(Some(querier)); + result::Z_OK + } + } +} + +/// Constructs a querier in a gravestone state. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn z_internal_querier_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); +} + +/// Returns ``true`` if querier is valid, ``false`` otherwise. +#[allow(clippy::missing_safety_doc)] +#[no_mangle] +pub extern "C" fn z_internal_querier_check(this_: &z_owned_querier_t) -> bool { + this_.as_rust_type_ref().is_some() +} + +/// Borrows querier. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn z_querier_loan(this_: &z_owned_querier_t) -> &z_loaned_querier_t { + this_ + .as_rust_type_ref() + .as_ref() + .unwrap_unchecked() + .as_loaned_c_type_ref() +} + +/// Mutably borrows querier. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn z_querier_loan_mut( + this: &mut z_owned_querier_t, +) -> &mut z_loaned_querier_t { + this.as_rust_type_mut() + .as_mut() + .unwrap_unchecked() + .as_loaned_c_type_mut() +} + +/// Options passed to the `z_querier_get()` function. +#[repr(C)] +pub struct z_querier_get_options_t { + /// An optional payload to attach to the query. + pub payload: Option<&'static mut z_moved_bytes_t>, + /// An optional encoding of the query payload and or attachment. + pub encoding: Option<&'static mut z_moved_encoding_t>, + #[cfg(feature = "unstable")] + /// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + /// + /// The source info for the query. + pub source_info: Option<&'static mut z_moved_source_info_t>, + /// An optional attachment to attach to the query. + pub attachment: Option<&'static mut z_moved_bytes_t>, +} + +/// Constructs the default value for `z_querier_get_options_t`. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn z_querier_get_options_default(this: &mut MaybeUninit) { + this.write(z_querier_get_options_t { + payload: None, + encoding: None, + #[cfg(feature = "unstable")] + source_info: None, + attachment: None, + }); +} + +/// Query data from the matching queryables in the system. +/// Replies are provided through a callback function. +/// +/// @param querier: The querier to make query from. +/// @param parameters: The query's parameters, similar to a url's query segment. +/// @param callback: The callback function that will be called on reception of replies for this query. It will be automatically dropped once all replies are processed. +/// @param options: Additional options for the get. All owned fields will be consumed. +/// +/// @return 0 in case of success, a negative error value upon failure. +#[allow(clippy::missing_safety_doc)] +#[no_mangle] +pub unsafe extern "C" fn z_querier_get( + querier: &z_loaned_querier_t, + parameters: *const c_char, + callback: &mut z_moved_closure_reply_t, + options: Option<&mut z_querier_get_options_t>, +) -> result::z_result_t { + let querier = querier.as_rust_type_ref(); + let callback = callback.take_rust_type(); + let mut get = querier.get(); + if let Some(options) = options { + if let Some(payload) = options.payload.take() { + get = get.payload(payload.take_rust_type()); + } + if let Some(encoding) = options.encoding.take() { + get = get.encoding(encoding.take_rust_type()); + } + #[cfg(feature = "unstable")] + if let Some(source_info) = options.source_info.take() { + get = get.source_info(source_info.take_rust_type()); + } + if let Some(attachment) = options.attachment.take() { + get = get.attachment(attachment.take_rust_type()); + } + } + if !parameters.is_null() { + get = get.parameters(CStr::from_ptr(parameters).to_str().unwrap()); + } + match get + .callback(move |response| { + let mut owned_response = Some(response); + z_closure_reply_call( + z_closure_reply_loan(&callback), + owned_response + .as_mut() + .unwrap_unchecked() + .as_loaned_c_type_mut(), + ) + }) + .wait() + { + Ok(()) => result::Z_OK, + Err(e) if e.downcast_ref::().is_some() => result::Z_ESESSION_CLOSED, + Err(e) => { + tracing::error!("{}", e); + result::Z_EGENERIC + } + } +} + +#[cfg(feature = "unstable")] +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Returns the ID of the querier. +#[no_mangle] +pub extern "C" fn z_querier_id(querier: &z_loaned_querier_t) -> z_entity_global_id_t { + querier.as_rust_type_ref().id().into_c_type() +} + +/// Returns the key expression of the querier. +#[no_mangle] +pub extern "C" fn z_querier_keyexpr(querier: &z_loaned_querier_t) -> &z_loaned_keyexpr_t { + querier.as_rust_type_ref().key_expr().as_loaned_c_type_ref() +} + +#[cfg(feature = "unstable")] +fn _querier_matching_listener_declare_inner<'a>( + querier: &'a z_loaned_querier_t, + callback: &mut zc_moved_closure_matching_status_t, +) -> zenoh::matching::MatchingListenerBuilder<'a, Callback> { + let querier = querier.as_rust_type_ref(); + let callback = callback.take_rust_type(); + let listener = querier + .matching_listener() + .callback_mut(move |matching_status| { + let status = zc_matching_status_t { + matching: matching_status.matching(), + }; + zc_closure_matching_status_call(zc_closure_matching_status_loan(&callback), &status); + }); + listener +} + +#[cfg(feature = "unstable")] +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Constructs matching listener, registering a callback for notifying queryables matching with a given querier's key expression and target. +/// +/// @param querier: A querier to associate with matching listener. +/// @param matching_listener: An uninitialized memory location where matching listener will be constructed. The matching listener's callback will be automatically dropped when the querier is dropped. +/// @param callback: A closure that will be called every time the matching status of the querier changes (If last queryable disconnects or when the first queryable connects). +/// +/// @return 0 in case of success, negative error code otherwise. +#[no_mangle] +pub extern "C" fn zc_querier_declare_matching_listener( + querier: &'static z_loaned_querier_t, + matching_listener: &mut MaybeUninit, + callback: &mut zc_moved_closure_matching_status_t, +) -> result::z_result_t { + let this = matching_listener.as_rust_type_mut_uninit(); + let listener = _querier_matching_listener_declare_inner(querier, callback); + match listener.wait() { + Ok(listener) => { + this.write(Some(listener)); + result::Z_OK + } + Err(e) => { + this.write(None); + tracing::error!("{}", e); + result::Z_EGENERIC + } + } +} + +#[cfg(feature = "unstable")] +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Declares a matching listener, registering a callback for notifying queryables matching the given querier key expression and target. +/// The callback will be run in the background until the corresponding querier is dropped. +/// +/// @param querier: A querier to associate with matching listener. +/// @param callback: A closure that will be called every time the matching status of the querier changes (If last queryable disconnects or when the first queryable connects). +/// +/// @return 0 in case of success, negative error code otherwise. +#[no_mangle] +pub extern "C" fn zc_querier_declare_background_matching_listener( + querier: &'static z_loaned_querier_t, + callback: &mut zc_moved_closure_matching_status_t, +) -> result::z_result_t { + let listener = _querier_matching_listener_declare_inner(querier, callback); + match listener.background().wait() { + Ok(_) => result::Z_OK, + Err(e) => { + tracing::error!("{}", e); + result::Z_EGENERIC + } + } +} + +#[cfg(feature = "unstable")] +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Gets querier matching status - i.e. if there are any queryables matching its key expression and target. +/// +/// @return 0 in case of success, negative error code otherwise (in this case matching_status is not updated). +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn zc_querier_get_matching_status( + this: &'static z_loaned_querier_t, + matching_status: &mut MaybeUninit, +) -> result::z_result_t { + match this.as_rust_type_ref().matching_status().wait() { + Ok(s) => { + matching_status.write(zc_matching_status_t { + matching: s.matching(), + }); + result::Z_OK + } + Err(e) => { + tracing::error!("{}", e); + result::Z_ENETWORK + } + } +} + +/// Frees memory and resets querier to its gravestone state. +/// This is equivalent to calling `z_undeclare_querier()` and discarding its return value. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn z_querier_drop(this: &mut z_moved_querier_t) { + std::mem::drop(this.take_rust_type()) +} + +#[no_mangle] +/// @brief Undeclares the given querier. +/// +/// @return 0 in case of success, negative error code otherwise. +pub extern "C" fn z_undeclare_querier(this_: &mut z_moved_querier_t) -> result::z_result_t { + if let Some(p) = this_.take_rust_type() { + if let Err(e) = p.undeclare().wait() { + tracing::error!("{}", e); + return result::Z_ENETWORK; + } + } + result::Z_OK +} From 46c94261173887e4405430054a8610c3afa73f75 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Fri, 29 Nov 2024 10:59:12 +0100 Subject: [PATCH 02/12] fix z_get example --- examples/z_get.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/z_get.c b/examples/z_get.c index 76af1f654..b0956e0a6 100644 --- a/examples/z_get.c +++ b/examples/z_get.c @@ -37,7 +37,7 @@ int main(int argc, char** argv) { const char* ke = args.selector; size_t ke_len = strlen(ke); - const char* params = strchr(args.selector, "?"); + const char* params = strchr(args.selector, '?'); if (params != NULL) { ke_len = params - ke; params += 1; @@ -108,8 +108,8 @@ void print_help() { -s (optional, string, default='%s'): The selection of resources to query\n\ -p (optional, string): An optional value to put in the query\n\ -t (optional, BEST_MATCHING | ALL | ALL_COMPLETE): Query target\n\ - -o (optional, number, default = '%d'): Query timeout in milliseconds\n" DEFAULT_SELECTOR, - DEFAULT_TIMEOUT_MS); + -o (optional, number, default = '%d'): Query timeout in milliseconds\n", + DEFAULT_SELECTOR, DEFAULT_TIMEOUT_MS); printf(COMMON_HELP); printf( "\ From 2754b8a818a222533d81b680931509a8848db9eb Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Fri, 29 Nov 2024 11:21:00 +0100 Subject: [PATCH 03/12] docs update --- docs/api.rst | 61 +++++++++++++++++++++++++++++++++-------- include/zenoh_commons.h | 14 ---------- splitguide.yaml | 2 ++ 3 files changed, 52 insertions(+), 25 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 92b41c189..00d3315b6 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -532,6 +532,25 @@ Functions .. doxygenfunction:: z_closure_zid_call .. doxygenfunction:: z_closure_zid +Matching +======== + +Types +----- +.. doxygenstruct:: zc_owned_matching_listener_t +.. doxygenstruct:: zc_owned_closure_matching_status_t +.. doxygenstruct:: zc_matching_status_t + +Functions +--------- + +.. doxygenfunction:: zc_matching_listener_drop +.. doxygenfunction:: zc_closure_matching_status_drop +.. doxygenfunction:: zc_closure_matching_status_loan +.. doxygenfunction:: zc_closure_matching_status_call +.. doxygenfunction:: zc_closure_matching_status + + Publication =========== @@ -556,9 +575,6 @@ Types .. doxygenstruct:: z_publisher_delete_options_t :members: -.. doxygenstruct:: zc_owned_matching_listener_t -.. doxygenstruct:: zc_owned_closure_matching_status_t - Functions --------- .. doxygenfunction:: z_put @@ -582,17 +598,10 @@ Functions .. doxygenfunction:: z_reliability_default -.. doxygenfunction:: zc_closure_matching_status_drop -.. doxygenfunction:: zc_closure_matching_status_loan -.. doxygenfunction:: zc_closure_matching_status_call -.. doxygenfunction:: zc_closure_matching_status - .. doxygenfunction:: zc_publisher_get_matching_status .. doxygenfunction:: zc_publisher_declare_matching_listener .. doxygenfunction:: zc_publisher_declare_background_matching_listener -.. doxygenfunction:: zc_publisher_matching_listener_drop - Subscription ============ @@ -719,8 +728,12 @@ Functions Query ===== + Types ----- +.. doxygenstruct:: z_owned_querier_t +.. doxygenstruct:: z_loaned_querier_t + .. doxygenstruct:: z_owned_reply_t .. doxygenstruct:: z_loaned_reply_t @@ -731,12 +744,19 @@ Types :members: .. doxygenenum:: z_query_target_t .. doxygenenum:: z_consolidation_mode_t +.. doxygenenum:: zc_reply_keyexpr_t .. doxygenstruct:: z_query_consolidation_t +.. doxygenstruct:: z_querier_options_t + :members: +.. doxygenstruct:: z_querier_get_options_t + :members: + .. doxygenstruct:: z_owned_fifo_handler_reply_t .. doxygenstruct:: z_loaned_fifo_handler_reply_t .. doxygenstruct:: z_owned_ring_handler_reply_t .. doxygenstruct:: z_loaned_ring_handler_reply_t + Functions @@ -752,6 +772,26 @@ Functions .. doxygenfunction:: z_query_consolidation_latest .. doxygenfunction:: z_query_target_default +.. doxygenfunction:: z_declare_querier +.. doxygenfunction:: z_undeclare_querier +.. doxygenfunction:: z_querier_loan +.. doxygenfunction:: z_querier_drop +.. doxygenfunction:: z_declare_background_querier +.. doxygenfunction:: z_querier_id +.. doxygenfunction:: z_querier_keyexpr +.. doxygenfunction:: z_querier_get +.. doxygenfunction:: zc_querier_get_matching_status +.. doxygenfunction:: zc_querier_declare_matching_listener +.. doxygenfunction:: zc_querier_declare_background_matching_listener + +.. doxygenfunction:: z_querier_options_default +.. doxygenfunction:: z_querier_get_options_default + +.. doxygenfunction:: z_reply_loan +.. doxygenfunction:: z_reply_is_ok +.. doxygenfunction:: z_reply_ok +.. doxygenfunction:: z_reply_err + .. doxygenfunction:: z_reply_drop .. doxygenfunction:: z_reply_clone .. doxygenfunction:: z_reply_loan @@ -870,7 +910,6 @@ Types .. doxygenstruct:: ze_loaned_querying_subscriber_t .. doxygenstruct:: ze_querying_subscriber_options_t :members: -.. doxygenenum:: zc_reply_keyexpr_t Functions --------- diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index fb7eae956..d6dfc5672 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -586,14 +586,6 @@ typedef struct z_publisher_options_t { enum zc_locality_t allowed_destination; #endif } z_publisher_options_t; -/** - * An owned Zenoh querier. - * - * Sends queries to matching queryables. - */ -typedef struct ALIGN(8) z_owned_querier_t { - uint8_t _0[72]; -} z_owned_querier_t; /** * The replies consolidation strategy to apply on replies to a `z_get()`. */ @@ -892,12 +884,6 @@ typedef struct z_put_options_t { typedef struct z_moved_querier_t { struct z_owned_querier_t _this; } z_moved_querier_t; -/** - * A loaned Zenoh queryable. - */ -typedef struct ALIGN(8) z_loaned_querier_t { - uint8_t _0[72]; -} z_loaned_querier_t; /** * Options passed to the `z_querier_get()` function. */ diff --git a/splitguide.yaml b/splitguide.yaml index f8f2fe53a..eda6949f8 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -35,6 +35,8 @@ zenoh_opaque.h: - z_loaned_query_t! - z_owned_queryable_t! - z_loaned_queryable_t! + - z_owned_querier_t! + - z_loaned_querier_t! - ze_owned_querying_subscriber_t!#unstable - ze_loaned_querying_subscriber_t!#unstable - z_owned_keyexpr_t! From 7a3e6b62e132ded433f626981a69d0776d866263 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Fri, 29 Nov 2024 12:08:09 +0100 Subject: [PATCH 04/12] remove non-portable strcasecmp --- examples/parse_args.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/parse_args.h b/examples/parse_args.h index ca3002fe3..fb94214b5 100644 --- a/examples/parse_args.h +++ b/examples/parse_args.h @@ -216,11 +216,11 @@ void parse_zenoh_common_args(const int argc, char** argv, z_owned_config_t* conf } z_query_target_t parse_query_target(const char* arg) { - if (strcasecmp(arg, "BEST_MATCHING") == 0) { + if (strcmp(arg, "BEST_MATCHING") == 0) { return Z_QUERY_TARGET_BEST_MATCHING; - } else if (strcasecmp(arg, "ALL") == 0) { + } else if (strcmp(arg, "ALL") == 0) { return Z_QUERY_TARGET_ALL; - } else if (strcasecmp(arg, "ALL_COMPLETE") == 0) { + } else if (strcmp(arg, "ALL_COMPLETE") == 0) { return Z_QUERY_TARGET_ALL_COMPLETE; } else { printf("Unsupported query target value [%s]\n", arg); From 8897dc7cba7967ea4e8d8ce73d416bfb48ff08dc Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Fri, 29 Nov 2024 14:56:39 +0100 Subject: [PATCH 05/12] docs fix --- docs/api.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 00d3315b6..dacbf7dee 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -771,6 +771,7 @@ Functions .. doxygenfunction:: z_query_consolidation_monotonic .. doxygenfunction:: z_query_consolidation_latest .. doxygenfunction:: z_query_target_default +.. doxygenfunction:: zc_reply_keyexpr_default .. doxygenfunction:: z_declare_querier .. doxygenfunction:: z_undeclare_querier @@ -787,11 +788,6 @@ Functions .. doxygenfunction:: z_querier_options_default .. doxygenfunction:: z_querier_get_options_default -.. doxygenfunction:: z_reply_loan -.. doxygenfunction:: z_reply_is_ok -.. doxygenfunction:: z_reply_ok -.. doxygenfunction:: z_reply_err - .. doxygenfunction:: z_reply_drop .. doxygenfunction:: z_reply_clone .. doxygenfunction:: z_reply_loan @@ -922,7 +918,6 @@ Functions .. doxygenfunction:: ze_querying_subscriber_drop .. doxygenfunction:: ze_querying_subscriber_options_default -.. doxygenfunction:: zc_reply_keyexpr_default Logging ======= From 43b0b693cff91fd03c2421b6116595b03d9f7d9a Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Mon, 2 Dec 2024 11:53:38 +0100 Subject: [PATCH 06/12] cargo lock update --- Cargo.lock | 60 ++++++++++++------------- build-resources/opaque-types/Cargo.lock | 60 ++++++++++++------------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 132f41cfc..e41894ba4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3718,7 +3718,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "ahash", "async-trait", @@ -3765,7 +3765,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "zenoh-collections", ] @@ -3801,7 +3801,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "tracing", "uhlc", @@ -3813,12 +3813,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "json5", "num_cpus", @@ -3839,7 +3839,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "lazy_static", "tokio", @@ -3850,7 +3850,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "aes", "hmac", @@ -3863,7 +3863,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "bincode", "flume", @@ -3880,7 +3880,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3894,7 +3894,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3914,7 +3914,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "flume", @@ -3938,7 +3938,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "base64 0.22.1", @@ -3964,7 +3964,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "tokio", @@ -3982,7 +3982,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3999,7 +3999,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "base64 0.22.1", @@ -4028,7 +4028,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "socket2 0.5.7", @@ -4047,7 +4047,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "advisory-lock", "async-trait", @@ -4069,7 +4069,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "nix 0.29.0", @@ -4087,7 +4087,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "libc", @@ -4105,7 +4105,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "futures-util", @@ -4125,7 +4125,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "proc-macro2", "quote", @@ -4136,7 +4136,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "git-version", "libloading", @@ -4152,7 +4152,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "const_format", "rand", @@ -4166,7 +4166,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "anyhow", ] @@ -4174,7 +4174,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "lazy_static", "ron", @@ -4187,7 +4187,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "advisory-lock", "async-trait", @@ -4210,7 +4210,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "event-listener 5.3.1", "futures", @@ -4223,7 +4223,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "futures", "tokio", @@ -4236,7 +4236,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "crossbeam-utils", @@ -4270,7 +4270,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index bf29a3c5a..ed2a5f546 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -3110,7 +3110,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "ahash", "async-trait", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "zenoh-collections", ] @@ -3165,7 +3165,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "tracing", "uhlc", @@ -3177,12 +3177,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "json5", "num_cpus", @@ -3203,7 +3203,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "lazy_static", "tokio", @@ -3214,7 +3214,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "aes", "hmac", @@ -3227,7 +3227,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "bincode", "flume", @@ -3244,7 +3244,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "hashbrown", "keyed-set", @@ -3258,7 +3258,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3278,7 +3278,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "flume", @@ -3302,7 +3302,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "base64 0.22.1", @@ -3328,7 +3328,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "tokio", @@ -3346,7 +3346,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "socket2", @@ -3363,7 +3363,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "base64 0.22.1", @@ -3392,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "socket2", @@ -3411,7 +3411,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "advisory-lock", "async-trait", @@ -3433,7 +3433,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "nix 0.29.0", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "libc", @@ -3469,7 +3469,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "futures-util", @@ -3489,7 +3489,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "proc-macro2", "quote", @@ -3500,7 +3500,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "git-version", "libloading", @@ -3516,7 +3516,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "const_format", "rand", @@ -3530,7 +3530,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "anyhow", ] @@ -3538,7 +3538,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "lazy_static", "ron", @@ -3551,7 +3551,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "advisory-lock", "async-trait", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "event-listener", "futures", @@ -3587,7 +3587,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "futures", "tokio", @@ -3600,7 +3600,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "crossbeam-utils", @@ -3634,7 +3634,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#85f27ad62065cf4339586e36b2c30393cda25705" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" dependencies = [ "async-trait", "const_format", From 1a9583d44a0dc857eb6fc8323ebcaf829fa0bbd6 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Mon, 2 Dec 2024 11:56:11 +0100 Subject: [PATCH 07/12] add zc_undeclare_matching_listener --- docs/api.rst | 1 + include/zenoh_commons.h | 9 +++++++++ src/matching.rs | 24 ++++++++++++++++++++++-- src/querier.rs | 4 ++-- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index dacbf7dee..a955768c7 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -545,6 +545,7 @@ Functions --------- .. doxygenfunction:: zc_matching_listener_drop +.. doxygenfunction:: zc_matching_listener_undeclare .. doxygenfunction:: zc_closure_matching_status_drop .. doxygenfunction:: zc_closure_matching_status_loan .. doxygenfunction:: zc_closure_matching_status_call diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index d6dfc5672..6089e8709 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -5333,6 +5333,15 @@ void zc_stop_z_runtime(void); */ ZENOHC_API void zc_try_init_log_from_env(void); +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Undeclares the given matching listener, droping and invalidating it. + * @return 0 in case of success, negative error code otherwise. + */ +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +z_result_t zc_undeclare_matching_listener(zc_moved_matching_listener_t *this_); +#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Declares a background publication cache. It will function in background until the corresponding session is closed or dropped. diff --git a/src/matching.rs b/src/matching.rs index d66613ab6..7223d85bd 100644 --- a/src/matching.rs +++ b/src/matching.rs @@ -14,10 +14,13 @@ use std::mem::MaybeUninit; -use zenoh::matching::MatchingListener; +use zenoh::{matching::MatchingListener, Wait}; pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_owned_matching_listener_t}; -use crate::transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}; +use crate::{ + result, + transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}, +}; decl_c_type!( owned(zc_owned_matching_listener_t, option MatchingListener<()>), ); @@ -56,3 +59,20 @@ pub struct zc_matching_status_t { pub extern "C" fn zc_matching_listener_drop(this: &mut zc_moved_matching_listener_t) { std::mem::drop(this.take_rust_type()) } + +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Undeclares the given matching listener, droping and invalidating it. +/// @return 0 in case of success, negative error code otherwise. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn zc_undeclare_matching_listener( + this: &mut zc_moved_matching_listener_t, +) -> result::z_result_t { + if let Some(m) = this.take_rust_type() { + if let Err(e) = m.undeclare().wait() { + tracing::error!("{}", e); + return result::Z_ENETWORK; + } + } + result::Z_OK +} diff --git a/src/querier.rs b/src/querier.rs index 7b0a8fe5d..df4c0a287 100644 --- a/src/querier.rs +++ b/src/querier.rs @@ -391,8 +391,8 @@ pub extern "C" fn z_querier_drop(this: &mut z_moved_querier_t) { /// /// @return 0 in case of success, negative error code otherwise. pub extern "C" fn z_undeclare_querier(this_: &mut z_moved_querier_t) -> result::z_result_t { - if let Some(p) = this_.take_rust_type() { - if let Err(e) = p.undeclare().wait() { + if let Some(q) = this_.take_rust_type() { + if let Err(e) = q.undeclare().wait() { tracing::error!("{}", e); return result::Z_ENETWORK; } From f4e3eca22708c4db7bd6195a1c8951f9c47b9f04 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Mon, 2 Dec 2024 15:45:55 +0100 Subject: [PATCH 08/12] add --complete option to z_queryable_with_channels examples --- examples/z_queryable_with_channels.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/z_queryable_with_channels.c b/examples/z_queryable_with_channels.c index 9fcb220c9..44561d431 100644 --- a/examples/z_queryable_with_channels.c +++ b/examples/z_queryable_with_channels.c @@ -23,6 +23,7 @@ struct args_t { char* keyexpr; // -k char* value; // -v + bool complete; // --complete }; struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); @@ -52,7 +53,11 @@ int main(int argc, char** argv) { z_fifo_channel_query_new(&closure, &handler, 16); z_owned_queryable_t qable; - if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(closure), NULL) < 0) { + z_queryable_options_t opts; + z_queryable_options_default(&opts); + opts.complete = args.complete; + + if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(closure), &opts) < 0) { printf("Unable to create queryable.\n"); exit(-1); } @@ -102,7 +107,8 @@ void print_help() { Usage: z_queryable_with_channels [OPTIONS]\n\n\ Options:\n\ -k (optional, string, default='%s'): The key expression matching queries to reply to\n\ - -v (optional, string, default='%s'): The value to reply to queries with\n", + -v (optional, string, default='%s'): The value to reply to queries with\n\ + --complete (optional, flag to indicate whether queryable is complete or not)", DEFAULT_KEYEXPR, DEFAULT_VALUE); printf(COMMON_HELP); printf( @@ -123,6 +129,12 @@ struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { if (!value) { value = DEFAULT_VALUE; } + const char* complete_arg = parse_opt(argc, argv, "complete", false); + bool complete = false; + if (complete_arg) { + complete = true; + } + parse_zenoh_common_args(argc, argv, config); const char* arg = check_unknown_opts(argc, argv); if (arg) { @@ -136,5 +148,5 @@ struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { exit(-1); } free(pos_args); - return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value, .complete = complete}; } From 2a1511a7f4992a3b242ec61b4435306b4f5b6ac1 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Mon, 2 Dec 2024 17:57:20 +0100 Subject: [PATCH 09/12] move querier under unstable --- Cargo.lock | 60 ++++++------- build-resources/opaque-types/Cargo.lock | 60 ++++++------- build-resources/opaque-types/src/lib.rs | 6 +- examples/CMakeLists.txt | 1 + include/zenoh_commons.h | 112 +++++++++++++++++------- include/zenoh_macros.h | 22 ----- splitguide.yaml | 4 +- src/lib.rs | 2 + src/querier.rs | 40 ++++++--- 9 files changed, 173 insertions(+), 134 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e41894ba4..65ec8f8af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3718,7 +3718,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "ahash", "async-trait", @@ -3765,7 +3765,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "zenoh-collections", ] @@ -3801,7 +3801,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "tracing", "uhlc", @@ -3813,12 +3813,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "json5", "num_cpus", @@ -3839,7 +3839,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "lazy_static", "tokio", @@ -3850,7 +3850,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "aes", "hmac", @@ -3863,7 +3863,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "bincode", "flume", @@ -3880,7 +3880,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3894,7 +3894,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3914,7 +3914,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "flume", @@ -3938,7 +3938,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "base64 0.22.1", @@ -3964,7 +3964,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "tokio", @@ -3982,7 +3982,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3999,7 +3999,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "base64 0.22.1", @@ -4028,7 +4028,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "socket2 0.5.7", @@ -4047,7 +4047,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "advisory-lock", "async-trait", @@ -4069,7 +4069,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "nix 0.29.0", @@ -4087,7 +4087,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "libc", @@ -4105,7 +4105,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "futures-util", @@ -4125,7 +4125,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "proc-macro2", "quote", @@ -4136,7 +4136,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "git-version", "libloading", @@ -4152,7 +4152,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "const_format", "rand", @@ -4166,7 +4166,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "anyhow", ] @@ -4174,7 +4174,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "lazy_static", "ron", @@ -4187,7 +4187,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "advisory-lock", "async-trait", @@ -4210,7 +4210,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "event-listener 5.3.1", "futures", @@ -4223,7 +4223,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "futures", "tokio", @@ -4236,7 +4236,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "crossbeam-utils", @@ -4270,7 +4270,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index ed2a5f546..277a58850 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -3110,7 +3110,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "ahash", "async-trait", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "zenoh-collections", ] @@ -3165,7 +3165,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "tracing", "uhlc", @@ -3177,12 +3177,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "json5", "num_cpus", @@ -3203,7 +3203,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "lazy_static", "tokio", @@ -3214,7 +3214,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "aes", "hmac", @@ -3227,7 +3227,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "bincode", "flume", @@ -3244,7 +3244,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "hashbrown", "keyed-set", @@ -3258,7 +3258,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3278,7 +3278,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "flume", @@ -3302,7 +3302,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "base64 0.22.1", @@ -3328,7 +3328,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "tokio", @@ -3346,7 +3346,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "socket2", @@ -3363,7 +3363,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "base64 0.22.1", @@ -3392,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "socket2", @@ -3411,7 +3411,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "advisory-lock", "async-trait", @@ -3433,7 +3433,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "nix 0.29.0", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "libc", @@ -3469,7 +3469,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "futures-util", @@ -3489,7 +3489,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "proc-macro2", "quote", @@ -3500,7 +3500,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "git-version", "libloading", @@ -3516,7 +3516,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "const_format", "rand", @@ -3530,7 +3530,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "anyhow", ] @@ -3538,7 +3538,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "lazy_static", "ron", @@ -3551,7 +3551,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "advisory-lock", "async-trait", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "event-listener", "futures", @@ -3587,7 +3587,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "futures", "tokio", @@ -3600,7 +3600,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "crossbeam-utils", @@ -3634,7 +3634,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#488cca2d40ad4c223a2df1c148289c65116ffad2" +source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/src/lib.rs b/build-resources/opaque-types/src/lib.rs index 2a396f898..d41d0689c 100644 --- a/build-resources/opaque-types/src/lib.rs +++ b/build-resources/opaque-types/src/lib.rs @@ -14,7 +14,7 @@ use zenoh::{ handlers::{FifoChannelHandler, RingChannelHandler}, key_expr::KeyExpr, pubsub::{Publisher, Subscriber}, - query::{Querier, Query, Queryable, Reply, ReplyError}, + query::{Query, Queryable, Reply, ReplyError}, sample::Sample, scouting::Hello, session::{Session, ZenohId}, @@ -22,7 +22,7 @@ use zenoh::{ }; #[cfg(feature = "unstable")] use zenoh::{ - liveliness::LivelinessToken, matching::MatchingListener, sample::SourceInfo, + liveliness::LivelinessToken, matching::MatchingListener, query::Querier, sample::SourceInfo, session::EntityGlobalId, }; #[cfg(all(feature = "shared-memory", feature = "unstable"))] @@ -130,10 +130,12 @@ get_opaque_type_data!(Option>, z_owned_queryable_t); /// A loaned Zenoh queryable. get_opaque_type_data!(Queryable<()>, z_loaned_queryable_t); +#[cfg(feature = "unstable")] /// An owned Zenoh querier. /// /// Sends queries to matching queryables. get_opaque_type_data!(Option, z_owned_querier_t); +#[cfg(feature = "unstable")] /// A loaned Zenoh queryable. get_opaque_type_data!(Querier, z_loaned_querier_t); diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index db8f3a714..e687b3f82 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -27,6 +27,7 @@ foreach(file ${files}) (${target} MATCHES "^.*_liveliness.*$") OR (${target} MATCHES "^.*_pub_cache.*$") OR (${target} MATCHES "^.*_query_sub.*$") + OR (${target} MATCHES "^.*_querier.*$") ) continue() endif() diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 6089e8709..1747fa7dc 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -593,8 +593,10 @@ typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; /** - * Options passed to the `z_declare_querier()` function. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Options passed to the `z_declare_querier()` function. */ +#if defined(Z_FEATURE_UNSTABLE_API) typedef struct z_querier_options_t { /** * The Queryables that should be target of the querier queries. @@ -637,6 +639,7 @@ typedef struct z_querier_options_t { */ uint64_t timeout_ms; } z_querier_options_t; +#endif /** * Options passed to the `z_delete()` function. */ @@ -881,12 +884,11 @@ typedef struct z_put_options_t { */ struct z_moved_bytes_t *attachment; } z_put_options_t; -typedef struct z_moved_querier_t { - struct z_owned_querier_t _this; -} z_moved_querier_t; /** - * Options passed to the `z_querier_get()` function. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Options passed to the `z_querier_get()` function. */ +#if defined(Z_FEATURE_UNSTABLE_API) typedef struct z_querier_get_options_t { /** * An optional payload to attach to the query. @@ -909,6 +911,7 @@ typedef struct z_querier_get_options_t { */ struct z_moved_bytes_t *attachment; } z_querier_get_options_t; +#endif typedef struct z_moved_query_t { struct z_owned_query_t _this; } z_moved_query_t; @@ -2036,7 +2039,8 @@ z_result_t z_declare_publisher(const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct z_publisher_options_t *options); /** - * Constructs and declares a querier on the given key expression. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Constructs and declares a querier on the given key expression. * * The queries can be send with the help of the `z_querier_get()` function. * @@ -2047,11 +2051,13 @@ z_result_t z_declare_publisher(const struct z_loaned_session_t *session, * * @return 0 in case of success, negative error code otherwise. */ +#if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t z_declare_querier(const struct z_loaned_session_t *session, - struct z_owned_querier_t *querier, + z_owned_querier_t *querier, const struct z_loaned_keyexpr_t *key_expr, struct z_querier_options_t *options); +#endif /** * Constructs a Queryable for the given key expression. * @@ -2902,13 +2908,21 @@ ZENOHC_API bool z_internal_publisher_check(const struct z_owned_publisher_t *thi */ ZENOHC_API void z_internal_publisher_null(struct z_owned_publisher_t *this_); /** - * Returns ``true`` if querier is valid, ``false`` otherwise. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Returns ``true`` if querier is valid, ``false`` otherwise. */ -ZENOHC_API bool z_internal_querier_check(const struct z_owned_querier_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +bool z_internal_querier_check(const z_owned_querier_t *this_); +#endif /** - * Constructs a querier in a gravestone state. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Constructs a querier in a gravestone state. */ -ZENOHC_API void z_internal_querier_null(struct z_owned_querier_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +void z_internal_querier_null(z_owned_querier_t *this_); +#endif /** * Returns `false` if `this` is in a gravestone state, `true` otherwise. */ @@ -3554,12 +3568,17 @@ z_result_t z_put(const struct z_loaned_session_t *session, */ ZENOHC_API void z_put_options_default(struct z_put_options_t *this_); /** - * Frees memory and resets querier to its gravestone state. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Frees memory and resets querier to its gravestone state. * This is equivalent to calling `z_undeclare_querier()` and discarding its return value. */ -ZENOHC_API void z_querier_drop(struct z_moved_querier_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +void z_querier_drop(z_moved_querier_t *this_); +#endif /** - * Query data from the matching queryables in the system. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Query data from the matching queryables in the system. * Replies are provided through a callback function. * * @param querier: The querier to make query from. @@ -3569,40 +3588,61 @@ ZENOHC_API void z_querier_drop(struct z_moved_querier_t *this_); * * @return 0 in case of success, a negative error value upon failure. */ +#if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t z_querier_get(const struct z_loaned_querier_t *querier, +z_result_t z_querier_get(const z_loaned_querier_t *querier, const char *parameters, struct z_moved_closure_reply_t *callback, struct z_querier_get_options_t *options); +#endif /** - * Constructs the default value for `z_querier_get_options_t`. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Constructs the default value for `z_querier_get_options_t`. */ -ZENOHC_API void z_querier_get_options_default(struct z_querier_get_options_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +void z_querier_get_options_default(struct z_querier_get_options_t *this_); +#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Returns the ID of the querier. */ -#if defined(Z_FEATURE_UNSTABLE_API) +#if (defined(Z_FEATURE_UNSTABLE_API) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_entity_global_id_t z_querier_id(const struct z_loaned_querier_t *querier); +z_entity_global_id_t z_querier_id(const z_loaned_querier_t *querier); #endif /** - * Returns the key expression of the querier. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Returns the key expression of the querier. */ +#if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_keyexpr_t *z_querier_keyexpr(const struct z_loaned_querier_t *querier); +const struct z_loaned_keyexpr_t *z_querier_keyexpr(const z_loaned_querier_t *querier); +#endif /** - * Borrows querier. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Borrows querier. */ -ZENOHC_API const struct z_loaned_querier_t *z_querier_loan(const struct z_owned_querier_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +const z_loaned_querier_t *z_querier_loan(const z_owned_querier_t *this_); +#endif /** - * Mutably borrows querier. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Mutably borrows querier. */ -ZENOHC_API struct z_loaned_querier_t *z_querier_loan_mut(struct z_owned_querier_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +z_loaned_querier_t *z_querier_loan_mut(z_owned_querier_t *this_); +#endif /** - * Constructs the default value for `z_querier_options_t`. + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Constructs the default value for `z_querier_options_t`. */ -ZENOHC_API void z_querier_options_default(struct z_querier_options_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +void z_querier_options_default(struct z_querier_options_t *this_); +#endif /** * Gets query attachment. * @@ -4738,11 +4778,15 @@ z_result_t z_undeclare_keyexpr(const struct z_loaned_session_t *session, */ ZENOHC_API z_result_t z_undeclare_publisher(struct z_moved_publisher_t *this_); /** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Undeclares the given querier. * * @return 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_querier(struct z_moved_querier_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +z_result_t z_undeclare_querier(z_moved_querier_t *this_); +#endif /** * Undeclares a `z_owned_queryable_t`. * Returns 0 in case of success, negative error code otherwise. @@ -5234,9 +5278,9 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t * * @return 0 in case of success, negative error code otherwise. */ -#if defined(Z_FEATURE_UNSTABLE_API) +#if (defined(Z_FEATURE_UNSTABLE_API) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_querier_declare_background_matching_listener(const struct z_loaned_querier_t *querier, +z_result_t zc_querier_declare_background_matching_listener(const z_loaned_querier_t *querier, struct zc_moved_closure_matching_status_t *callback); #endif /** @@ -5249,9 +5293,9 @@ z_result_t zc_querier_declare_background_matching_listener(const struct z_loaned * * @return 0 in case of success, negative error code otherwise. */ -#if defined(Z_FEATURE_UNSTABLE_API) +#if (defined(Z_FEATURE_UNSTABLE_API) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_querier_declare_matching_listener(const struct z_loaned_querier_t *querier, +z_result_t zc_querier_declare_matching_listener(const z_loaned_querier_t *querier, zc_owned_matching_listener_t *matching_listener, struct zc_moved_closure_matching_status_t *callback); #endif @@ -5261,9 +5305,9 @@ z_result_t zc_querier_declare_matching_listener(const struct z_loaned_querier_t * * @return 0 in case of success, negative error code otherwise (in this case matching_status is not updated). */ -#if defined(Z_FEATURE_UNSTABLE_API) +#if (defined(Z_FEATURE_UNSTABLE_API) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_querier_get_matching_status(const struct z_loaned_querier_t *this_, +z_result_t zc_querier_get_matching_status(const z_loaned_querier_t *this_, struct zc_matching_status_t *matching_status); #endif /** diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 9dda86b8b..e03ca9db1 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -21,7 +21,6 @@ static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return (z_move static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t*)(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t*)(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t*)(x); } -static inline z_moved_querier_t* z_querier_move(z_owned_querier_t* x) { return (z_moved_querier_t*)(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return (z_moved_query_t*)(x); } static inline z_moved_queryable_t* z_queryable_move(z_owned_queryable_t* x) { return (z_moved_queryable_t*)(x); } static inline z_moved_reply_t* z_reply_move(z_owned_reply_t* x) { return (z_moved_reply_t*)(x); } @@ -58,7 +57,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ z_owned_publisher_t : z_publisher_loan, \ - z_owned_querier_t : z_querier_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ z_owned_reply_err_t : z_reply_err_loan, \ @@ -92,7 +90,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_querier_t : z_querier_loan_mut, \ z_owned_session_t : z_session_loan_mut, \ z_owned_string_array_t : z_string_array_loan_mut, \ ze_owned_serializer_t : ze_serializer_loan_mut \ @@ -117,7 +114,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_moved_keyexpr_t* : z_keyexpr_drop, \ z_moved_mutex_t* : z_mutex_drop, \ z_moved_publisher_t* : z_publisher_drop, \ - z_moved_querier_t* : z_querier_drop, \ z_moved_query_t* : z_query_drop, \ z_moved_queryable_t* : z_queryable_drop, \ z_moved_reply_t* : z_reply_drop, \ @@ -155,7 +151,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_keyexpr_t : z_keyexpr_move, \ z_owned_mutex_t : z_mutex_move, \ z_owned_publisher_t : z_publisher_move, \ - z_owned_querier_t : z_querier_move, \ z_owned_query_t : z_query_move, \ z_owned_queryable_t : z_queryable_move, \ z_owned_reply_t : z_reply_move, \ @@ -193,7 +188,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_keyexpr_t* : z_internal_keyexpr_null, \ z_owned_mutex_t* : z_internal_mutex_null, \ z_owned_publisher_t* : z_internal_publisher_null, \ - z_owned_querier_t* : z_internal_querier_null, \ z_owned_query_t* : z_internal_query_null, \ z_owned_queryable_t* : z_internal_queryable_null, \ z_owned_reply_err_t* : z_internal_reply_err_null, \ @@ -229,7 +223,6 @@ static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *t static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } -static inline void z_querier_take(z_owned_querier_t* this_, z_moved_querier_t* x) { *this_ = x->_this; z_internal_querier_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_internal_queryable_null(&x->_this); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_internal_reply_null(&x->_this); } @@ -267,7 +260,6 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_keyexpr_t* : z_keyexpr_take, \ z_owned_mutex_t* : z_mutex_take, \ z_owned_publisher_t* : z_publisher_take, \ - z_owned_querier_t* : z_querier_take, \ z_owned_query_t* : z_query_take, \ z_owned_queryable_t* : z_queryable_take, \ z_owned_reply_t* : z_reply_take, \ @@ -305,7 +297,6 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_keyexpr_t : z_internal_keyexpr_check, \ z_owned_mutex_t : z_internal_mutex_check, \ z_owned_publisher_t : z_internal_publisher_check, \ - z_owned_querier_t : z_internal_querier_check, \ z_owned_query_t : z_internal_query_check, \ z_owned_queryable_t : z_internal_queryable_check, \ z_owned_reply_t : z_internal_reply_check, \ @@ -406,7 +397,6 @@ static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return reinter static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return reinterpret_cast(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return reinterpret_cast(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return reinterpret_cast(x); } -static inline z_moved_querier_t* z_querier_move(z_owned_querier_t* x) { return reinterpret_cast(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return reinterpret_cast(x); } static inline z_moved_queryable_t* z_queryable_move(z_owned_queryable_t* x) { return reinterpret_cast(x); } static inline z_moved_reply_t* z_reply_move(z_owned_reply_t* x) { return reinterpret_cast(x); } @@ -442,7 +432,6 @@ inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_s inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; -inline const z_loaned_querier_t* z_loan(const z_owned_querier_t& this_) { return z_querier_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; inline const z_loaned_reply_err_t* z_loan(const z_owned_reply_err_t& this_) { return z_reply_err_loan(&this_); }; @@ -474,7 +463,6 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; -inline z_loaned_querier_t* z_loan_mut(z_owned_querier_t& this_) { return z_querier_loan_mut(&this_); }; inline z_loaned_session_t* z_loan_mut(z_owned_session_t& this_) { return z_session_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; inline ze_loaned_serializer_t* z_loan_mut(ze_owned_serializer_t& this_) { return ze_serializer_loan_mut(&this_); }; @@ -497,7 +485,6 @@ inline void z_drop(z_moved_hello_t* this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t* this_) { z_keyexpr_drop(this_); }; inline void z_drop(z_moved_mutex_t* this_) { z_mutex_drop(this_); }; inline void z_drop(z_moved_publisher_t* this_) { z_publisher_drop(this_); }; -inline void z_drop(z_moved_querier_t* this_) { z_querier_drop(this_); }; inline void z_drop(z_moved_query_t* this_) { z_query_drop(this_); }; inline void z_drop(z_moved_queryable_t* this_) { z_queryable_drop(this_); }; inline void z_drop(z_moved_reply_t* this_) { z_reply_drop(this_); }; @@ -533,7 +520,6 @@ inline z_moved_hello_t* z_move(z_owned_hello_t& this_) { return z_hello_move(&th inline z_moved_keyexpr_t* z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; inline z_moved_mutex_t* z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; inline z_moved_publisher_t* z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; -inline z_moved_querier_t* z_move(z_owned_querier_t& this_) { return z_querier_move(&this_); }; inline z_moved_query_t* z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; inline z_moved_queryable_t* z_move(z_owned_queryable_t& this_) { return z_queryable_move(&this_); }; inline z_moved_reply_t* z_move(z_owned_reply_t& this_) { return z_reply_move(&this_); }; @@ -569,7 +555,6 @@ inline void z_internal_null(z_owned_hello_t* this_) { z_internal_hello_null(this inline void z_internal_null(z_owned_keyexpr_t* this_) { z_internal_keyexpr_null(this_); }; inline void z_internal_null(z_owned_mutex_t* this_) { z_internal_mutex_null(this_); }; inline void z_internal_null(z_owned_publisher_t* this_) { z_internal_publisher_null(this_); }; -inline void z_internal_null(z_owned_querier_t* this_) { z_internal_querier_null(this_); }; inline void z_internal_null(z_owned_query_t* this_) { z_internal_query_null(this_); }; inline void z_internal_null(z_owned_queryable_t* this_) { z_internal_queryable_null(this_); }; inline void z_internal_null(z_owned_reply_err_t* this_) { z_internal_reply_err_null(this_); }; @@ -604,7 +589,6 @@ static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *t static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } -static inline void z_querier_take(z_owned_querier_t* this_, z_moved_querier_t* x) { *this_ = x->_this; z_internal_querier_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_internal_queryable_null(&x->_this); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_internal_reply_null(&x->_this); } @@ -675,9 +659,6 @@ inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { inline void z_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { z_publisher_take(this_, x); }; -inline void z_take(z_owned_querier_t* this_, z_moved_querier_t* x) { - z_querier_take(this_, x); -}; inline void z_take(z_owned_query_t* this_, z_moved_query_t* x) { z_query_take(this_, x); }; @@ -745,7 +726,6 @@ inline bool z_internal_check(const z_owned_hello_t& this_) { return z_internal_h inline bool z_internal_check(const z_owned_keyexpr_t& this_) { return z_internal_keyexpr_check(&this_); }; inline bool z_internal_check(const z_owned_mutex_t& this_) { return z_internal_mutex_check(&this_); }; inline bool z_internal_check(const z_owned_publisher_t& this_) { return z_internal_publisher_check(&this_); }; -inline bool z_internal_check(const z_owned_querier_t& this_) { return z_internal_querier_check(&this_); }; inline bool z_internal_check(const z_owned_query_t& query) { return z_internal_query_check(&query); }; inline bool z_internal_check(const z_owned_queryable_t& this_) { return z_internal_queryable_check(&this_); }; inline bool z_internal_check(const z_owned_reply_t& this_) { return z_internal_reply_check(&this_); }; @@ -925,8 +905,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_querier_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_querier_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_query_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_queryable_t type; }; diff --git a/splitguide.yaml b/splitguide.yaml index eda6949f8..55783677a 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -35,8 +35,8 @@ zenoh_opaque.h: - z_loaned_query_t! - z_owned_queryable_t! - z_loaned_queryable_t! - - z_owned_querier_t! - - z_loaned_querier_t! + - z_owned_querier_t!#unstable + - z_loaned_querier_t!#unstable - ze_owned_querying_subscriber_t!#unstable - ze_loaned_querying_subscriber_t!#unstable - z_owned_keyexpr_t! diff --git a/src/lib.rs b/src/lib.rs index 5edb0cc92..17740aa4a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,7 +41,9 @@ mod info; pub use crate::info::*; mod get; pub use crate::get::*; +#[cfg(feature = "unstable")] mod querier; +#[cfg(feature = "unstable")] pub use crate::querier::*; mod queryable; pub use crate::queryable::*; diff --git a/src/querier.rs b/src/querier.rs index df4c0a287..785721566 100644 --- a/src/querier.rs +++ b/src/querier.rs @@ -40,7 +40,8 @@ use crate::{ zc_owned_matching_listener_t, zc_reply_keyexpr_default, zc_reply_keyexpr_t, }; -/// Options passed to the `z_declare_querier()` function. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Options passed to the `z_declare_querier()` function. #[repr(C)] pub struct z_querier_options_t { /// The Queryables that should be target of the querier queries. @@ -67,7 +68,8 @@ pub struct z_querier_options_t { pub timeout_ms: u64, } -/// Constructs the default value for `z_querier_options_t`. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Constructs the default value for `z_querier_options_t`. #[no_mangle] pub extern "C" fn z_querier_options_default(this_: &mut MaybeUninit) { this_.write(z_querier_options_t { @@ -89,7 +91,8 @@ decl_c_type!( loaned(z_loaned_querier_t), ); -/// Constructs and declares a querier on the given key expression. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Constructs and declares a querier on the given key expression. /// /// The queries can be send with the help of the `z_querier_get()` function. /// @@ -141,21 +144,24 @@ pub extern "C" fn z_declare_querier( } } -/// Constructs a querier in a gravestone state. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Constructs a querier in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] pub extern "C" fn z_internal_querier_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } -/// Returns ``true`` if querier is valid, ``false`` otherwise. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Returns ``true`` if querier is valid, ``false`` otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] pub extern "C" fn z_internal_querier_check(this_: &z_owned_querier_t) -> bool { this_.as_rust_type_ref().is_some() } -/// Borrows querier. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Borrows querier. #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_querier_loan(this_: &z_owned_querier_t) -> &z_loaned_querier_t { @@ -166,7 +172,8 @@ pub unsafe extern "C" fn z_querier_loan(this_: &z_owned_querier_t) -> &z_loaned_ .as_loaned_c_type_ref() } -/// Mutably borrows querier. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Mutably borrows querier. #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_querier_loan_mut( @@ -178,7 +185,8 @@ pub unsafe extern "C" fn z_querier_loan_mut( .as_loaned_c_type_mut() } -/// Options passed to the `z_querier_get()` function. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Options passed to the `z_querier_get()` function. #[repr(C)] pub struct z_querier_get_options_t { /// An optional payload to attach to the query. @@ -194,7 +202,8 @@ pub struct z_querier_get_options_t { pub attachment: Option<&'static mut z_moved_bytes_t>, } -/// Constructs the default value for `z_querier_get_options_t`. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Constructs the default value for `z_querier_get_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] pub extern "C" fn z_querier_get_options_default(this: &mut MaybeUninit) { @@ -207,7 +216,8 @@ pub extern "C" fn z_querier_get_options_default(this: &mut MaybeUninit z_entity_global_ querier.as_rust_type_ref().id().into_c_type() } -/// Returns the key expression of the querier. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Returns the key expression of the querier. #[no_mangle] pub extern "C" fn z_querier_keyexpr(querier: &z_loaned_querier_t) -> &z_loaned_keyexpr_t { querier.as_rust_type_ref().key_expr().as_loaned_c_type_ref() @@ -377,8 +388,8 @@ pub extern "C" fn zc_querier_get_matching_status( } } } - -/// Frees memory and resets querier to its gravestone state. +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. +/// @brief Frees memory and resets querier to its gravestone state. /// This is equivalent to calling `z_undeclare_querier()` and discarding its return value. #[no_mangle] #[allow(clippy::missing_safety_doc)] @@ -386,10 +397,11 @@ pub extern "C" fn z_querier_drop(this: &mut z_moved_querier_t) { std::mem::drop(this.take_rust_type()) } -#[no_mangle] +/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. /// @brief Undeclares the given querier. /// /// @return 0 in case of success, negative error code otherwise. +#[no_mangle] pub extern "C" fn z_undeclare_querier(this_: &mut z_moved_querier_t) -> result::z_result_t { if let Some(q) = this_.take_rust_type() { if let Err(e) = q.undeclare().wait() { From 07756c25a523eb36276fe6354ed2bb17d6a13d3e Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Tue, 3 Dec 2024 10:37:08 +0100 Subject: [PATCH 10/12] switch branch to zenoh/main --- Cargo.lock | 60 ++++++++++++------------- Cargo.toml | 8 ++-- build-resources/opaque-types/Cargo.lock | 60 ++++++++++++------------- build-resources/opaque-types/Cargo.toml | 6 +-- 4 files changed, 67 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 65ec8f8af..ffbb7a4ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3718,7 +3718,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "ahash", "async-trait", @@ -3765,7 +3765,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "zenoh-collections", ] @@ -3801,7 +3801,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "tracing", "uhlc", @@ -3813,12 +3813,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "json5", "num_cpus", @@ -3839,7 +3839,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "lazy_static", "tokio", @@ -3850,7 +3850,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "aes", "hmac", @@ -3863,7 +3863,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "bincode", "flume", @@ -3880,7 +3880,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3894,7 +3894,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3914,7 +3914,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "flume", @@ -3938,7 +3938,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "base64 0.22.1", @@ -3964,7 +3964,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "tokio", @@ -3982,7 +3982,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3999,7 +3999,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "base64 0.22.1", @@ -4028,7 +4028,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "socket2 0.5.7", @@ -4047,7 +4047,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "advisory-lock", "async-trait", @@ -4069,7 +4069,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "nix 0.29.0", @@ -4087,7 +4087,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "libc", @@ -4105,7 +4105,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "futures-util", @@ -4125,7 +4125,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "proc-macro2", "quote", @@ -4136,7 +4136,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "git-version", "libloading", @@ -4152,7 +4152,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "const_format", "rand", @@ -4166,7 +4166,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "anyhow", ] @@ -4174,7 +4174,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "lazy_static", "ron", @@ -4187,7 +4187,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "advisory-lock", "async-trait", @@ -4210,7 +4210,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "event-listener 5.3.1", "futures", @@ -4223,7 +4223,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "futures", "tokio", @@ -4236,7 +4236,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "crossbeam-utils", @@ -4270,7 +4270,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "const_format", diff --git a/Cargo.toml b/Cargo.toml index f213af100..11653c34a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,10 +72,10 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", features=["internal"], branch = "querier" } -zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } flume = "*" [build-dependencies] diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index 277a58850..36bb0cad0 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -3110,7 +3110,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "ahash", "async-trait", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "zenoh-collections", ] @@ -3165,7 +3165,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "tracing", "uhlc", @@ -3177,12 +3177,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "json5", "num_cpus", @@ -3203,7 +3203,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "lazy_static", "tokio", @@ -3214,7 +3214,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "aes", "hmac", @@ -3227,7 +3227,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "bincode", "flume", @@ -3244,7 +3244,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "hashbrown", "keyed-set", @@ -3258,7 +3258,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3278,7 +3278,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "flume", @@ -3302,7 +3302,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "base64 0.22.1", @@ -3328,7 +3328,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "tokio", @@ -3346,7 +3346,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "socket2", @@ -3363,7 +3363,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "base64 0.22.1", @@ -3392,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "socket2", @@ -3411,7 +3411,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "advisory-lock", "async-trait", @@ -3433,7 +3433,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "nix 0.29.0", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "libc", @@ -3469,7 +3469,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "futures-util", @@ -3489,7 +3489,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "proc-macro2", "quote", @@ -3500,7 +3500,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "git-version", "libloading", @@ -3516,7 +3516,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "const_format", "rand", @@ -3530,7 +3530,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "anyhow", ] @@ -3538,7 +3538,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "lazy_static", "ron", @@ -3551,7 +3551,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "advisory-lock", "async-trait", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "event-listener", "futures", @@ -3587,7 +3587,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "futures", "tokio", @@ -3600,7 +3600,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "crossbeam-utils", @@ -3634,7 +3634,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/DenisBiryukov91/zenoh.git?branch=querier#d2dd91208733d951763abad3a5dd130e93a07af9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#549bc7b2f8a68d86441dd0e22fde4f722d130516" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.toml b/build-resources/opaque-types/Cargo.toml index 38d7b38d7..1b70b8d2f 100644 --- a/build-resources/opaque-types/Cargo.toml +++ b/build-resources/opaque-types/Cargo.toml @@ -30,8 +30,8 @@ panic = [ default = ["zenoh/default"] [dependencies] -zenoh = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", features=["internal"], branch = "querier" } -zenoh-protocol = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } +zenoh-protocol = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } const_format = "0.2.32" flume = "*" From fc03aed59e071473dae21cb1eb1316c508b70c35 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Tue, 3 Dec 2024 10:55:36 +0100 Subject: [PATCH 11/12] docs update --- docs/api.rst | 1 + include/zenoh_commons.h | 2 +- src/matching.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index a955768c7..7e844d138 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -540,6 +540,7 @@ Types .. doxygenstruct:: zc_owned_matching_listener_t .. doxygenstruct:: zc_owned_closure_matching_status_t .. doxygenstruct:: zc_matching_status_t + :members: Functions --------- diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 1747fa7dc..63cc10e4e 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -1166,7 +1166,7 @@ typedef struct zc_moved_closure_log_t { } zc_moved_closure_log_t; /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression or Queryables matching Queriers key expression and target. + * @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression or Queryables matching Querier's key expression and target. */ #if defined(Z_FEATURE_UNSTABLE_API) typedef struct zc_matching_status_t { diff --git a/src/matching.rs b/src/matching.rs index 7223d85bd..4eee4df9c 100644 --- a/src/matching.rs +++ b/src/matching.rs @@ -44,7 +44,7 @@ pub extern "C" fn zc_internal_matching_listener_check( } /// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. -/// @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression or Queryables matching Queriers key expression and target. +/// @brief A struct that indicates if there exist Subscribers matching the Publisher's key expression or Queryables matching Querier's key expression and target. #[repr(C)] #[derive(Debug, Clone, Copy)] pub struct zc_matching_status_t { From b7e28eb88a964a7877ce819a556649a5572d55b9 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Tue, 3 Dec 2024 11:47:08 +0100 Subject: [PATCH 12/12] fix branch in cargo.toml.in --- Cargo.toml.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml.in b/Cargo.toml.in index 39e82cace..66de70f82 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -72,10 +72,10 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", features=["internal"], branch = "querier" } -zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/DenisBiryukov91/zenoh.git", branch = "querier" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } flume = "*" [build-dependencies]