IDS peak ICV v1.5.0
Loading...
Searching...
No Matches
Deserializer Class Reference

#include <peak_icv/serialization/peak_icv_deserializer.hpp>

Inheritance diagram for Deserializer:

Public Member Functions

std::shared_ptr< peak::common::serialization::IArchive > Read (std::istream &stream) override
 Reads serialized data from the specified stream and deserializes it into an archive.
 

Detailed Description

Deserializer for reading serialized data and converting it into an IArchive object.

This class provides functionality to read data from a supported serialization format (currently, only JSON) and reconstruct it as an IArchive object.

Example

std::ifstream file("archive.json");
peak::icv::Deserializer deserializer{};
auto archive = deserializer.Read(file);
auto id = archive->GetInt("id");
auto name = archive->GetString("name");
Deserializer for reading serialized data and converting it into an IArchive object.
Definition peak_icv_deserializer.hpp:65
std::shared_ptr< peak::common::serialization::IArchive > Read(std::istream &stream) override
Reads serialized data from the specified stream and deserializes it into an archive.
Definition peak_icv_deserializer.hpp:85

It inherits from peak::common::serialization::IDeserializer and implements the deserialization operations.

Note
This class is non-copyable but supports move semantics.
See also
peak::common::serialization::IDeserializer
peak::common::serialization::IArchive
SerializationType
Since
ids_peak_icv 1.0

Member Function Documentation

◆ Read()

std::shared_ptr< peak::common::serialization::IArchive > Read ( std::istream & stream)
inlineoverridevirtual

Reads serialized data from the specified stream and deserializes it into an archive.

Parameters
streamThe stream to read serialized data from.
Returns
A shared pointer to an IArchive object containing the deserialized data.
Exceptions
NotSupportedExceptionThe serialization type is not supported.
CorruptedExceptionThe stream contains invalid or corrupted data.
Since
ids_peak_icv 1.0

Implements IDeserializer.