Struct CodecElement<TObj, TEnc>
An encoder/decoder for a specific type of object.
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Flame.Ir
Assembly: Flame.Ir.dll
Syntax
public struct CodecElement<TObj, TEnc>
Type Parameters
| Name | Description |
|---|---|
| TObj | |
| TEnc |
Constructors
| Improve this Doc 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 |
|---|---|---|
| Loyc.Symbol | identifier | An identifier for encoded objects. |
| System.Func<TObj, EncoderState, TEnc> | encode | A delegate that encodes objects. |
| System.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 |
|---|---|---|
| System.String | identifier | An identifier for encoded objects. |
| System.Func<TObj, EncoderState, TEnc> | encode | A delegate that encodes objects. |
| System.Func<TEnc, DecoderState, TObj> | decode | A delegate that decodes objects. |
Properties
| Improve this Doc View SourceDecode
Decodes an object's data.
Declaration
public Func<TEnc, DecoderState, TObj> Decode { get; }
Property Value
| Type | Description |
|---|---|
| System.Func<TEnc, DecoderState, TObj> | A delegate that decodes objects. |
Encode
Encodes an object's data.
Declaration
public Func<TObj, EncoderState, TEnc> Encode { get; }
Property Value
| Type | Description |
|---|---|
| System.Func<TObj, EncoderState, TEnc> | A delegate that encodes objects. |
Identifier
Gets an identifier for encoded objects.
Declaration
public Symbol Identifier { get; }
Property Value
| Type | Description |
|---|---|
| Loyc.Symbol | The encoded object identifier. |