template interface IItemSerializer (Niantic.ARDK.Utilities.BinarySerialization.IItemSerializer)

Overview

Represents a typed serializer for items of the generic type T. All implementations of this interface should also implement the non-generic (untyped) interface. This interface doesn’t depend on the other one directly so users of this interface will not see the untyped methods (avoiding possible calls to Serialize() giving objects of the wrong type). More…

template <T>
interface IItemSerializer {
    // properties

    Type DataType;

    // methods

    object Deserialize(BinaryDeserializer deserializer);
    T Deserialize(BinaryDeserializer deserializer);
    void Serialize(BinarySerializer serializer, object item);
    void Serialize(BinarySerializer serializer, T item);
};

// direct descendants

template <T>
class BaseItemSerializer;

template <T>
class BaseItemSerializer;

class EnumSerializer;

template <T>
class SimpleSerializableSerializer;

template <T>
class SimpleSerializableSerializer;

Detailed Documentation

Represents a typed serializer for items of the generic type T. All implementations of this interface should also implement the non-generic (untyped) interface. This interface doesn’t depend on the other one directly so users of this interface will not see the untyped methods (avoiding possible calls to Serialize() giving objects of the wrong type).

Properties

Type DataType

Gets the data-type this item serializer is capable of serializing and deserializing.

Methods

object Deserialize(BinaryDeserializer deserializer)

Deserializes an item. The given BinarySerializer is the one calling this item deserializer and can be used if the current item-serializer needs to deserialize data of other types before being able to provide the final item.

T Deserialize(BinaryDeserializer deserializer)

Deserializes an item. The given BinarySerializer is the one calling this item deserializer and can be used if the current item-serializer needs to deserialize data of other types before being able to provide the final item.

void Serialize(BinarySerializer serializer, object item)

Serializes the given object into the stream of the given “generic purpose” serializer. To avoid any confusion, this item-serializer only knows how to serialize a single type, while the serializer given as argument is the one invoking this item serializer, but might be used if to serialize the current item, items of different types need to be serialized. Example: To serialize a Vector3, we also need to serialize 3 floats, the the BinarySerializer can help the Vector3Serializer to do this.

void Serialize(BinarySerializer serializer, T item)

Serializes the given object into the stream of the given “generic purpose” serializer. To avoid any confusion, this item-serializer only knows how to serialize a single type, while the serializer given as argument is the one invoking this item serializer, but might be used if to serialize the current item, items of different types need to be serialized. Example: To serialize a Vector3, we also need to serialize 3 floats, the the BinarySerializer can help the Vector3Serializer to do this.