-
Notifications
You must be signed in to change notification settings - Fork 35
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
support take_from_loaned API #416
Merged
Merged
Changes from 12 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ad4c4a9
latest zenoh-c/zenoh-cpp
milyin 1b8409a
script fix: allow TRUE and 1 as true valuie
milyin 870a3dd
script fix
milyin 393f14c
use_take_from_loaned template parameter
milyin 38d9cfe
auto selection
milyin 3112791
moved take_from_loaned check to interop.h
milyin adf700b
build fix: detail namespace in separate file
milyin a31b35d
detail namespace joined
milyin 938e26d
removed proxy methods
milyin d9ff9f9
clang format
milyin 24ce0ac
template fixed, test for template added
milyin 123e523
clang format fix
milyin 8ad62fe
submodule updated
milyin b98537d
moved utlity header to detail folder
milyin 5a3675a
clang format
milyin 2bd3b5e
submodules updated
milyin e6584e7
Merge branch 'main' into loaned-mut
milyin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// 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, <[email protected]> | ||
#pragma once | ||
|
||
#include <optional> | ||
#include <type_traits> | ||
|
||
#include "../zenohc.hxx" | ||
|
||
// namespace zenoh::detail | ||
namespace zenoh::detail { | ||
template <typename T, typename = void> | ||
struct is_loan_available : std::false_type {}; | ||
|
||
template <typename T> | ||
struct is_loan_available<T, std::void_t<decltype(::z_loan(std::declval<const T&>()))>> : std::true_type {}; | ||
|
||
template <typename T> | ||
inline constexpr bool is_loan_available_v = is_loan_available<T>::value; | ||
|
||
template <typename T, typename = void> | ||
struct is_loan_mut_available : std::false_type {}; | ||
|
||
template <typename T> | ||
struct is_loan_mut_available<T, std::void_t<decltype(::z_loan_mut(std::declval<T&>()))>> : std::true_type {}; | ||
|
||
template <typename T> | ||
inline constexpr bool is_loan_mut_available_v = is_loan_mut_available<T>::value; | ||
|
||
template <typename T, typename = void> | ||
struct is_take_from_loaned_available : std::false_type {}; | ||
|
||
template <typename T> | ||
struct is_take_from_loaned_available< | ||
T, std::void_t<decltype(::z_take_from_loaned( | ||
std::declval<T*>(), std::declval<typename ::z_owned_to_loaned_type_t<T>::type*>()))>> : std::true_type {}; | ||
|
||
template <typename T> | ||
inline constexpr bool is_take_from_loaned_available_v = is_take_from_loaned_available<T>::value; | ||
|
||
struct null_object_t {}; | ||
inline constexpr null_object_t null_object{}; | ||
|
||
} // namespace zenoh::detail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Copyright (c) 2025 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, <[email protected]> | ||
// | ||
|
||
#include "zenoh.hxx" | ||
|
||
using namespace zenoh; | ||
|
||
static_assert(detail::is_take_from_loaned_available_v<::z_owned_session_t> == false); | ||
static_assert(detail::is_take_from_loaned_available_v<::z_owned_hello_t>); | ||
static_assert(detail::is_take_from_loaned_available_v<::z_owned_sample_t>); | ||
static_assert(detail::is_take_from_loaned_available_v<::z_owned_reply_t>); | ||
static_assert(detail::is_take_from_loaned_available_v<::z_owned_query_t>); | ||
|
||
int main() { return 0; } |
Submodule zenoh-c
updated
22 files
+95 −76 | Cargo.lock | |
+6 −6 | Cargo.toml | |
+5 −5 | Cargo.toml.in | |
+94 −75 | build-resources/opaque-types/Cargo.lock | |
+3 −7 | build-resources/opaque-types/Cargo.toml | |
+70 −5 | build.rs | |
+4 −0 | docs/README.md | |
+153 −11 | docs/concepts.rst | |
+22 −0 | include/zenoh_commons.h | |
+24 −0 | include/zenoh_macros.h | |
+78 −22 | src/collections.rs | |
+25 −0 | src/commons.rs | |
+10 −1 | src/encoding.rs | |
+27 −3 | src/get.rs | |
+44 −42 | src/keyexpr.rs | |
+14 −0 | src/queryable.rs | |
+24 −0 | src/scouting.rs | |
+7 −5 | src/serialization.rs | |
+30 −3 | src/transmute.rs | |
+12 −2 | src/zbytes.rs | |
+16 −0 | tests/z_api_null_drop_test.c | |
+1 −1 | version.txt |
Submodule zenoh-pico
updated
15 files
+27 −3 | docs/api.rst | |
+26 −26 | include/zenoh-pico/api/handlers.h | |
+88 −13 | include/zenoh-pico/api/macros.h | |
+55 −30 | include/zenoh-pico/api/olv_macros.h | |
+8 −6 | include/zenoh-pico/api/primitives.h | |
+7 −0 | include/zenoh-pico/collections/intmap.h | |
+1 −1 | include/zenoh-pico/net/reply.h | |
+1 −1 | include/zenoh-pico/protocol/core.h | |
+41 −21 | src/api/api.c | |
+2 −2 | src/api/liveliness.c | |
+4 −1 | src/api/serialization.c | |
+3 −4 | src/net/reply.c | |
+3 −0 | src/net/sample.c | |
+5 −0 | src/protocol/core.c | |
+1 −1 | tests/z_collections_test.c |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would probably make sense to rename this file int something else and move it under dedicated detail folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed