SerializingMap

Specialized version of class Map that includes serialization capabilities using the MapExtension mixin

Everything else is identical to the class Map, that means you still need to implement your own hashing functionality.

Note: The serializer allows simple transition from using a map with a non-versioned key / value to a versioned one. The version of the key / value must be v0 and the layout must be the same, otherwise loading will fail.

Constructors

this
this(size_t n, float load_factor)

Constructor.

this
this(IAllocator allocator, size_t n, float load_factor)

Constructor.

Members

Mixins

__anonymous
mixin MapExtension!(K, V)

Mixin extensions for serialization

Mixed In Members

From mixin MapExtension!(K, V)

CheckDg
alias CheckDg = bool delegate(ref K, ref V)

Delegate used to check whether a given record should be dumped or loaded

serializer
MapSerializer serializer;

Instance of the serializer, needs to be initialized in the class constructor

load
void load(cstring file_path)

Loads a file into the map

load
void load(IConduit io_device)

Loads a file into the map

load
void load(cstring file_path, CheckDg check)

Loads a file into the map

load
void load(IConduit io_device, CheckDg check)

Loads a file into the map

dump
void dump(cstring file_path)

Dumps a map into a file

dump
void dump(IConduit io_device)

Dumps a map to an IO device

dump
void dump(cstring file_path, CheckDg check)

Writes a map to a file.

dump
void dump(IConduit io_device, CheckDg check)

Writes a map to an IO device.

Parameters

V

type of the value

K

type of the key

Meta