MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializerBase< TCollection, TItem > Class Template Referenceabstract

Provides common implementation of EnumerableMessagePackSerializerBase<TCollection, TItem> for collection types which implement ICollection<T> or IReadOnlyCollection{T}. More...

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

Inherited by MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializer< TCollection, TItem >.

Protected Member Functions

 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...
 
abstract int GetCount (TCollection collection)
 When overridden in derived class, returns count of the collection. 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...
 
virtual void AddItem (TCollection collection, TItem item)
 When implemented by derive class, adds the deserialized item to the collection on TCollection specific manner to implement UnpackToCore(Unpacker,TCollection). More...
 

Additional Inherited Members

Detailed Description

Provides common implementation of EnumerableMessagePackSerializerBase<TCollection, TItem> for collection types which implement ICollection<T> or IReadOnlyCollection{T}.

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

Constructor & Destructor Documentation

◆ CollectionMessagePackSerializerBase() [1/2]

Initializes a new instance of the CollectionMessagePackSerializerBase<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.

◆ CollectionMessagePackSerializerBase() [2/2]

Initializes a new instance of the CollectionMessagePackSerializerBase<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

◆ GetCount()

abstract int MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializerBase< TCollection, TItem >.GetCount ( TCollection  collection)
protectedpure virtual

When overridden in derived class, returns count of the collection.

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

Implemented in MsgPack.Serialization.CollectionSerializers.CollectionMessagePackSerializer< TCollection, TItem >.


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