CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::BinaryDeserializer Class Referencefinal

A Deserializer that reads the serialized content from a binary encoded CBOR object stream. More...

#include <CeresEngine/Serialization/BinarySerialization.hpp>

Inheritance diagram for CeresEngine::BinaryDeserializer:
CeresEngine::Deserializer CeresEngine::IDeserializer

Public Member Functions

 BinaryDeserializer (InputStream inputStream, const SerializationContext &context=SerializationContext::getDefault())
 Creates a new binary deserializer backed by an output stream.
 
 ~BinaryDeserializer () noexcept override
 Destroys the binary deserializer.
 
Box decode (Box &&existingObject={}) final
 
- Public Member Functions inherited from CeresEngine::Deserializer
 Deserializer (const SerializationContext &context=SerializationContext::getDefault())
 Creates a new deserializer with a custom context.
 
 ~Deserializer () noexcept override
 Destroys the deserializer.
 
Optional< Boxdeserialize () final
 Deserializes a value from a stream of bytes read from dataStream.
 
virtual void resetState ()
 Resets the deserializer state.
 
- Public Member Functions inherited from CeresEngine::IDeserializer
virtual ~IDeserializer ()=default
 

Private Member Functions

Box decode (const CBOR::Value &value, Box &&existingObject={})
 
Box decodeObject (const CBOR::Value &value, Box &&existingObject={})
 
Box decodeObjectReference ()
 
Box decodeArray (const CBOR::Array &array, Box &&existingObject={})
 
Box decodeMap (const CBOR::Map &map, Box &&existingObject={})
 

Private Attributes

CBOR::Decoder mDecoder
 The CBOR decoder for the binary serializer.
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::Deserializer
const SerializationContextcontext
 A shared context that contains a context for the deserializer.
 
DeserializerState state
 An object that stores context for the deserializer.
 
- Protected Member Functions inherited from CeresEngine::Deserializer
Object beginObject (const SerializedObjectMetadata &metadata, Box &&existingObject={})
 Notifies the deserializer that a new object is starting deserialization.
 
Box endObject (Object &object)
 Notifies the deserializer that an object has ended deserialization.
 
Property beginObjectProperty (const Object &object, const SerializedPropertyMetadata &metadata)
 Notifies the deserializer that a new property is starting deserialization.
 
void endObjectProperty (Object &object, const Property &property, Box &&value)
 Notifies the deserializer that a property has ended deserialization.
 
Box objectReference (SerializedObjectID referenceID)
 Notifies the deserializer that an object reference was deserialized.
 
Box binary (InputStream &stream, Box &&existingObject)
 Decodes a binary input stream into a MetaValue object.
 
Array beginArray (const SerializedArrayMetadata &metadata, Box &&existingObject={})
 Notifies the deserializer that an array is starting deserialization.
 
void arrayElement (const Array &array, Box &&value)
 Notifies the deserializer that an array element was deserialized.
 
Box endArray (Array &array)
 Notifies the deserializer that an array has ended deserialization.
 
Map beginMap (const SerializedMapMetadata &metadata, Box &&existingObject={})
 Notifies the deserializer that a map is starting deserialization.
 
void mapElement (const Map &map, Box &&key, Box &&value)
 Notifies the deserializer that a map element was deserialized.
 
Box endMap (Map &map)
 Notifies the deserializer that a map has ended deserialization.
 

Detailed Description

A Deserializer that reads the serialized content from a binary encoded CBOR object stream.

Constructor & Destructor Documentation

◆ BinaryDeserializer()

CeresEngine::BinaryDeserializer::BinaryDeserializer ( InputStream  inputStream,
const SerializationContext context = SerializationContext::getDefault() 
)
explicit

Creates a new binary deserializer backed by an output stream.

Parameters
inputStreamThe input stream to read serialized objects from.
contextA context for the deserializer to operate on.

◆ ~BinaryDeserializer()

CeresEngine::BinaryDeserializer::~BinaryDeserializer ( )
overridenoexcept

Destroys the binary deserializer.

Member Function Documentation

◆ decode() [1/2]

Box CeresEngine::BinaryDeserializer::decode ( Box &&  existingObject = {})
finalvirtual

◆ decode() [2/2]

Box CeresEngine::BinaryDeserializer::decode ( const CBOR::Value value,
Box &&  existingObject = {} 
)
private

◆ decodeArray()

Box CeresEngine::BinaryDeserializer::decodeArray ( const CBOR::Array array,
Box &&  existingObject = {} 
)
private

◆ decodeMap()

Box CeresEngine::BinaryDeserializer::decodeMap ( const CBOR::Map map,
Box &&  existingObject = {} 
)
private

◆ decodeObject()

Box CeresEngine::BinaryDeserializer::decodeObject ( const CBOR::Value value,
Box &&  existingObject = {} 
)
private

◆ decodeObjectReference()

Box CeresEngine::BinaryDeserializer::decodeObjectReference ( )
private

Member Data Documentation

◆ mDecoder

CBOR::Decoder CeresEngine::BinaryDeserializer::mDecoder
private

The CBOR decoder for the binary serializer.


The documentation for this class was generated from the following file: