Table of Contents

Class FlexDictionaryUtil

Namespace
Hi.Numerical
Assembly
HiMech.dll

Utility for flexible dictionary operations.

public static class FlexDictionaryUtil
Inheritance
FlexDictionaryUtil
Inherited Members

Methods

CallFlexDictionary<T>(IFlexDictionaryHost<T>)

Calls the flex dictionary of the source, initializing it if null.

public static Dictionary<string, T> CallFlexDictionary<T>(this IFlexDictionaryHost<T> src)

Parameters

src IFlexDictionaryHost<T>

The flex dictionary host

Returns

Dictionary<string, T>

The dictionary from the host

Type Parameters

T

The type of values in the dictionary

GetFlexDictionaryBytes<T>(IFlexDictionaryHost<T>, IntegerKeyDictionaryConverter<T>)

Gets the flex dictionary as a byte array.

public static byte[] GetFlexDictionaryBytes<T>(this IFlexDictionaryHost<T> src, IntegerKeyDictionaryConverter<T> converter)

Parameters

src IFlexDictionaryHost<T>

The flex dictionary host

converter IntegerKeyDictionaryConverter<T>

The converter for integer keys

Returns

byte[]

Byte array representation of the dictionary

Type Parameters

T

The type of values in the dictionary

ReadFlexDictionary(BinaryReader, IntegerKeyDictionaryConverter<double>)

Reads a flex dictionary from a binary reader.

public static Dictionary<string, double> ReadFlexDictionary(BinaryReader reader, IntegerKeyDictionaryConverter<double> converter)

Parameters

reader BinaryReader

The binary reader to read from

converter IntegerKeyDictionaryConverter<double>

The converter for integer keys

Returns

Dictionary<string, double>

The restored dictionary

WriteFlexDictionary<T>(IFlexDictionaryHost<T>, BinaryWriter, IntegerKeyDictionaryConverter<T>)

Writes a flex dictionary to a binary writer.

public static void WriteFlexDictionary<T>(this IFlexDictionaryHost<T> src, BinaryWriter writer, IntegerKeyDictionaryConverter<T> converter)

Parameters

src IFlexDictionaryHost<T>

The flex dictionary host

writer BinaryWriter

The binary writer to write to

converter IntegerKeyDictionaryConverter<T>

The converter for integer keys

Type Parameters

T

The type of values in the dictionary