MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializer< TCollection, TItem > Class Template Reference

Provides common implementation of CollectionMessagePackSerializerBase<TCollection, TItem> for collection types which implement ICollection<T>. More...

Inherits MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializerBase< TCollection, TItem >.

Inherited by MsgPack.Serialization.DefaultSerializers.AbstractCollectionMessagePackSerializer< TCollection, TItem >, and MsgPack.Serialization.ReflectionSerializers.ReflectionCollectionMessagePackSerializer< TCollection, TItem >.

Protected Member Functions

 CollectionMessagePackSerializer (SerializationContext ownerContext, PolymorphismSchema schema)
 Initializes a new instance of the CollectionMessagePackSerializer<TCollection, TItem> class. More...
 
 CollectionMessagePackSerializer (SerializationContext ownerContext, PolymorphismSchema schema, SerializerCapabilities capabilities)
 Initializes a new instance of the CollectionMessagePackSerializer<TCollection, TItem> class. More...
 
override int GetCount (TCollection collection)
 Returns count of the collection. More...
 
override void AddItem (TCollection collection, TItem item)
 Adds the deserialized item to the collection on TCollection specific manner to implement MessagePackSerializer<TCollection>.UnpackToCore(Unpacker,TCollection). More...
 
- Protected Member Functions inherited from MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializerBase< TCollection, TItem >
 CollectionMessagePackSerializerBase (SerializationContext ownerContext, PolymorphismSchema schema)
 Initializes a new instance of the CollectionMessagePackSerializerBase<TCollection, TItem> class. More...
 
 CollectionMessagePackSerializerBase (SerializationContext ownerContext, PolymorphismSchema schema, SerializerCapabilities capabilities)
 Initializes a new instance of the CollectionMessagePackSerializerBase<TCollection, TItem> class. More...
 
- Protected Member Functions inherited from MsgPack.Serialization.CollectionSerializers.EnumerableMessagePackSerializerBase< TCollection, TItem >
 EnumerableMessagePackSerializerBase (SerializationContext ownerContext, PolymorphismSchema schema)
 Initializes a new instance of the EnumerableMessagePackSerializerBase<TCollection, TItem> class. More...
 
 EnumerableMessagePackSerializerBase (SerializationContext ownerContext, PolymorphismSchema schema, SerializerCapabilities capabilities)
 Initializes a new instance of the EnumerableMessagePackSerializerBase<TCollection, TItem> class. More...
 
abstract TCollection CreateInstance (int initialCapacity)
 Creates a new collection instance with specified initial capacity. More...
 

Additional Inherited Members

Detailed Description

Provides common implementation of CollectionMessagePackSerializerBase<TCollection, TItem> for collection types which implement ICollection<T>.

Template Parameters
TCollectionThe type of the collection.
TItemThe type of the item of collection.
Type Constraints
TCollection :ICollection<TItem> 

Constructor & Destructor Documentation

◆ CollectionMessagePackSerializer() [1/2]

Initializes a new instance of the CollectionMessagePackSerializer<TCollection, TItem> class.

Parameters
ownerContextA SerializationContext which owns this serializer.
schemaThe schema for collection itself or its items for the member this instance will be used to. null will be considered as PolymorphismSchema.Default.
Exceptions
ArgumentNullExceptionownerContext is null.

◆ CollectionMessagePackSerializer() [2/2]

Initializes a new instance of the CollectionMessagePackSerializer<TCollection, TItem> class.

Parameters
ownerContextA SerializationContext which owns this serializer.
schemaThe schema for collection itself or its items for the member this instance will be used to. null will be considered as PolymorphismSchema.Default.
capabilitiesA serializer calability flags represents capabilities of this instance.
Exceptions
ArgumentNullExceptionownerContext is null.

Member Function Documentation

◆ AddItem()

override void MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializer< TCollection, TItem >.AddItem ( TCollection  collection,
TItem  item 
)
protectedvirtual

Adds the deserialized item to the collection on TCollection specific manner to implement MessagePackSerializer<TCollection>.UnpackToCore(Unpacker,TCollection).

Parameters
collectionThe collection to be added.
itemThe item to be added.

Reimplemented from MsgPack.Serialization.CollectionSerializers.EnumerableMessagePackSerializerBase< TCollection, TItem >.

◆ GetCount()

override int MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializer< TCollection, TItem >.GetCount ( TCollection  collection)
protectedvirtual

Returns count of the collection.

Parameters
collectionA collection. This value will not be null.
Returns
The count of the collection .

Implements MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializerBase< TCollection, TItem >.


The documentation for this class was generated from the following file:
  • MsgPackSources/Serialization/CollectionSerializers/CollectionMessagePackSerializer`2.cs