Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Oct 9, 2024
1 parent bdaeba1 commit 6ccccd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions content/docs/migration_1.0/C++.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void receive_bytes(const Sample &sample) {
};
```
Additionaly `zenoh::ext` namespace provides support for serialization/deserialziation of typed data to/into `Bytes`:
Additionally `zenoh::ext` namespace provides support for serialization/deserialziation of typed data to/into `Bytes`:
```cpp
// arithmetic types
Expand All @@ -115,7 +115,7 @@ Additionaly `zenoh::ext` namespace provides support for serialization/deserialzi
// Composite types
std::vector<float> v = {0.1f, 0.2f, 0.3f};
b = ext::serialize(v);
assert(ext::deserialize<decltype(v)>(b) == v);
assert(ext::deserialize<std::vector<float>>(b) == v);
std::unordered_map<std::string, std::deque<double>> m = {
{"a", {0.5, 0.2}},
Expand All @@ -124,7 +124,7 @@ Additionaly `zenoh::ext` namespace provides support for serialization/deserialzi
};
b = ext::serialize(m);
assert(ext::deserialize<decltype(m)>(b) == m);
assert(ext::deserialize<std::unordered_map<std::string, std::deque<double>>>(b) == m);
```

Users can easily define serialization/deserialization for their own custom types by using `ext::Serializer` and `ext::Deserializer` classes:
Expand Down
2 changes: 1 addition & 1 deletion content/docs/migration_1.0/C_Pico.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ z_drop(z_move(payload));
```
To implement custom (de-)serialization functions, Zenoh 1.0.0 provides `ze_owned_bytes_serializer`, `ze_bytes_deserializer_t` or lower-level `z_owned_bytes_wrtiter_t` and `ze_bytes_reader_t` types and corresponding functions.
To implement custom (de-)serialization, Zenoh 1.0.0 provides `ze_owned_bytes_serializer`, `ze_bytes_deserializer_t` or lower-level `z_owned_bytes_wrtiter_t` and `z_bytes_reader_t` types and corresponding functions.
Note that it is no longer possible to access the underlying payload data pointer directly, since Zenoh cannot guarantee that the data is delivered as a single fragment.
So in order to get access to raw payload data one must use either `z_bytes_reader_t` or alternatively `z_bytes_slice_iterator_t` and their related functions:
Expand Down

0 comments on commit 6ccccd0

Please sign in to comment.