diff --git a/docs/api.rst b/docs/api.rst index 2f669d228..e5c5e810e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -626,6 +626,41 @@ See details at :ref:`owned_types_concept` .. c:function:: void z_closure_zid_drop(z_moved_closure_zid_t * closure) +Matching closure +---------- +Types +^^^^^ + +See details at :ref:`owned_types_concept` + +.. c:type:: z_owned_closure_matching_status_t +.. c:type:: z_loaned_closure_matching_status_t +.. c:type:: z_moved_closure_matching_status_t + +.. c:type:: void (* z_closure_matching_status_callback_t)(z_matching_status_t * status, void * arg); + + Function pointer type for handling matching status response. + Represents a callback function that is invoked when a matching status was changed. + + Parameters: + - **status** - Pointer to a :c:type:`z_matching_status_t`. + - **arg** - A user-defined pointer to additional data that can be used during the processing of the matching status. + + +Functions +^^^^^^^^^ +.. autocfunction:: primitives.h::z_closure_matching_status +.. autocfunction:: primitives.h::z_closure_matching_status_call + +Ownership Functions +^^^^^^^^^^^^^^^^^^^ + +See details at :ref:`owned_types_concept` + +.. c:function:: const z_loaned_closure_matching_status_t * z_closure_matching_status_loan(const z_owned_closure_matching_status_t * closure) +.. c:function:: void z_closure_matching_status_drop(z_moved_closure_matching_status_t * closure) + + .. _channels_concept: Channels @@ -955,6 +990,26 @@ See details at :ref:`owned_types_concept` .. c:function:: void z_session_drop(z_moved_session_t * closure) +Matching +======== + +Types +----- +See details at :ref:`owned_types_concept` + +.. c:type:: z_owned_matching_listener_t +.. c:type:: z_loaned_matching_listener_t +.. c:type:: z_moved_matching_listener_t + + +.. autoctype:: types.h::z_matching_status_t + +Functions +--------- + +.. autocfunction:: z_undeclare_matching_listener + + Publication =========== @@ -1002,6 +1057,9 @@ Functions .. autocfunction:: primitives.h::z_publisher_put_options_default .. autocfunction:: primitives.h::z_publisher_delete_options_default .. autocfunction:: primitives.h::z_reliability_default +.. autocfunction:: primitives.h::z_publisher_get_matching_status +.. autocfunction:: primitives.h::z_publisher_declare_matching_listener +.. autocfunction:: primitives.h::z_publisher_declare_background_matching_listener Ownership Functions ------------------- diff --git a/docs/conf.py b/docs/conf.py index e1ee877ba..6b541879f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,6 +38,7 @@ "-DZ_FEATURE_QUERYABLE=1", "-DZ_FEATURE_ENCODING_VALUES=1", "-DZ_FEATURE_LIVELINESS=1", + "-DZ_FEATURE_MATCHING=1", ] # -- Options for HTML output ------------------------------------------------- diff --git a/include/zenoh-pico/api/types.h b/include/zenoh-pico/api/types.h index 25725c734..1712a2954 100644 --- a/include/zenoh-pico/api/types.h +++ b/include/zenoh-pico/api/types.h @@ -137,13 +137,13 @@ _Z_OWNED_TYPE_VALUE(_z_encoding_t, encoding) */ _Z_OWNED_TYPE_VALUE(_z_value_t, reply_err) -#if defined(Z_FEATURE_MATCHING) /** * A struct that indicates if there exist Subscribers matching the Publisher's key expression or Queryables matching * Querier's key expression and target. + * Members: + * bool matching: true if there exist matching Zenoh entities, false otherwise. */ typedef _z_matching_status_t z_matching_status_t; -#endif /** * Represents the configuration used to configure a subscriber upon declaration :c:func:`z_declare_subscriber`. @@ -491,14 +491,12 @@ typedef struct { */ _Z_OWNED_TYPE_VALUE(_z_closure_zid_t, closure_zid) -#if defined(Z_FEATURE_MATCHING) typedef _z_closure_matching_status_callback_t z_closure_matching_status_callback_t; typedef _z_closure_matching_status_t z_closure_matching_status_t; /** * Represents the matching status callback closure. */ _Z_OWNED_TYPE_VALUE(_z_closure_matching_status_t, closure_matching_status) -#endif #ifdef __cplusplus }