Struct CodecElement<TObj, TEnc>
An encoder/decoder for a specific type of object.
Inherited Members
Namespace: Flame.Ir
Assembly: Flame.Ir.dll
Syntax
public struct CodecElement<TObj, TEnc>
Type Parameters
| Name | Description |
|---|---|
| TObj | |
| TEnc |
Constructors
| Edit this page View SourceCodecElement(Symbol, Func<TObj, EncoderState, TEnc>, Func<TEnc, DecoderState, TObj>)
Creates a codec for a specific type of object.
Declaration
public CodecElement(Symbol identifier, Func<TObj, EncoderState, TEnc> encode, Func<TEnc, DecoderState, TObj> decode)
Parameters
| Type | Name | Description |
|---|---|---|
| Symbol | identifier | An identifier for encoded objects. |
| Func<TObj, EncoderState, TEnc> | encode | A delegate that encodes objects. |
| Func<TEnc, DecoderState, TObj> | decode | A delegate that decodes objects. |
CodecElement(string, Func<TObj, EncoderState, TEnc>, Func<TEnc, DecoderState, TObj>)
Creates a codec for a specific type of object.
Declaration
public CodecElement(string identifier, Func<TObj, EncoderState, TEnc> encode, Func<TEnc, DecoderState, TObj> decode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | identifier | An identifier for encoded objects. |
| Func<TObj, EncoderState, TEnc> | encode | A delegate that encodes objects. |
| Func<TEnc, DecoderState, TObj> | decode | A delegate that decodes objects. |
Properties
| Edit this page View SourceDecode
Decodes an object's data.
Declaration
public readonly Func<TEnc, DecoderState, TObj> Decode { get; }
Property Value
| Type | Description |
|---|---|
| Func<TEnc, DecoderState, TObj> | A delegate that decodes objects. |
Encode
Encodes an object's data.
Declaration
public readonly Func<TObj, EncoderState, TEnc> Encode { get; }
Property Value
| Type | Description |
|---|---|
| Func<TObj, EncoderState, TEnc> | A delegate that encodes objects. |
Identifier
Gets an identifier for encoded objects.
Declaration
public readonly Symbol Identifier { get; }
Property Value
| Type | Description |
|---|---|
| Symbol | The encoded object identifier. |