Skip to content

Commit

Permalink
iox-#415 Add deserialization example to changelog
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <[email protected]>
  • Loading branch information
mossmaurice committed Dec 15, 2021
1 parent 7b81efd commit 2815364
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,25 @@ ServiceDescription("First", "Second", "DontCare") myServiceDescription2;
ServiceDescription("Foo", "Bar", "Baz") myServiceDescription3;
```

Instead of using a constructor a `ServiceDescription` is now deserialized via a
static method with error handling:

```cpp
// before
iox::cxx::Serialization serializedObj;
iox::capro::ServiceDescription service(serializedObj);

// after
iox::cxx::Serialization serialisedObj;
capro::ServiceDescription::deserialize(serialisedObj)
.and_then([](auto& value){
// Do something with the deserialized object
})
.or_else([](auto& error){
// Handle the error
});
```
The service-related methods have been moved from `PoshRuntime` to a separate class (TBD):
```cpp
Expand Down

0 comments on commit 2815364

Please sign in to comment.