Skip to content

Commit

Permalink
Merge pull request #83 from sashacmc/migrate_to_zenoh1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmedd committed Aug 1, 2024
2 parents b4da315 + 4f07815 commit 70e06d5
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 659 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
- name: Build zenohcpp conan package
shell: bash
run: |
conan create --version 0.11.0 up-conan-recipes/zenohc-tmp/prebuilt
conan create --version 0.11.0 up-conan-recipes/zenohcpp-tmp/from-source
conan create --version 1.0.0-rc5 up-conan-recipes/zenohc-tmp/prebuilt
conan create --version 1.0.0-rc5 up-conan-recipes/zenohcpp-tmp/from-source
- name: Fetch up-transport-zenoh-cpp
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[requires]
up-cpp/[^1.0.1, include_prerelease]
zenohcpp/0.11.0
zenohc/0.11.0
zenohcpp/1.0.0-rc5
zenohc/1.0.0-rc5
spdlog/[~1.13]
up-core-api/[~1.6]
protobuf/[~3.21]
Expand Down
30 changes: 4 additions & 26 deletions include/up-transport-zenoh-cpp/ZenohUTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,6 @@
#define ZENOHCXX_ZENOHC
#include <zenoh.hxx>

namespace zenohc {

class OwnedQuery {
public:
OwnedQuery(const z_query_t& query) : _query(z_query_clone(&query)) {}

OwnedQuery(const OwnedQuery&) = delete;
OwnedQuery& operator=(const OwnedQuery&) = delete;

~OwnedQuery() { z_drop(&_query); }

Query loan() const { return z_loan(_query); }
bool check() const { return z_check(_query); }

private:
z_owned_query_t _query;
};

using OwnedQueryPtr = std::shared_ptr<OwnedQuery>;

} // namespace zenohc

namespace uprotocol::transport {

/// @brief Zenoh implementation of UTransport
Expand Down Expand Up @@ -126,7 +104,7 @@ struct ZenohUTransport : public UTransport {
uattributesToAttachment(const v1::UAttributes& attributes);

static v1::UAttributes attachmentToUAttributes(
const zenoh::AttachmentView& attachment);
const zenoh::Bytes& attachment);

static zenoh::Priority mapZenohPriority(v1::UPriority upriority);

Expand Down Expand Up @@ -157,13 +135,13 @@ struct ZenohUTransport : public UTransport {
std::map<UuriKey, CallableConn> rpc_callback_map_;
std::mutex rpc_callback_map_mutex_;

std::map<CallableConn, zenoh::Subscriber> subscriber_map_;
std::map<CallableConn, zenoh::Subscriber<void>> subscriber_map_;
std::mutex subscriber_map_mutex_;

std::map<CallableConn, zenoh::Queryable> queryable_map_;
std::map<CallableConn, zenoh::Queryable<void>> queryable_map_;
std::mutex queryable_map_mutex_;

std::map<std::string, zenoh::OwnedQueryPtr> query_map_;
std::map<std::string, zenoh::Query> query_map_;
std::mutex query_map_mutex_;
};

Expand Down
Loading

0 comments on commit 70e06d5

Please sign in to comment.