Class FlatMessage
FIX Protocol Message as a sequence of 'tag=value' pairs.
Inherited Members
Namespace: OnixS.Fix
Assembly: OnixS.Fix.Engine.dll
Syntax
public class FlatMessage : IMessage, IFieldSet, IEnumerable<Field>, IEnumerable
Constructors
FlatMessage(FlatMessage)
Copy constructor.
Declaration
public FlatMessage(FlatMessage flatMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| FlatMessage | flatMessage | source flat message to be copied |
FlatMessage(Message, bool)
Constructs an instance from the given Message.
Declaration
public FlatMessage(Message source, bool setApplVerId = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Message | source | Source message |
| bool | setApplVerId | Option to set the |
FlatMessage(ProtocolVersion, bool)
Constructs an instance with empty required message header fields:
BeginString, BodyLength, MsgType, SenderCompID,
TargetCompID, MsgSeqNum, SendingTime.
Declaration
public FlatMessage(ProtocolVersion version, bool setApplVerId = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ProtocolVersion | version | ProtocolVersion to be used during the message construction |
| bool | setApplVerId | Option to set the |
FlatMessage(byte[], int)
Constructs the instance from the given plain FIX (tag=value) byte array.
Declaration
public FlatMessage(byte[] rawFixMessage, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | rawFixMessage | A plain FIX ( |
| int | length | the message length in bytes |
FlatMessage(byte[], int, int)
Constructs the instance from the given plain FIX (tag=value) byte array.
Declaration
public FlatMessage(byte[] rawFixMessage, int offset, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | rawFixMessage | A plain FIX ( |
| int | offset | Array offset |
| int | length | the message length in bytes |
FlatMessage(ReadOnlySpan<byte>)
Constructs the instance from the given plain FIX (tag=value) byte span.
Declaration
public FlatMessage(ReadOnlySpan<byte> rawFixMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | rawFixMessage | A plain FIX ( |
FlatMessage(string)
Constructs the instance from the given plain FIX (tag=value) string.
Declaration
public FlatMessage(string rawFixMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rawFixMessage | A plain FIX ( |
Fields
IndexNotFound
Index not found constant.
Declaration
public const int IndexNotFound = -1
Field Value
| Type | Description |
|---|---|
| int |
Properties
Content
The content of the message.
Declaration
public byte[] Content { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
ContentLength
The content length of the message.
Declaration
public int ContentLength { get; }
Property Value
| Type | Description |
|---|---|
| int |
FieldCount
Returns the number of fields.
Declaration
public int FieldCount { get; }
Property Value
| Type | Description |
|---|---|
| int | number of fields |
this[int]
Defines the indexer to allow client code to use [] notation.
Declaration
public string this[int tag] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag |
Property Value
| Type | Description |
|---|---|
| string |
NumberOfFields
Return number of tag/value pairs.
Declaration
public int NumberOfFields { get; }
Property Value
| Type | Description |
|---|---|
| int | number of tag/value pairs. |
SenderCompId
The SenderCompID (tag 49) field value.
Declaration
public string SenderCompId { get; }
Property Value
| Type | Description |
|---|---|
| string | SenderCompID (tag 49) field value |
SeqNum
Message sequence number - the MsgSeqNum (tag 34) field value.
Declaration
public int SeqNum { get; set; }
Property Value
| Type | Description |
|---|---|
| int | Message sequence number |
TargetCompId
The TargetCompID (tag 56) field.
Declaration
public string TargetCompId { get; }
Property Value
| Type | Description |
|---|---|
| string | TargetCompID (tag 56) field value |
Type
Returns the message type.
Declaration
public string Type { get; }
Property Value
| Type | Description |
|---|---|
| string |
Version
FIX Protocol version.
Declaration
public ProtocolVersion Version { get; }
Property Value
| Type | Description |
|---|---|
| ProtocolVersion |
Methods
Add(int, ByteBuffer)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, ByteBuffer value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| ByteBuffer | value | field value represented as ByteBuffer |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, ByteBuffer, long, long)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, ByteBuffer value, long startPosition, long length)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| ByteBuffer | value | field value represented as ByteBuffer |
| long | startPosition | start position |
| long | length | field length |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, byte[], int, int)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, byte[] value, int offset, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| byte[] | value | field value |
| int | offset | value offset |
| int | length | value length |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, char)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, char value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| char | value | field value represented as char |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, DateTime)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, DateTime value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| DateTime | value | field value represented as DateTime |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, decimal)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, decimal value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| decimal | value | field value represented as decimal |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, decimal, int)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, decimal value, int precision)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| decimal | value | field value represented as decimal |
| int | precision | the number of digits in decimal part |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, double)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| double | value | field value represented as double |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, double, int)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, double value, int precision)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| double | value | field value represented as double |
| int | precision | the number of digits in decimal part |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, int)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| int | value | field value represented as int |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, long)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, long value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| long | value | field value represented as long |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, ReadOnlySpan<byte>)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, ReadOnlySpan<byte> value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| ReadOnlySpan<byte> | value | field value |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, string)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Field tag |
| string | value | Field value represented as string |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Remarks
If CheckSum is the last field then it is replaced by this pair
Add(int, StringBuilder)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, StringBuilder value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Field tag |
| StringBuilder | value | Field value represented as StringBuilder |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Remarks
If CheckSum is the last field then it is replaced by this pair
Add(int, uint)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times ( for example, to build up a repeating group).
Declaration
public FlatMessage Add(int tag, uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| uint | value | field value represented as uint |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Add(int, ulong)
Adds the given tag/value pair at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage Add(int tag, ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| ulong | value | field value represented as ulong |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
AddFlag(int, bool)
Adds the given boolean flag at the end of the message instance.
Note: Tag/value pair can be added multiple times, for example to build up a repeating group.
Declaration
public FlatMessage AddFlag(int tag, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Field tag |
| bool | value | Field value represented as bool |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Remarks
If CheckSum is the last field then it is replaced by this pair
Assemble(ByteBuffer)
Assembles the FIX message to the given buffer.
Note: The fields order should comply with the FIX Protocol requirements: the first field should be BeginString, the second field should be BodyLength.
Note: If the last field is not CheckSum then it will be added.
Note: This method updates both BodyLength and CheckSum values.
Declaration
public void Assemble(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | target byte buffer |
Assemble(ByteBuffer, ByteBuffer)
Assembles the FIX message to the given buffers.
Note: The fields order should comply with the FIX Protocol requirements: the first field should be BeginString, the second field should be BodyLength.
Note: If the last field is not CheckSum then it will be added.
Note: This method updates both BodyLength and CheckSum values.
Declaration
public void Assemble(ByteBuffer firstBuffer, ByteBuffer secondBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | firstBuffer | target buffer where BeginString and BodyLength will be assembled |
| ByteBuffer | secondBuffer | target buffer where the rest of fields will be assembled |
Clone()
Clones the message.
Declaration
public FlatMessage Clone()
Returns
| Type | Description |
|---|---|
| FlatMessage |
CompareFieldValue(int, string)
Returns true if the given tag is present in the FieldSet instance and its value is equal to the given string value, otherwise it returns false. The method can help to write GC-free code.
Declaration
public bool CompareFieldValue(int tag, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number of the field that defines the number of instances in this repeating group (the NoXXX field) |
| string | value | String value to compare |
Returns
| Type | Description |
|---|---|
| bool | True if the given tag is present in the FieldSet instance and its value is equal to the given string value |
CompareType(char)
Returns true if the message type value is equal to the given char value, otherwise it returns false. The method can help to write GC-free code.
Declaration
public bool CompareType(char type)
Parameters
| Type | Name | Description |
|---|---|---|
| char | type | Message type to compare |
Returns
| Type | Description |
|---|---|
| bool | True if the message type value is equal to the given string value |
CompareType(string)
Returns true if the message type value is equal to the given string value, otherwise it returns false. The method can help to write GC-free code.
Declaration
public bool CompareType(string type)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | Message type to compare |
Returns
| Type | Description |
|---|---|
| bool | True if the message type value is equal to the given string value |
Contains(int)
Returns whether the field corresponding to the given tag exists.
Declaration
public bool Contains(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| bool | true in case exits, false otherwise. |
FindIndex(int)
Finds the field index that corresponds to the given tag.
Note: If multiple tag/value pairs correspond to the given tag, it will return the first one only.
Declaration
public int FindIndex(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Field tag |
Returns
| Type | Description |
|---|---|
| int | Field index that corresponds to the given tag if the corresponding field is present, otherwise - IndexNotFound |
FindIndex(int, int)
Finds the field index that corresponds to the given tag and is located after the given index.
Note: This method allows to find indexes of all tag/value pairs correspond to the given tag.
Declaration
public int FindIndex(int tag, int indexToFindAfter)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Field tag |
| int | indexToFindAfter | index to find after |
Returns
| Type | Description |
|---|---|
| int | Field index that corresponds to the given tag if the corresponding field is present, otherwise - IndexNotFound |
Get(int)
Returns the field value by the given tag.
Note: The linear search is performed until the tag is found.
Declaration
public string Get(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag |
Returns
| Type | Description |
|---|---|
| string | the field value or |
Get(int, int)
Returns the field value by the given tag.
Note: The linear search is performed until the tag is found.
Declaration
public string Get(int tag, int hintFieldIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag |
| int | hintFieldIndex | The search will be started from this field. |
Returns
| Type | Description |
|---|---|
| string | the field value or |
Get(int, StringBuilder)
Returns the field value as string.
Declaration
public void Get(int tag, StringBuilder result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| StringBuilder | result | Field value |
GetByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public string GetByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| string | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
GetByIndex(int, out Field)
Fills the field with tag/value from the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public bool GetByIndex(int index, out Field field)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
| Field | field | field to be filled |
Returns
| Type | Description |
|---|---|
| bool | true in case the field index is valid, false otherwise. |
GetBytes(int)
Returns the field value as a byte array.
Declaration
public byte[] GetBytes(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
Returns
| Type | Description |
|---|---|
| byte[] | field value as a byte array, null if it is not set |
GetChar(int)
Returns the field value by the given tag.
Declaration
public char GetChar(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| char | the field value by the given tag, if it is not found.
|
Exceptions
| Type | Condition |
|---|---|
| IncorrectFieldValueException | if the value is not a char |
GetCharByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public char GetCharByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| char | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
| IncorrectFieldValueException | if the value is not a char |
GetDecimal(int)
Returns the field value as decimal.
Declaration
public decimal GetDecimal(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
Returns
| Type | Description |
|---|---|
| decimal | Field value as decimal |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the value cannot be converted to decimal |
GetDecimalByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public decimal GetDecimalByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| decimal | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
| IncorrectFieldValueException | if the value cannot be parsed to double |
GetDouble(int)
Returns the field value by the given tag.
Declaration
public double GetDouble(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| double | the field value by the given tag, if it is not found.
|
Exceptions
| Type | Condition |
|---|---|
| IncorrectFieldValueException | if the value cannot be parsed to double |
GetDoubleByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public double GetDoubleByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| double | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
| IncorrectFieldValueException | if the value cannot be parsed to double |
GetEnumerator()
Declaration
public FlatMessage.FieldIterator GetEnumerator()
Returns
| Type | Description |
|---|---|
| FlatMessage.FieldIterator |
GetFields()
Gets fields.
Declaration
public Field[] GetFields()
Returns
| Type | Description |
|---|---|
| Field[] |
GetFlag(int)
Returns the flag value by the given tag.
Declaration
public bool GetFlag(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| bool | whether field exist and field value is equal to "Y" or "y" |
GetFlagByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public bool GetFlagByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| bool | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
| IncorrectFieldValueException | if the value is not a char |
GetHighResolutionTimeSpan(int)
Returns the field value as TimeSpan.
Declaration
public HighResolutionTimeSpan GetHighResolutionTimeSpan(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
Returns
| Type | Description |
|---|---|
| HighResolutionTimeSpan | Field value as HighResolutionTimeSpan |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the field value cannot be parsed to HighResolutionTimeSpan using
either |
GetHighResolutionTimeSpan(int, out TimeSpanFormat)
Returns the field value as TimeSpan and it's source format.
Declaration
public HighResolutionTimeSpan GetHighResolutionTimeSpan(int tag, out TimeSpanFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| TimeSpanFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| HighResolutionTimeSpan | Field value as HighResolutionTimeSpan |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the field value cannot be parsed to HighResolutionTimeSpan using
either |
GetHighResolutionTimestamp(int)
Returns the field value as HighResolutionTimestamp.
Declaration
public HighResolutionTimestamp GetHighResolutionTimestamp(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
Returns
| Type | Description |
|---|---|
| HighResolutionTimestamp | Field value as HighResolutionTimestamp |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the field value cannot be parsed to HighResolutionTimestamp using
either |
GetHighResolutionTimestamp(int, out TimestampFormat)
Returns the field value as HighResolutionTimestamp and it's source format.
Declaration
public HighResolutionTimestamp GetHighResolutionTimestamp(int tag, out TimestampFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| TimestampFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| HighResolutionTimestamp | Field value as HighResolutionTimestamp |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the field value cannot be parsed to HighResolutionTimestamp using
either |
GetInteger(int)
Returns the field value by the given tag.
Declaration
public int GetInteger(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| int | the field value by the given tag, if it is not found.
|
Exceptions
| Type | Condition |
|---|---|
| IncorrectFieldValueException | if the value cannot be parsed to int |
GetIntegerByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public int GetIntegerByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| int | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
| IncorrectFieldValueException | if the value cannot be parsed to int |
GetLong(int)
Returns the field value by the given tag.
Declaration
public long GetLong(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| long | the field value by the given tag, if it is not found.
|
Exceptions
| Type | Condition |
|---|---|
| IncorrectFieldValueException | if the value cannot be parsed to long |
GetLongByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public long GetLongByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| long | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
| IncorrectFieldValueException | if the value cannot be parsed to long |
GetSpan(int)
Returns the field value by the given tag.
Declaration
public ReadOnlySpan<byte> GetSpan(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| ReadOnlySpan<byte> | the field value by the given tag, throws TagNotFoundException if it is not found. |
GetStructuredMessage(IMessageInfoDictionary, MessageValidationFlags)
Returns the structured message.
Declaration
public virtual Message GetStructuredMessage(IMessageInfoDictionary dictionary, MessageValidationFlags parsingFlags)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageInfoDictionary | dictionary | |
| MessageValidationFlags | parsingFlags |
Returns
| Type | Description |
|---|---|
| Message |
GetTagByIndex(int)
Returns the field tag at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public int GetTagByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| int | the field tag. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
GetTimeSpan(int)
Returns the field value as TimeSpan.
Declaration
public TimeSpan GetTimeSpan(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
Returns
| Type | Description |
|---|---|
| TimeSpan | Field value as TimeSpan |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the field value cannot be parsed to TimeSpan using
either |
GetTimeSpan(int, out TimeSpanFormat)
Returns the field value as TimeSpan and it's source format.
Declaration
public TimeSpan GetTimeSpan(int tag, out TimeSpanFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| TimeSpanFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| TimeSpan | Field value as TimeSpan |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the field value cannot be parsed to TimeSpan using
either |
GetTimestamp(int)
Returns the field value as DateTime.
Declaration
public DateTime GetTimestamp(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
Returns
| Type | Description |
|---|---|
| DateTime | Field value as DateTime |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the field value cannot be parsed to DateTime using
either |
GetTimestamp(int, out TimestampFormat)
Returns the field value as DateTime and it's source format.
Declaration
public DateTime GetTimestamp(int tag, out TimestampFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| TimestampFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| DateTime | Field value as DateTime |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | If the field is absent |
| IncorrectFieldValueException | if the field value cannot be parsed to DateTime using
either |
GetUInteger(int)
Returns the field value by the given tag.
Declaration
public uint GetUInteger(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| uint | the field value by the given tag, if it is not found.
|
Exceptions
| Type | Condition |
|---|---|
| IncorrectFieldValueException | if the value cannot be parsed to int |
GetUIntegerByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public uint GetUIntegerByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| uint | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
| IncorrectFieldValueException | if the value cannot be parsed to int |
GetULong(int)
Returns the field value by the given tag.
Declaration
public ulong GetULong(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| ulong | the field value by the given tag, if it is not found.
|
Exceptions
| Type | Condition |
|---|---|
| IncorrectFieldValueException | if the value cannot be parsed to long |
GetULongByIndex(int)
Returns the field value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public ulong GetULongByIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair |
Returns
| Type | Description |
|---|---|
| ulong | the field value. |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
| IncorrectFieldValueException | if the value cannot be parsed to long |
GetValues(int)
Returns all the values for all occurrences of a particular tag.
Declaration
public List<string> GetValues(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | fields tag |
Returns
| Type | Description |
|---|---|
| List<string> | all the values for all occurrences of a particular tag. |
GetValues(int, List<string>)
Adds all the values for all occurrences of a particular tag to the given list.
Declaration
public void GetValues(int tag, List<string> list)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| List<string> | list | list to be filled |
Insert(int, int, ReadOnlySpan<byte>)
Inserts the bytes tag/value pair value at the given index.
Declaration
public void Insert(int index, int tag, ReadOnlySpan<byte> value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | the field index |
| int | tag | the field tag |
| ReadOnlySpan<byte> | value | the field value |
InsertFlag(int, int, bool)
Inserts the flag tag/value pair value into the index
Declaration
public void InsertFlag(int index, int tag, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | the field index |
| int | tag | the field tag |
| bool | value | flag value |
IsAbsentOrEmpty(int)
Checks that the field is absent or empty.
Declaration
public bool IsAbsentOrEmpty(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
Returns
| Type | Description |
|---|---|
| bool |
|
IsSessionLevel()
Returns true if this is a session-level message, otherwise - false.
Declaration
public bool IsSessionLevel()
Returns
| Type | Description |
|---|---|
| bool |
|
Remove(int)
Removes the field by the given tag.
Declaration
public bool Remove(int tag)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
Returns
| Type | Description |
|---|---|
| bool |
|
RemoveLastField()
Removes the last field.
Declaration
public FlatMessage RemoveLastField()
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Reset(FlatMessage)
Resets the flat message with the given one, allows to reuse internal data structures.
Declaration
public void Reset(FlatMessage source)
Parameters
| Type | Name | Description |
|---|---|---|
| FlatMessage | source | Source Flat Message to be copied |
Reset(byte[], int)
Resets the flat message with the given raw FIX message, allows to reuse internal data structures.
Declaration
public void Reset(byte[] rawFixMessage, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | rawFixMessage | raw FIX message in the tag=value form |
| int | length | the message length in bytes |
Reset(ReadOnlySpan<byte>)
Resets the flat message with the given raw FIX message, allows to reuse internal data structures.
Declaration
public void Reset(ReadOnlySpan<byte> rawFixMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | rawFixMessage | raw FIX message in the tag=value form |
Set(int, in HighResolutionTimeSpan)
Sets the field value as HighResolutionTimeSpan.
Declaration
public IFieldSet Set(int tag, in HighResolutionTimeSpan value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| HighResolutionTimeSpan | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, in HighResolutionTimeSpan, TimeSpanFormat)
Sets the field value as HighResolutionTimeSpan.
Declaration
public IFieldSet Set(int tag, in HighResolutionTimeSpan value, TimeSpanFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| HighResolutionTimeSpan | value | Field value |
| TimeSpanFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, in HighResolutionTimestamp)
Sets the field value as HighResolutionTimestamp.
Declaration
public IFieldSet Set(int tag, in HighResolutionTimestamp value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| HighResolutionTimestamp | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, in HighResolutionTimestamp, TimestampFormat)
Sets the field value as HighResolutionTimestamp.
Declaration
public IFieldSet Set(int tag, in HighResolutionTimestamp value, TimestampFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| HighResolutionTimestamp | value | Field value |
| TimestampFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, bool)
Sets the value as a flag: 'Y' or 'N'.
Declaration
public IFieldSet Set(int tag, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| bool | value |
|
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, byte[])
Sets the value for the given tag.
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
Declaration
public IFieldSet Set(int tag, byte[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| byte[] | value | field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | this |
Set(int, byte[], int, int)
Sets the value for the given tag.
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
Declaration
public IFieldSet Set(int tag, byte[] value, int offset, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| byte[] | value | field value |
| int | offset | value offset |
| int | length | value length |
Returns
| Type | Description |
|---|---|
| IFieldSet | this |
Set(int, char)
Sets the field value as a character.
Declaration
public IFieldSet Set(int tag, char value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| char | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | If field with the given tag is not defined for this message type and unknown fields are disabled |
Set(int, DateTime)
Sets the field value as DateTime.
Declaration
public IFieldSet Set(int tag, DateTime value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| DateTime | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, DateTime, TimestampFormat)
Sets the field value as DateTime.
Declaration
public IFieldSet Set(int tag, DateTime value, TimestampFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| DateTime | value | Field value |
| TimestampFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, decimal)
Sets the field value as decimal .
Declaration
public IFieldSet Set(int tag, decimal value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| decimal | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, decimal, int)
Sets the field value as decimal with the given number of decimal places.
Declaration
public IFieldSet Set(int tag, decimal value, int precision)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| decimal | value | Field value |
| int | precision | The desired number of decimal places |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, double)
Sets the double field value.
Note: The double type should not be used for precise values.
Note: Rounds value to 15 significant digits using rounding to nearest. This is done even if the number has more than 15 digits and the less significant digits are zero.
Note: The number will be rounded towards nearest neighbor unless both neighbors are equidistant, in which case round up.
Declaration
public IFieldSet Set(int tag, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| double | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, double, int)
Sets the field value as double with the given number of decimal places.
Note: The number will be rounded towards nearest neighbor unless both neighbors are equidistant, in which case round up.
Declaration
public IFieldSet Set(int tag, double value, int precision)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| double | value | Field value |
| int | precision | The desired number of decimal places |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, int)
Sets the integer field value.
Declaration
public IFieldSet Set(int tag, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| int | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, long)
Sets the ulong field value.
Declaration
public IFieldSet Set(int tag, long value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| long | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, ReadOnlySpan<byte>)
Sets the value for the given tag.
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
Declaration
public IFieldSet Set(int tag, ReadOnlySpan<byte> value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| ReadOnlySpan<byte> | value | field value represented as ReadOnlySpan<T> |
Returns
| Type | Description |
|---|---|
| IFieldSet | this |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | in case the given tag does not exist in the flat message. |
Set(int, string)
Sets the value for the given tag.
Note: If there are multiple tag/value pairs corresponding to the given tag it will update the first one only.
Declaration
public IFieldSet Set(int tag, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| string | value | field value represented as string |
Returns
| Type | Description |
|---|---|
| IFieldSet | this |
Exceptions
| Type | Condition |
|---|---|
| TagNotFoundException | in case the given tag does not exist in the flat message. |
Set(int, StringBuilder)
Sets the string value.
Declaration
public IFieldSet Set(int tag, StringBuilder value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| StringBuilder | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, TimeSpan)
Sets the field value as TimeSpan.
Declaration
public IFieldSet Set(int tag, TimeSpan value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| TimeSpan | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, TimeSpan, TimeSpanFormat)
Sets the field value as TimeSpan.
Declaration
public IFieldSet Set(int tag, TimeSpan value, TimeSpanFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| TimeSpan | value | Field value |
| TimeSpanFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, uint)
Sets the unsigned integer field value.
Declaration
public IFieldSet Set(int tag, uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| uint | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
Set(int, ulong)
Sets the ulong field value.
Declaration
public IFieldSet Set(int tag, ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| ulong | value | Field value |
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
SetByIndex(int, ByteBuffer)
Sets the value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, ByteBuffer value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| ByteBuffer | value | field value represented as ByteBuffer |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, HighResolutionTimeSpan, TimeSpanFormat)
Sets the HighResolutionTimeSpan value at the given field index.
Declaration
public FlatMessage SetByIndex(int index, HighResolutionTimeSpan value, TimeSpanFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of tag/value pair to be updated |
| HighResolutionTimeSpan | value | Field value |
| TimeSpanFormat | format | Timestamp format |
Returns
| Type | Description |
|---|---|
| FlatMessage | This instance |
SetByIndex(int, HighResolutionTimestamp, TimestampFormat)
Sets the HighResolutionTimestamp value at the given field index.
Declaration
public FlatMessage SetByIndex(int index, HighResolutionTimestamp value, TimestampFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of tag/value pair to be updated |
| HighResolutionTimestamp | value | Field value |
| TimestampFormat | format | Timestamp format |
Returns
| Type | Description |
|---|---|
| FlatMessage | This instance |
SetByIndex(int, bool)
Sets the boolean value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of the tag/value pair to be updated |
| bool | value | boolean value |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, byte[])
Sets the value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, byte[] value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| byte[] | value | field value |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, byte[], int, int)
Sets the value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, byte[] value, int offset, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| byte[] | value | field value |
| int | offset | value offset |
| int | length | value length |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, char)
Sets the value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, char value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| char | value | field value represented as char |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, DateTime)
Sets the DateTime value at the given field index.
Declaration
public FlatMessage SetByIndex(int index, DateTime value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of tag/value pair to be updated |
| DateTime | value | Field value |
Returns
| Type | Description |
|---|---|
| FlatMessage | This instance |
SetByIndex(int, DateTime, TimestampFormat)
Sets the DateTime value at the given field index.
Declaration
public FlatMessage SetByIndex(int index, DateTime value, TimestampFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of tag/value pair to be updated |
| DateTime | value | Field value |
| TimestampFormat | format | Timestamp format |
Returns
| Type | Description |
|---|---|
| FlatMessage | This instance |
SetByIndex(int, decimal)
Sets the double value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, decimal value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of tag/value pair to be updated |
| decimal | value | field value represented as decimal |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, decimal, int)
Sets the value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, decimal value, int precision)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| decimal | value | field value represented as decimal |
| int | precision | the number of digits in decimal part |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, double)
Sets the double value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of tag/value pair to be updated |
| double | value | Field value |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, double, int)
Sets the value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, double value, int precision)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| double | value | field value represented as double |
| int | precision | the number of digits in decimal part |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, int)
Sets the integer value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| int | value | field value represented as int |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, long)
Sets the long value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, long value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| long | value | field value represented as long |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, ReadOnlySpan<byte>)
Sets the value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, ReadOnlySpan<byte> value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| ReadOnlySpan<byte> | value | field value represented as ReadOnlySpan<T> |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, string)
Sets the value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of tag/value pair to be updated |
| string | value | Field value represented as string |
Returns
| Type | Description |
|---|---|
| FlatMessage | This instance |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, TimeSpan, TimeSpanFormat)
Sets the TimeSpan value at the given field index.
Declaration
public FlatMessage SetByIndex(int index, TimeSpan value, TimeSpanFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of tag/value pair to be updated |
| TimeSpan | value | Field value |
| TimeSpanFormat | format | TimeSpan format |
Returns
| Type | Description |
|---|---|
| FlatMessage | This instance |
SetByIndex(int, uint)
Sets the unsigned integer value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| uint | value | field value represented as uint |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetByIndex(int, ulong)
Sets the unsigned long value at the given field index.
Note: Field index can be found using FindIndex(int) method.
Declaration
public FlatMessage SetByIndex(int index, ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index of tag/value pair to be updated |
| ulong | value | field value represented as ulong |
Returns
| Type | Description |
|---|---|
| FlatMessage | this |
Exceptions
| Type | Condition |
|---|---|
| IndexNotFoundException | if the index is invalid |
SetFlag(int, bool)
Sets the flag value - 'Y' or 'N'.
Declaration
public IFieldSet SetFlag(int tag, bool value = true)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| bool | value |
|
Returns
| Type | Description |
|---|---|
| IFieldSet | This instance |
Exceptions
| Type | Condition |
|---|---|
| TagNotDefinedForThisMessageTypeException | if field with the given tag is not defined for this message and unknown fields are disabled |
ToBytes(Span<byte>)
Serializes the message to the given byte span.
Declaration
public int ToBytes(Span<byte> buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<byte> | buffer | Byte span to serialize the message content to |
Returns
| Type | Description |
|---|---|
| int | The number of copied bytes if the given span is large enough; otherwise - a negative number, the absolute value of which is equal to the required size of the span |
ToRawFixString()
Returns a raw FIX string that represents the current FlatMessage object.
Declaration
public string ToRawFixString()
Returns
| Type | Description |
|---|---|
| string | A raw FIX string that represents the current FlatMessage object |
ToString()
Returns a string that represents the current FlatMessage object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current FlatMessage object |
Overrides
ToString(char, FixStringFormat)
Returns a string that represents the current FlatMessage object in accordance with the specified delimiter and FixStringFormat.
Declaration
public string ToString(char delimiter, FixStringFormat format = FixStringFormat.TagNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| char | delimiter | |
| FixStringFormat | format |
Returns
| Type | Description |
|---|---|
| string | A string that represents the current FlatMessage object in accordance with the specified delimiter and FixStringFormat |
ToString(StringBuilder, char, FixStringFormat)
Fills StringBuilder with the string representation of the object.
Declaration
public void ToString(StringBuilder builder, char delimiter = '\u0001', FixStringFormat format = FixStringFormat.TagNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| StringBuilder | builder | string builder to be filled |
| char | delimiter | delimiter |
| FixStringFormat | format | format |
TryGet(int, out string)
Returns the field value as string. A return value indicates whether the operation succeeded.
Declaration
public bool TryGet(int tag, out string result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| string | result | Field value |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGet(int, StringBuilder)
Returns the field value as string. A return value indicates whether the operation succeeded.
Declaration
public bool TryGet(int tag, StringBuilder result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| StringBuilder | result | Field value |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetBytes(int, out byte[])
Returns field value as byte[] .
Declaration
public bool TryGetBytes(int tag, out byte[] result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| byte[] | result | field value |
Returns
| Type | Description |
|---|---|
| bool | whether value available |
TryGetChar(int, out char)
Fills the given char with reference to value by the given tag.
Declaration
public bool TryGetChar(int tag, out char result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| char | result | field value reference to be filled |
Returns
| Type | Description |
|---|---|
| bool | true in case the field is found, false otherwise. |
TryGetDecimal(int, out decimal)
Returns the field value as decimal. A return value indicates whether the operation succeeded.
Declaration
public bool TryGetDecimal(int tag, out decimal result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| decimal | result | Contains the |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetDouble(int, out double)
Converts the field value to its double equivalent. A return value indicates whether the operation succeeded.
Note: According to the FIX Protocol float format the value should not contain the exponent ('e' or 'E') symbol.
Note: The double type should not be used for precise values.
Declaration
public bool TryGetDouble(int tag, out double result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| double | result | Contains the |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetFlag(int, out bool)
Returns the field value as bool . A return value indicates whether the operation succeeded.
Declaration
public virtual bool TryGetFlag(int tag, out bool result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| bool | result | Contains |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetHighResolutionTimeSpan(int, out HighResolutionTimeSpan)
Returns the field value as HighResolutionTimeSpan .
Declaration
public bool TryGetHighResolutionTimeSpan(int tag, out HighResolutionTimeSpan result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| HighResolutionTimeSpan | result | Field value |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetHighResolutionTimeSpan(int, out HighResolutionTimeSpan, out TimeSpanFormat)
Returns the field value as HighResolutionTimeSpan and it's source format.
Declaration
public bool TryGetHighResolutionTimeSpan(int tag, out HighResolutionTimeSpan result, out TimeSpanFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| HighResolutionTimeSpan | result | Field value |
| TimeSpanFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetHighResolutionTimestamp(int, out HighResolutionTimestamp)
Returns the field value as HighResolutionTimestamp .
Declaration
public bool TryGetHighResolutionTimestamp(int tag, out HighResolutionTimestamp result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| HighResolutionTimestamp | result | Field value |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetHighResolutionTimestamp(int, out HighResolutionTimestamp, out TimestampFormat)
Returns the field value as HighResolutionTimestamp and it's source format.
Declaration
public bool TryGetHighResolutionTimestamp(int tag, out HighResolutionTimestamp result, out TimestampFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| HighResolutionTimestamp | result | Field value |
| TimestampFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetInteger(int, out int)
Converts the field value to its 32-bit signed integer equivalent. A return value indicates whether the operation succeeded.
Declaration
public bool TryGetInteger(int tag, out int result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| int | result | The 32-bit signed integer number equivalent to the field value, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the field value is absent, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized. |
Returns
| Type | Description |
|---|---|
| bool |
|
Exceptions
| Type | Condition |
|---|---|
| IncorrectFieldValueException | if the value cannot be parsed to an Integer |
TryGetLong(int, out long)
Converts the field value to its 64-bit signed integer equivalent. A return value indicates whether the operation succeeded.
Declaration
public bool TryGetLong(int tag, out long result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| long | result | The 64-bit signed integer number equivalent to the field value, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the field value is absent, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized. |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetSpan(int, out ReadOnlySpan<byte>)
Fills the given ReadOnlySpan<T> with reference to value by the given tag.
Declaration
public bool TryGetSpan(int tag, out ReadOnlySpan<byte> result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | field tag |
| ReadOnlySpan<byte> | result | field value reference to be filled |
Returns
| Type | Description |
|---|---|
| bool | true in case the field is found, false otherwise. |
TryGetTimeSpan(int, out TimeSpan)
Returns the field value as TimeSpan .
Declaration
public bool TryGetTimeSpan(int tag, out TimeSpan result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| TimeSpan | result | Field value |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetTimeSpan(int, out TimeSpan, out TimeSpanFormat)
Returns the field value as TimeSpan and it's source format.
Declaration
public bool TryGetTimeSpan(int tag, out TimeSpan result, out TimeSpanFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| TimeSpan | result | Field value |
| TimeSpanFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetTimestamp(int, out DateTime)
Returns the field value as DateTime .
Declaration
public bool TryGetTimestamp(int tag, out DateTime result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| DateTime | result | Field value |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetTimestamp(int, out DateTime, out TimestampFormat)
Returns the field value as DateTime and it's source format.
Declaration
public bool TryGetTimestamp(int tag, out DateTime result, out TimestampFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| DateTime | result | Field value |
| TimestampFormat | format | Value format |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGetUInteger(int, out uint)
Converts the field value to its 32-bit unsigned integer equivalent. A return value indicates whether the operation succeeded.
Declaration
public bool TryGetUInteger(int tag, out uint result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| uint | result | The 32-bit unsigned integer number equivalent to the field value, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the field value is absent, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized. |
Returns
| Type | Description |
|---|---|
| bool |
|
Exceptions
| Type | Condition |
|---|---|
| IncorrectFieldValueException | if the value cannot be parsed to an Integer |
TryGetULong(int, out ulong)
Converts the field value to its 64-bit unsigned integer equivalent. A return value indicates whether the operation succeeded.
Declaration
public bool TryGetULong(int tag, out ulong result)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tag | Tag number |
| ulong | result | The 64-bit unsigned integer number equivalent to the field value, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the field value is absent, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized. |
Returns
| Type | Description |
|---|---|
| bool |
|