-
Notifications
You must be signed in to change notification settings - Fork 82
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
Renaming questionable #336
Renaming questionable #336
Conversation
} | ||
|
||
return ret; | ||
} | ||
|
||
_z_questionable_rc_list_t *__z_get_questionable_by_key(_z_questionable_rc_list_t *qles, const _z_keyexpr_t key) { | ||
_z_questionable_rc_list_t *ret = NULL; | ||
_z_session_queryable_rc_list_t *__z_get_session_queryable_by_key(_z_session_queryable_rc_list_t *qles, |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
@@ -27,45 +27,48 @@ | |||
#include "zenoh-pico/utils/logging.h" | |||
|
|||
#if Z_FEATURE_QUERYABLE == 1 | |||
_Bool _z_questionable_eq(const _z_questionable_t *one, const _z_questionable_t *two) { return one->_id == two->_id; } | |||
_Bool _z_session_queryable_eq(const _z_session_queryable_t *one, const _z_session_queryable_t *two) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
|
||
void _z_questionable_clear(_z_questionable_t *qle) { | ||
void _z_session_queryable_clear(_z_session_queryable_t *qle) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
_z_questionable_rc_list_t *__unsafe_z_get_questionable_by_key(_z_session_t *zn, const _z_keyexpr_t key) { | ||
_z_questionable_rc_list_t *qles = zn->_local_questionable; | ||
return __z_get_questionable_by_key(qles, key); | ||
_z_session_queryable_rc_list_t *__unsafe_z_get_session_queryable_by_key(_z_session_t *zn, const _z_keyexpr_t key) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
@@ -105,13 +108,13 @@ | |||
return qle; | |||
} | |||
|
|||
_z_questionable_rc_list_t *_z_get_questionable_by_key(_z_session_t *zn, const _z_keyexpr_t *keyexpr) { | |||
_z_session_queryable_rc_list_t *_z_get_session_queryable_by_key(_z_session_t *zn, const _z_keyexpr_t *keyexpr) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
|
||
#if Z_FEATURE_MULTI_THREAD == 1 | ||
zp_mutex_unlock(&zn->_mutex_inner); | ||
#endif // Z_FEATURE_MULTI_THREAD == 1 | ||
} | ||
|
||
void _z_flush_questionables(_z_session_t *zn) { | ||
void _z_flush_session_queryable(_z_session_t *zn) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
@@ -120,18 +123,18 @@ | |||
return qles; | |||
} | |||
|
|||
_z_questionable_rc_t *_z_register_questionable(_z_session_t *zn, _z_questionable_t *q) { | |||
_z_session_queryable_rc_t *_z_register_session_queryable(_z_session_t *zn, _z_session_queryable_t *q) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
@@ -181,24 +184,25 @@ | |||
return ret; | |||
} | |||
|
|||
void _z_unregister_questionable(_z_session_t *zn, _z_questionable_rc_t *qle) { | |||
void _z_unregister_session_queryable(_z_session_t *zn, _z_session_queryable_rc_t *qle) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
if (qle->_dropper != NULL) { | ||
qle->_dropper(qle->_arg); | ||
} | ||
_z_keyexpr_clear(&qle->_key); | ||
} | ||
|
||
/*------------------ Queryable ------------------*/ | ||
_z_questionable_rc_t *__z_get_questionable_by_id(_z_questionable_rc_list_t *qles, const _z_zint_t id) { | ||
_z_questionable_rc_t *ret = NULL; | ||
_z_session_queryable_rc_t *__z_get_session_queryable_by_id(_z_session_queryable_rc_list_t *qles, const _z_zint_t id) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
@@ -453,7 +453,7 @@ | |||
return (z_owned_closure_sample_t){.call = call, .drop = drop, .context = context}; | |||
} | |||
|
|||
z_owned_closure_query_t z_closure_query(_z_questionable_handler_t call, _z_dropper_handler_t drop, void *context) { | |||
z_owned_closure_query_t z_closure_query(_z_queryable_handler_t call, _z_dropper_handler_t drop, void *context) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
RIP questionables :( |
In zenoh-pico, for zenoh entities like
Queryable
orSubscriber
, we need to distinguish between the object given to the user and the object we store in the zenoh session.For
Subscriber
we have_z_subscriber
and_z_subscription
which is fine but forQueryable
we had_z_queryable
and_z_questionable
which isn't great as the link between the two isn't clear.As the problem may arise again for the yet-to-be-implemented
Interest
entity,_z_questionable
should be renamed to_z_session_queryable
to more accurately represent the link between those objects and this scheme is applicable to future entities.As such this PR renames:
_z_questionable
->_z_session_queryable
questionable_handler
->queryable_handler
(the callback type)local_questionables
->local_queryable
(the session's list of entity)