-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add owned_query entity #327
Conversation
Allows z_query to be extracted from queryable callbacks if needed.
@@ -327,7 +327,7 @@ | |||
return _Z_RES_OK; | |||
} | |||
|
|||
int8_t _z_send_reply(const z_query_t *query, _z_keyexpr_t keyexpr, const _z_value_t payload) { | |||
int8_t _z_send_reply(const _z_query_t *query, _z_keyexpr_t keyexpr, const _z_value_t payload) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
} _z_query_t; | ||
|
||
void _z_query_clear(_z_query_t *q); | ||
_Z_REFCOUNT_DEFINE(_z_query, _z_query) |
Check warning
Code scanning / Cppcheck (reported by Codacy)
There is an unknown macro here somewhere. Configuration is required. If _Z_REFCOUNT_DEFINE is a macro then please configure it. Warning
@@ -13,6 +13,10 @@ | |||
|
|||
#include "zenoh-pico/net/query.h" | |||
|
|||
void _z_query_clear(_z_query_t *q) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
return parameters; | ||
} | ||
|
||
z_value_t z_query_value(const z_query_t *query) { return query->_value; } | ||
z_value_t z_query_value(const z_query_t *query) { return query->_val._rc.in->val._value; } |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
|
||
z_keyexpr_t z_query_keyexpr(const z_query_t *query) { return query->_key; } | ||
z_keyexpr_t z_query_keyexpr(const z_query_t *query) { return query->_val._rc.in->val._key; } |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
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 don't think the owned query actually owns anything right now
@@ -72,6 +72,11 @@ | |||
*value = _z_value_null(); | |||
return ret; | |||
} | |||
void _z_value_copy(_z_value_t *dst, const _z_value_t *src) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
@@ -140,7 +141,7 @@ | |||
return ret; | |||
} | |||
|
|||
int8_t _z_trigger_queryables(_z_session_t *zn, const _z_msg_query_t *query, const _z_keyexpr_t q_key, uint32_t qid) { | |||
int8_t _z_trigger_queryables(_z_session_t *zn, const _z_msg_query_t *msgq, const _z_keyexpr_t q_key, uint32_t qid) { |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
#if Z_FEATURE_QUERYABLE == 1 | ||
_z_query_t _z_query_create(const _z_value_t *value, const _z_keyexpr_t *key, const _z_bytes_t *parameters, |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 804 with no text in the supplied rule-texts-file Warning
This new entitiy based on a refcounter allows the query entitiy received in a queryable callback to be extracted from said callback in order to be processed in another context, if needed.
Requested by @p-avital.