Class BaseMessage<THeader>
Base class for SBE messages.
Inherited Members
Namespace: OnixS.SimpleBinaryEncoding
Assembly: OnixS.SimpleBinaryEncoding.dll
Syntax
public abstract class BaseMessage<THeader> : ResizableMessage, IMessage, IFieldSet, ICloneable, IDisposable where THeader : unmanaged, IMessageHeader
Type Parameters
Name | Description |
---|---|
THeader |
Properties
BinarySize
Declaration
public override ushort BinarySize { get; }
Property Value
Type | Description |
---|---|
ushort | The length of the entire message, including the binary header, in bytes. |
Overrides
BlockLength
Declaration
public ushort BlockLength { get; }
Property Value
Type | Description |
---|---|
ushort | The root block length. |
Remarks
The root block length is the space reserved for the root level of the message, not counting any repeating groups or variable-length fields. The block length only represents message body fields; it does not include the length of the message header, which is a fixed size.
this[int]
Declaration
public string this[int tag] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Property Value
Type | Description |
---|---|
string | The string field value. |
SchemaID
Declaration
public ushort SchemaID { get; }
Property Value
Type | Description |
---|---|
ushort | The identifier of the SBE Schema in which the message is defined. |
SchemaIdUsedForDecode
Declaration
public abstract ushort SchemaIdUsedForDecode { get; }
Property Value
Type | Description |
---|---|
ushort | The identifier of the SBE Schema that was used to decode this message. |
SchemaVersion
Declaration
public ushort SchemaVersion { get; }
Property Value
Type | Description |
---|---|
ushort | The version of the SBE Schema in which the message is defined. |
SchemaVersionUsedForDecode
Declaration
public abstract ushort SchemaVersionUsedForDecode { get; }
Property Value
Type | Description |
---|---|
ushort | The version of the SBE Schema that was used to decode this message. |
SemanticType
Declaration
public abstract string SemanticType { get; }
Property Value
Type | Description |
---|---|
string | The message semantic type. |
TemplateID
Declaration
public ushort TemplateID { get; }
Property Value
Type | Description |
---|---|
ushort | The message template identifier. |
Methods
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public abstract IMessage Clone()
Returns
Type | Description |
---|---|
IMessage | A new object that is a copy of this instance |
Contains(int)
Returns true
if the field is present in the field set and has a not null
value, otherwise false
.
Declaration
public abstract bool Contains(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
bool |
|
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(bool)
Disposes the message and releases the underlying memory region.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
~BaseMessage()
Performs the final clean-up when a class instance is being collected by the garbage collector.
Declaration
protected ~BaseMessage()
Get(int)
Returns the string representation of the value.
Declaration
public abstract string Get(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
string | The string field value. |
GetBoolean(int)
Returns the boolean field value.
Declaration
public abstract bool GetBoolean(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
bool | The boolean field value. |
GetByte(int)
Returns the byte field value.
Declaration
public abstract byte GetByte(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
byte | The byte field value. |
GetBytes(int)
Returns the raw field value.
Declaration
public abstract ReadOnlySpan<byte> GetBytes(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
ReadOnlySpan<byte> | The raw field value. |
GetChar(int)
Returns the char field value.
Declaration
public abstract char GetChar(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
char | The char field value. |
GetComposite(int)
Returns the composite field value.
Declaration
public abstract IComposite GetComposite(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
IComposite | The composite field value. |
GetComposite<T>(int)
Returns the composite field value.
Declaration
public abstract T GetComposite<T>(int tag) where T : IComposite
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
T | The composite field value. |
Type Parameters
Name | Description |
---|---|
T | The preregistered type of the composite field. |
GetDecimal(int)
Returns the decimal field value.
Declaration
public abstract decimal GetDecimal(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
decimal | The decimal field value. |
GetEnum<T>(int)
Returns the enumeration field value.
Declaration
public abstract T GetEnum<T>(int tag) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
T | The enumeration field value that is casted to the |
Type Parameters
Name | Description |
---|---|
T | The enumeration type. |
GetGroup(int)
Returns the repeating group.
Declaration
public abstract IGroup GetGroup(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
IGroup | The repeating group. |
GetInteger(int)
Returns the integer field value.
Declaration
public abstract int GetInteger(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
int | The integer field value. |
GetLong(int)
Returns the long field value.
Declaration
public abstract long GetLong(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
long | The long field value. |
GetMaturityMonthYear(int)
Returns the MaturityMonthYear
field value.
Declaration
public abstract IMaturityMonthYear GetMaturityMonthYear(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
IMaturityMonthYear | The |
GetShort(int)
Returns the short field value.
Declaration
public abstract short GetShort(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
short | The short field value. |
GetSignedByte(int)
Returns the signed byte field value.
Declaration
public abstract sbyte GetSignedByte(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
sbyte | The signed byte field value. |
GetString(int)
Returns the string field value.
Declaration
public abstract string GetString(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
string | The string field value. |
GetTimestamp(int)
Returns the timestamp field value.
Declaration
public abstract ITimestamp GetTimestamp(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
ITimestamp | The timestamp field value. |
GetUnsignedInteger(int)
Returns the unsigned integer field value.
Declaration
public abstract uint GetUnsignedInteger(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
uint | The unsigned integer field value. |
GetUnsignedLong(int)
Returns the unsigned long field value.
Declaration
public abstract ulong GetUnsignedLong(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
ulong | The unsigned long field value. |
GetUnsignedShort(int)
Returns the unsigned short field value.
Declaration
public abstract ushort GetUnsignedShort(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
ushort | The unsigned short field value. |
GetVariableLengthField(int)
Returns the variable-length field value.
Declaration
public abstract IVariableLengthField GetVariableLengthField(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
IVariableLengthField | The variable-length field value. |
SetBoolean(int, bool)
Sets the boolean field value.
Declaration
public abstract IFieldSet SetBoolean(int tag, bool value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
bool | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetByte(int, byte)
Sets the byte field value.
Declaration
public abstract IFieldSet SetByte(int tag, byte value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
byte | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetByte(int, int)
Sets the byte field value.
Declaration
public abstract IFieldSet SetByte(int tag, int value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
int | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
Remarks
The method will do a narrowing conversion.
SetBytes(int, ReadOnlySpan<byte>)
Sets the raw field value.
Declaration
public abstract IFieldSet SetBytes(int tag, ReadOnlySpan<byte> value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
ReadOnlySpan<byte> | value | The raw value. Its length should be less or equal to the field length. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetChar(int, char)
Sets the char field value.
Declaration
public abstract IFieldSet SetChar(int tag, char value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
char | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetDecimal(int, decimal)
Sets the decimal field value.
Declaration
public abstract IFieldSet SetDecimal(int tag, decimal value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
decimal | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetEnum<T>(int, T)
Sets the enumeration field value.
Declaration
public abstract IFieldSet SetEnum<T>(int tag, T value) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
T | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
Type Parameters
Name | Description |
---|---|
T |
SetGroup(int, int)
Returns the repeating group and sets its count to the specified value.
Declaration
public abstract IGroup SetGroup(int tag, int count)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
int | count | The repeating group entries count. |
Returns
Type | Description |
---|---|
IGroup | The repeating group. |
SetInteger(int, int)
Sets the integer field value.
Declaration
public abstract IFieldSet SetInteger(int tag, int value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
int | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetLong(int, long)
Sets the long field value.
Declaration
public abstract IFieldSet SetLong(int tag, long value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
long | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetShort(int, short)
Sets the short field value.
Declaration
public abstract IFieldSet SetShort(int tag, short value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
short | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetShort(int, int)
Sets the short field value.
Declaration
public abstract IFieldSet SetShort(int tag, int value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
int | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
Remarks
The method will do a narrowing conversion.
SetSignedByte(int, int)
Sets the signed byte field value.
Declaration
public abstract IFieldSet SetSignedByte(int tag, int value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
int | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
Remarks
The method will do a narrowing conversion.
SetSignedByte(int, sbyte)
Sets the signed byte field value.
Declaration
public abstract IFieldSet SetSignedByte(int tag, sbyte value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
sbyte | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetString(int, string)
Sets the string field value.
Declaration
public abstract IFieldSet SetString(int tag, string value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
string | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetToNull(int)
Sets the optional value to null
.
Declaration
public abstract IFieldSet SetToNull(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetUnsignedInteger(int, uint)
Sets the unsigned integer field value.
Declaration
public abstract IFieldSet SetUnsignedInteger(int tag, uint value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
uint | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetUnsignedLong(int, ulong)
Sets the unsigned long field value.
Declaration
public abstract IFieldSet SetUnsignedLong(int tag, ulong value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
ulong | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
SetUnsignedShort(int, int)
Sets the unsigned short field value.
Declaration
public abstract IFieldSet SetUnsignedShort(int tag, int value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
int | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
Remarks
The method will do a narrowing conversion.
SetUnsignedShort(int, ushort)
Sets the unsigned short field value.
Declaration
public abstract IFieldSet SetUnsignedShort(int tag, ushort value)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
ushort | value | The field value. |
Returns
Type | Description |
---|---|
IFieldSet | The reference to this instance. |
ToFixString()
Returns the FIX Protocol message style string.
Declaration
public abstract string ToFixString()
Returns
Type | Description |
---|---|
string | The FIX Protocol message style string. |
ToString()
Returns the text representation.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The text representation. |
Overrides
ToString(char)
Returns the text representation.
Declaration
public abstract string ToString(char separator)
Parameters
Type | Name | Description |
---|---|---|
char | separator | The fields separator. |
Returns
Type | Description |
---|---|
string | The text representation |
TryGetByte(int)
Returns the optional byte field value.
Declaration
public abstract byte? TryGetByte(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
byte? | The nullable byte field value. |
TryGetChar(int)
Returns the optional char field value.
Declaration
public abstract char? TryGetChar(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
char? | The nullable char field value. |
TryGetDecimal(int)
Returns an optional decimal field value.
Declaration
public abstract decimal? TryGetDecimal(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
decimal? | The nullable decimal field value. |
TryGetInteger(int)
Returns the optional integer field value.
Declaration
public abstract int? TryGetInteger(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
int? | The nullable integer field value. |
TryGetLong(int)
Returns the optional long field value.
Declaration
public abstract long? TryGetLong(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
long? | The nullable long field value. |
TryGetShort(int)
Returns the optional short field value.
Declaration
public abstract short? TryGetShort(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
short? | The nullable short field value. |
TryGetSignedByte(int)
Returns the optional signed byte field value.
Declaration
public abstract sbyte? TryGetSignedByte(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
sbyte? | The nullable signed byte field value. |
TryGetUnsignedInteger(int)
Returns the optional unsigned integer field value.
Declaration
public abstract uint? TryGetUnsignedInteger(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
uint? | The nullable unsigned integer field value. |
TryGetUnsignedLong(int)
Returns the optional unsigned long field value.
Declaration
public abstract ulong? TryGetUnsignedLong(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
ulong? | The nullable unsigned long field value. |
TryGetUnsignedShort(int)
Returns the optional unsigned short field value.
Declaration
public abstract ushort? TryGetUnsignedShort(int tag)
Parameters
Type | Name | Description |
---|---|---|
int | tag | The field tag. |
Returns
Type | Description |
---|---|
ushort? | The nullable unsigned short field value. |