Data
The classes representing the data which is passed to the Closures
-
class Hello : public zenohcxx::Owned<::z_owned_hello_t>
A zenoh-allocated hello message returned by a zenoh entity to a scout message sent with scout operation.
-
struct HelloView : public zenohcxx::Copyable<::z_hello_t>
The non-owning read-only view to a
Hellomessage returned by a zenoh entity as a reply to a “scout” message.Methods
-
inline zenoh::WhatAmI get_whatami() const
Get the
zenoh::WhatAmIof the entity.- Returns:
zenoh::WhatAmIof the entity
-
inline const zenoh::StrArrayView &get_locators() const
Get the array of locators of the entity.
- Returns:
the array of locators of the entity
-
inline zenoh::WhatAmI get_whatami() const
-
struct Sample : public zenohcxx::Copyable<::z_sample_t>
A data sample.
A sample is the value associated to a given resource at a given point in time.
Methods
-
inline const zenoh::KeyExprView &get_keyexpr() const
The resource key of this data sample.
- Returns:
KeyExprViewobject representing the resource key
-
inline const zenoh::BytesView &get_payload() const
The value of this data sample.
- Returns:
BytesViewobject representing the value
-
inline const zenoh::Encoding &get_encoding() const
The encoding of the value of this data sample.
- Returns:
Encodingobject
-
inline SampleKind get_kind() const
The kind of this data sample (PUT or DELETE)
- Returns:
zenoh::SampleKindvalue
-
inline QoS get_qos() const
QoS settings this sample was sent with.
- Returns:
zenoh::QoSstruct
-
inline const zenoh::Timestamp &get_timestamp() const
The timestamp of this data sample.
- Returns:
Timestampobject
-
inline zenoh::Payload sample_payload_rcinc() const
The payload object of the sample. If it represents a buffer in shared memory it can be resent without actually copying the data.
- Returns:
Payloadobject
Note
zenoh-c only
-
inline const zenoh::AttachmentView &get_attachment() const
The attachment of this data sample.
- Returns:
AttachmentViewobject
-
inline const zenoh::KeyExprView &get_keyexpr() const
-
class Query : public zenohcxx::Copyable<::z_query_t>
The query to be answered by a
QueryableMethods
-
inline zenoh::KeyExprView get_keyexpr() const
Get the key expression of the query.
- Returns:
zenoh::KeyExprViewvalue
-
inline zenoh::BytesView get_parameters() const
Get a query’s value selector
- Returns:
zenoh::BytesViewvalue
-
inline zenoh::Value get_value() const
Get the value of the query.
- Returns:
zenoh::Valuevalue
-
inline zenoh::AttachmentView get_attachment() const
Get the attachment of the query.
- Returns:
zenoh::AttachmentViewvalue
-
bool reply(zenoh::KeyExprView key, const zenoh::BytesView &payload, const zenoh::QueryReplyOptions &options, ErrNo &error) const
Send reply to the query.
- Parameters:
key – the
KeyExprViewof theQueryable. NOT the key expression from theQuery::get_keyexpr. E.g. queryable registered as “foo/bar” gets query with key expression “foo/*” and replies with key expression “foo/bar” This function can be called multiple times to send multiple replies to the same query. The reply will be considered complete when theQueryablecallback returns.payload – the
BytesViewwith payload to be sentoptions – the
QueryReplyOptionsto be used for the replyerror – the
zenoh::ErrNoerror code
- Returns:
true if the reply was sent successfully
-
bool reply(zenoh::KeyExprView key, const zenoh::BytesView &payload, const zenoh::QueryReplyOptions &options) const
Send reply to the query.
- Parameters:
key – the
KeyExprViewof the queryablepayload – the
BytesViewwith payload to be sentoptions – the
QueryReplyOptionsto be used for the reply
- Returns:
true if the reply was sent successfully
-
bool reply(zenoh::KeyExprView key, const zenoh::BytesView &payload, ErrNo &error) const
Send reply to the query.
- Parameters:
key – the
KeyExprViewof the queryablepayload – the
BytesViewwith payload to be senterror – the
zenoh::ErrNoerror code
- Returns:
true if the reply was sent successfully
-
bool reply(zenoh::KeyExprView key, const zenoh::BytesView &payload) const
Send reply to the query.
- Parameters:
key – the
KeyExprViewof the queryablepayload – the
BytesViewwith payload to be sent
- Returns:
true if the reply was sent successfully
-
inline zenoh::KeyExprView get_keyexpr() const
-
class Reply : public zenohcxx::Owned<::z_owned_reply_t>
An owned reply from queryable to
Session::getoperation.Methods
-
inline bool is_ok() const
Check if the reply is OK.
- Returns:
true if the reply is OK
-
inline std::variant<zenoh::Sample, ErrorMessage> get() const
Get the reply value.
- Returns:
the
Samplevalue of the reply if reply is OK, otherwisezenoh::ErrorMessage
-
inline bool is_ok() const