C# Класс MsgPack.Serialization.CollectionSerializers.DictionaryMessagePackSerializerBase

Наследование: MessagePackSerializer, ICollectionInstanceFactory
Показать файл Открыть проект

Защищенные методы

Метод Описание
AddItem ( dictionary, key, value ) : void

When implemented by derive class, adds the deserialized item to the collection on TDictionary specific manner to implement UnpackToCore(Unpacker,TDictionary).

CreateInstance ( int initialCapacity ) : TDictionary

Creates a new collection instance with specified initial capacity.

An author of Unpacker could implement unpacker for non-MessagePack format, so implementer of this interface should not rely on that initialCapacity reflects actual items count. For example, JSON unpacker cannot supply collection items count efficiently.

GetCount ( dictionary ) : int

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

PackToAsyncCore ( Packer packer, objectTree, CancellationToken cancellationToken ) : Task

Serializes specified object with specified Packer asynchronously.

Приватные методы

Метод Описание
DictionaryMessagePackSerializerBase ( SerializationContext ownerContext, PolymorphismSchema schema ) : System
DictionaryMessagePackSerializerBase ( SerializationContext ownerContext, PolymorphismSchema schema, SerializerCapabilities capabilities ) : System
ICollectionInstanceFactory ( int initialCapacity ) : object
InternalUnpackFromAsyncCore ( Unpacker unpacker, CancellationToken cancellationToken ) : Task
InternalUnpackFromCore ( Unpacker unpacker ) : TDictionary
PackToCore ( Packer packer, objectTree ) : void
UnpackFromAsyncCore ( Unpacker unpacker, CancellationToken cancellationToken ) : Task
UnpackFromCore ( Unpacker unpacker ) : TDictionary
UnpackToAsyncCore ( Unpacker unpacker, collection, CancellationToken cancellationToken ) : Task
UnpackToAsyncCore ( Unpacker unpacker, collection, int itemsCount, CancellationToken cancellationToken ) : Task
UnpackToCore ( Unpacker unpacker, collection ) : void
UnpackToCore ( Unpacker unpacker, collection, int itemsCount ) : void

Описание методов

AddItem() защищенный Метод

When implemented by derive class, adds the deserialized item to the collection on TDictionary specific manner to implement UnpackToCore(Unpacker,TDictionary).
/// This implementation always throws it. ///
protected AddItem ( dictionary, key, value ) : void
dictionary The dictionary to be added.
key The key to be added.
value The value to be added.
Результат void

CreateInstance() защищенный абстрактный Метод

Creates a new collection instance with specified initial capacity.
An author of Unpacker could implement unpacker for non-MessagePack format, so implementer of this interface should not rely on that initialCapacity reflects actual items count. For example, JSON unpacker cannot supply collection items count efficiently.
protected abstract CreateInstance ( int initialCapacity ) : TDictionary
initialCapacity int /// The initial capacy of creating collection. /// Note that this parameter may 0 for non-empty collection. ///
Результат TDictionary

GetCount() защищенный абстрактный Метод

When overridden in derived class, returns count of the dictionary.
protected abstract GetCount ( dictionary ) : int
dictionary A collection. This value will not be null.
Результат int

PackToAsyncCore() защищенный Метод

Serializes specified object with specified Packer asynchronously.
/// Failed to serialize object. /// /// is not serializable even if it can be deserialized. ///
protected PackToAsyncCore ( Packer packer, objectTree, CancellationToken cancellationToken ) : Task
packer Packer which packs values in . This value will not be null.
objectTree Object to be serialized.
cancellationToken CancellationToken The token to monitor for cancellation requests. The default value is .
Результат Task