Stormancer.Infrastructure.MsgPackSerializer Class Reference

Serializer based on MsgPack. More...

Inherits Stormancer.ISerializer.

Inherited by Stormancer.Infrastructure.MsgPackMapSerializer.

Public Member Functions

 MsgPackSerializer ()
 Creates a new MsgPackSerializer object More...
 
 MsgPackSerializer (IEnumerable< IMsgPackSerializationPlugin > plugins)
 Creates a new MsgPackSerializer object with plugins More...
 
void Serialize< T > (T data, System.IO.Stream stream)
 Serializes an object into a stream More...
 
Deserialize< T > (System.IO.Stream stream)
 Deserialize an instance of T from a stream. More...
 
- Public Member Functions inherited from Stormancer.ISerializer
void Serialize< T > (T data, Stream stream)
 Serialize an object into a stream. More...
 
Deserialize< T > (Stream stream)
 Deserialize an object from a stream. More...
 

Protected Member Functions

virtual SerializationContext GetSerializationContext ()
 Builds the msgpack serialization context for this serializer. More...
 
virtual void InitializeSerializationContext (SerializationContext ctx)
 

Properties

virtual string Name [get]
 Name of the serializer More...
 
- Properties inherited from Stormancer.ISerializer
string Name [get]
 The serializer format. More...
 

Detailed Description

Serializer based on MsgPack.

Constructor & Destructor Documentation

◆ MsgPackSerializer() [1/2]

Stormancer.Infrastructure.MsgPackSerializer.MsgPackSerializer ( )

Creates a new MsgPackSerializer object

◆ MsgPackSerializer() [2/2]

Stormancer.Infrastructure.MsgPackSerializer.MsgPackSerializer ( IEnumerable< IMsgPackSerializationPlugin plugins)

Creates a new MsgPackSerializer object with plugins

Parameters
pluginsA collection of serialization plugins

Member Function Documentation

◆ Deserialize< T >()

T Stormancer.Infrastructure.MsgPackSerializer.Deserialize< T > ( System.IO.Stream  stream)

Deserialize an instance of T from a stream.

Template Parameters
TThe type to deserialize into
Parameters
streamA binary stream the object will be deserialized from

The method don't close the stream

Returns
An instance of T deserialized from the stream

◆ GetSerializationContext()

virtual SerializationContext Stormancer.Infrastructure.MsgPackSerializer.GetSerializationContext ( )
protectedvirtual

Builds the msgpack serialization context for this serializer.

Returns
The new serialization context.

Reimplemented in Stormancer.Infrastructure.MsgPackMapSerializer, and Stormancer.Infrastructure.MsgPackMapSerializerNativeDates.

◆ Serialize< T >()

void Stormancer.Infrastructure.MsgPackSerializer.Serialize< T > ( data,
System.IO.Stream  stream 
)

Serializes an object into a stream

Template Parameters
TThe Type of the object to deserialize
Parameters
dataAn object to serialize
streamA Stream into which the object will be serialized

The method doesn't close the stream

Property Documentation

◆ Name

virtual string Stormancer.Infrastructure.MsgPackSerializer.Name
get

Name of the serializer

Returns 'msgpack/array'


The documentation for this class was generated from the following file:
  • Stormancer.Unity/Infrastructure/MsgPackSerializer.cs