Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cxx BUG #356

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions conda_recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

cd ./install
rm -rf build
mkdir build
cd build

cmake ${CMAKE_ARGS} -GNinja $SRC_DIR \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING:BOOL=OFF \
-DZENOHCXX_ZENOHC:BOOL=ON \
-DZENOHCXX_ZENOHPICO:BOOL=OFF \
-DZENOHCXX_EXAMPLES_PROTOBUF:BOOL=OFF

cmake --build . --config Release
cmake --build . --config Release --target install
33 changes: 33 additions & 0 deletions conda_recipe/fix_queryable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/examples/universal/z_queryable.cxx b/examples/universal/z_queryable.cxx
index ac145ee..b334608 100644
--- a/examples/universal/z_queryable.cxx
+++ b/examples/universal/z_queryable.cxx
@@ -60,14 +60,14 @@ int _main(int argc, char **argv) {
}
std::cout << "'\n";
std::cout << "[Queryable ] Responding ('" << keyexpr << "': '" << payload << "')\n";
- query.reply(keyexpr, payload);
+ query.reply(KeyExpr(keyexpr), payload);
};

auto on_drop_queryable = []() { std::cout << "Destroying queryable\n"; };

Session::QueryableOptions opts;
opts.complete = args.flag("complete");
- auto queryable = session.declare_queryable(keyexpr, on_query, on_drop_queryable, std::move(opts));
+ auto queryable = session.declare_queryable(KeyExpr(keyexpr), on_query, on_drop_queryable, std::move(opts));

printf("Press CTRL-C to quit...\n");
while (true) {
diff --git a/include/zenoh/api/session.hxx b/include/zenoh/api/session.hxx
index f22c26b..563d183 100644
--- a/include/zenoh/api/session.hxx
+++ b/include/zenoh/api/session.hxx
@@ -26,6 +26,7 @@
#include "keyexpr.hxx"
#include "liveliness.hxx"
#include "publisher.hxx"
+#include "queryable.hxx"
#include "query_consolidation.hxx"
#include "subscriber.hxx"
#include "timestamp.hxx"
39 changes: 39 additions & 0 deletions conda_recipe/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
context:
name: zenoh-cpp
version: 1.1.0

package:
name: ${{ name }}
version: ${{ version }}

source:
- git: https://github.com/eclipse-zenoh/zenoh-cpp.git
tag: ${{ version }}
patches:
- fix_queryable.patch

build:
number: 1000

requirements:
build:
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}
- cmake
- pkg-config
- ninja
host:
- zenoh-c ${{ version }}.*

tests:
- script:
- if: unix
then: test -f ${PREFIX}/include/zenoh.hxx
- if: win
then: if not exist %LIBRARY_PREFIX%\\include\\zenoh.hxx exit 1

about:
license: Apache-2.0 OR EPL-2.0
license_file: LICENSE
summary: C++ API for zenoh
homepage: https://github.com/eclipse-zenoh/zenoh-cpp
4 changes: 2 additions & 2 deletions examples/universal/z_queryable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ int _main(int argc, char **argv) {
}
std::cout << "'\n";
std::cout << "[Queryable ] Responding ('" << keyexpr << "': '" << payload << "')\n";
query.reply(keyexpr, payload);
query.reply(KeyExpr(keyexpr), payload);
};

auto on_drop_queryable = []() { std::cout << "Destroying queryable\n"; };

Session::QueryableOptions opts;
opts.complete = args.flag("complete");
auto queryable = session.declare_queryable(keyexpr, on_query, on_drop_queryable, std::move(opts));
auto queryable = session.declare_queryable(KeyExpr(keyexpr), on_query, on_drop_queryable, std::move(opts));

printf("Press CTRL-C to quit...\n");
while (true) {
Expand Down
1 change: 1 addition & 0 deletions include/zenoh/api/session.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "keyexpr.hxx"
#include "liveliness.hxx"
#include "publisher.hxx"
#include "queryable.hxx"
#include "query_consolidation.hxx"
#include "subscriber.hxx"
#include "timestamp.hxx"
Expand Down
Loading