Skip to content

Commit

Permalink
add more deprecated tags
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Dec 19, 2024
1 parent ce6cf6f commit da06b47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/zenoh/api/ext/advanced_subscriber.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AdvancedSubscriberBase : public Owned<::ze_owned_advanced_subscriber_t> {

public:
/// @name Methods

/// @brief Construct sample miss listener, registering a callback for notifying about missed samples.
///
/// @param on_miss_detected: the callable that will be called every time when missed samples are detected.
Expand Down
13 changes: 11 additions & 2 deletions include/zenoh/api/ext/querying_subscriber.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class [[deprecated("Use zenoh::ext::AdvancedSubscriber instead.")]] QueryingSubs
/// it also will fetch data from a Queryable at startup and peridodically (using `QueryingSubscriber::get`).
/// @note Zenoh-c only.
template <>
class QueryingSubscriber<void> : public detail::QueryingSubscriberBase {
class [[deprecated("Use zenoh::ext::AdvancedSubscriber instead.")]] QueryingSubscriber<void>
: public detail::QueryingSubscriberBase {
protected:
using QueryingSubscriberBase::QueryingSubscriberBase;
friend class Session;
Expand All @@ -101,7 +102,8 @@ class QueryingSubscriber<void> : public detail::QueryingSubscriberBase {
/// @tparam Handler streaming handler exposing data. If `void`, no handler access is provided and instead data is being
/// processed inside the callback.
template <class Handler>
class QueryingSubscriber : public detail::QueryingSubscriberBase {
class [[deprecated("Use zenoh::ext::AdvancedSubscriber instead.")]] QueryingSubscriber
: public detail::QueryingSubscriberBase {
Handler _handler;

public:
Expand Down Expand Up @@ -138,34 +140,39 @@ class QueryingSubscriber : public detail::QueryingSubscriberBase {
namespace zenoh::interop {
/// @brief Return a pair of pointers to owned zenoh-c representations of querying subscriber and its callback.
template <class Handler, typename = std::enable_if_t<!std::is_same_v<Handler, void>>>
[[deprecated]]
auto as_owned_c_ptr(zenoh::ext::QueryingSubscriber<Handler>& s) {
return std::make_pair(as_owned_c_ptr(static_cast<zenoh::ext::detail::QueryingSubscriberBase&>(s)),
as_owned_c_ptr(const_cast<Handler&>(s.handler())));
}

/// @brief Return a pair of pointers to owned zenoh-c representations of querying subscriber and its callback.
template <class Handler, typename = std::enable_if_t<!std::is_same_v<Handler, void>>>
[[deprecated]]
auto as_owned_c_ptr(const zenoh::ext::QueryingSubscriber<Handler>& s) {
return std::make_pair(as_owned_c_ptr(static_cast<const zenoh::ext::detail::QueryingSubscriberBase&>(s)),
as_owned_c_ptr(s.handler()));
}

/// @brief Return a pair of pointers to loaned zenoh-c representations of querying subscriber and its callback.
template <class Handler, typename = std::enable_if_t<!std::is_same_v<Handler, void>>>
[[deprecated]]
auto as_loaned_c_ptr(zenoh::ext::QueryingSubscriber<Handler>& s) {
return std::make_pair(as_loaned_c_ptr(static_cast<zenoh::ext::detail::QueryingSubscriberBase&>(s)),
as_loaned_c_ptr(const_cast<Handler&>(s.handler())));
}

/// @brief Return a pair of pointers to loaned zenoh-c representations of querying subscriber and its callback.
template <class Handler, typename = std::enable_if_t<!std::is_same_v<Handler, void>>>
[[deprecated]]
auto as_loaned_c_ptr(const zenoh::ext::QueryingSubscriber<Handler>& s) {
return std::make_pair(as_loaned_c_ptr(static_cast<const zenoh::ext::detail::QueryingSubscriberBase&>(s)),
as_loaned_c_ptr(s.handler()));
}

/// @brief Return a pair of pointers to moved zenoh-c representations of querying subscriber and its callback.
template <class Handler, typename = std::enable_if_t<!std::is_same_v<Handler, void>>>
[[deprecated]]
auto as_moved_c_ptr(zenoh::ext::QueryingSubscriber<Handler>& s) {
return std::make_pair(as_moved_c_ptr(static_cast<zenoh::ext::detail::QueryingSubscriberBase&>(s)),
as_moved_c_ptr(const_cast<Handler&>(s.handler())));
Expand All @@ -174,6 +181,7 @@ auto as_moved_c_ptr(zenoh::ext::QueryingSubscriber<Handler>& s) {
/// @brief Return a pair of pointers to moved zenoh-c representations of querying subscriber and its callback.
/// Will return a pair of null pointers if option is empty.
template <class Handler, typename = std::enable_if_t<!std::is_same_v<Handler, void>>>
[[deprecated]]
auto as_moved_c_ptr(std::optional<zenoh::ext::QueryingSubscriber<Handler>>& s) -> decltype(as_moved_c_ptr(s.value())) {
if (!s.has_value()) {
return as_moved_c_ptr(s.value());
Expand All @@ -184,6 +192,7 @@ auto as_moved_c_ptr(std::optional<zenoh::ext::QueryingSubscriber<Handler>>& s) -

/// @brief Move querying subscriber and its handler to a pair containing corresponding zenoh-c structs.
template <class Handler, typename = std::enable_if_t<!std::is_same_v<Handler, void>>>
[[deprecated]]
auto move_to_c_obj(zenoh::ext::QueryingSubscriber<Handler>&& s) {
return std::make_pair(move_to_c_obj(std::move(static_cast<zenoh::ext::detail::QueryingSubscriberBase&>(s))),
move_to_c_obj(std::move(const_cast<Handler&>(s))));
Expand Down

0 comments on commit da06b47

Please sign in to comment.