27#define CE_DESERIALIZER_PRIMITIVE_TYPES(F) \
A value type that can hold any alongside it's type information.
Definition Box.hpp:40
Represents a reflected property from metadata defined by the class.
Definition Class.hpp:176
The deserializer class has basic support for reflection-based deserializers.
Definition Deserializer.hpp:73
Box binary(InputStream &stream, Box &&existingObject)
Decodes a binary input stream into a MetaValue object.
void arrayElement(const Array &array, Box &&value)
Notifies the deserializer that an array element was deserialized.
Optional< Box > deserialize() final
Deserializes a value from a stream of bytes read from dataStream.
Box endArray(Array &array)
Notifies the deserializer that an array has ended deserialization.
~Deserializer() noexcept override
Destroys the deserializer.
DeserializerState state
An object that stores context for the deserializer.
Definition Deserializer.hpp:79
void endObjectProperty(Object &object, const Property &property, Box &&value)
Notifies the deserializer that a property has ended deserialization.
Box endObject(Object &object)
Notifies the deserializer that an object has ended deserialization.
Box endMap(Map &map)
Notifies the deserializer that a map has ended deserialization.
Property beginObjectProperty(const Object &object, const SerializedPropertyMetadata &metadata)
Notifies the deserializer that a new property is starting deserialization.
const SerializationContext & context
A shared context that contains a context for the deserializer.
Definition Deserializer.hpp:76
Deserializer(const SerializationContext &context=SerializationContext::getDefault())
Creates a new deserializer with a custom context.
Object beginObject(const SerializedObjectMetadata &metadata, Box &&existingObject={})
Notifies the deserializer that a new object is starting deserialization.
Box objectReference(SerializedObjectID referenceID)
Notifies the deserializer that an object reference was deserialized.
Array beginArray(const SerializedArrayMetadata &metadata, Box &&existingObject={})
Notifies the deserializer that an array is starting deserialization.
virtual Box decode(Box &&existingObject={})=0
Starts decoding from the deserializer implementation.
Map beginMap(const SerializedMapMetadata &metadata, Box &&existingObject={})
Notifies the deserializer that a map is starting deserialization.
virtual void resetState()
Resets the deserializer state.
void mapElement(const Map &map, Box &&key, Box &&value)
Notifies the deserializer that a map element was deserialized.
A class that represents state for a deserializer.
Definition Deserializer.hpp:61
HashMap< SerializedObjectID, Box > deserializedObjects
A map of deserialized objects.
Definition Deserializer.hpp:65
The deserializer is responsible from taking a stream of bytes and make a valid C++ object from it.
Definition Deserializer.hpp:45
virtual ~IDeserializer()=default
virtual Optional< Box > deserialize()=0
Deserializes a value from a stream of bytes read from dataStream.
Definition Optional.hpp:17
A context that is shared between multiple serializer and deserializer instances.
Definition Serialization.hpp:196
static const SerializationContext & getDefault()
Gets the default serialization context to be used in case the user doesn't provide one himself.
A base class for serializer and deserializer states.
Definition Serialization.hpp:402
Definition Application.hpp:19
std::unordered_map< Key, T, Hash, KeyEqual, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > HashMap
HashMap is an associative container that contains key-value pairs with unique keys.
Definition Map.hpp:33
UInt32 SerializedObjectID
Definition Forward.hpp:24
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
A context struct that contains information for the decoding of an array.
Definition Deserializer.hpp:153
const SerializedArrayMetadata metadata
The serialized array metadata.
Definition Deserializer.hpp:157
Box value
The object value.
Definition Deserializer.hpp:160
A context struct that contains information for the decoding of a map.
Definition Deserializer.hpp:165
Box value
The object value.
Definition Deserializer.hpp:172
const SerializedMapMetadata metadata
The serialized array metadata.
Definition Deserializer.hpp:169
A context struct that contains information for the decoding of an object.
Definition Deserializer.hpp:100
HashMap< String, Box > forgottenProperties
A map that contains properties that were serialized with the object but are no longer on the object.
Definition Deserializer.hpp:113
const SerializedObjectMetadata metadata
The serialized object metadata.
Definition Deserializer.hpp:104
Box value
The object value.
Definition Deserializer.hpp:107
A context struct that contains information for the decoding of a property.
Definition Deserializer.hpp:120
const void *const existingValueRaw
The raw value of the existing value.
Definition Deserializer.hpp:142
const bool isInplaceSupported
Determines if the deserialization was performed inplace.
Definition Deserializer.hpp:137
const ClassProperty *const property
The meta property being reflected.
Definition Deserializer.hpp:127
const SerializedPropertyMetadata metadata
The serialized property metadata.
Definition Deserializer.hpp:124
void cancelInplace()
Cancels the inplace construction in case the implementation cannot support it.
Definition Deserializer.hpp:146
Box existingValue
The value to perform in-place deserialization with.
Definition Deserializer.hpp:134