Class FixUtil
Utility to work with FIX messages, such as validate, returns custom data of message and etc.
Inheritance
Inherited Members
Namespace: FixAntenna.Fix.Validation.Engine.Utils
Assembly: FixAntenna.Validation.dll
Syntax
public sealed class FixUtil
Constructors
FixUtil(FixVersionContainer)
Constructor FixUtils creates a new FixUtils instance.
Declaration
public FixUtil(FixVersionContainer version)
Parameters
Type | Name | Description |
---|---|---|
FixVersionContainer | version | the Version of FIX protocol |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
FixUtil(FixVersionContainer, FixVersionContainer)
Constructor FixUtils creates a new FixUtils instance.
Declaration
public FixUtil(FixVersionContainer version, FixVersionContainer appFixVersion)
Parameters
Type | Name | Description |
---|---|---|
FixVersionContainer | version | the Version of FIX protocol |
FixVersionContainer | appFixVersion | the App version of FIX protocol |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
Methods
CommentToHtmlStr(Comment)
Declaration
public static string CommentToHtmlStr(Comment comment)
Parameters
Type | Name | Description |
---|---|---|
Comment | comment |
Returns
Type | Description |
---|---|
System.String |
CountLengthForGroupUnit(FixMessage, Int32, Int32, TagValue, ISet<Int32>, String, Int32)
Counts the group length.
Declaration
public int CountLengthForGroupUnit(FixMessage message, int indexOfGroupTags, int startGroupTag, TagValue lengthOfGroupTag, ISet<int> stackOfGroupsTag, string messageType, int rootGroupStartTag)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | the message |
System.Int32 | indexOfGroupTags | the index of group tag |
System.Int32 | startGroupTag | the start group tag |
TagValue | lengthOfGroupTag | the length of group tag |
System.Collections.Generic.ISet<System.Int32> | stackOfGroupsTag | the group tags |
System.String | messageType | the message type |
System.Int32 | rootGroupStartTag | the root group start tag |
Returns
Type | Description |
---|---|
System.Int32 |
CountLengthForGroupUnit(TagValue[], Int32, Int32, TagValue, ISet<Int32>, String, Int32)
Counts the group length.
Declaration
public int CountLengthForGroupUnit(TagValue[] message, int indexOfGroupTags, int startGroupTag, TagValue lengthOfGroupTag, ISet<int> stackOfGroupsTag, string messageType, int rootGroupStartTag)
Parameters
Type | Name | Description |
---|---|---|
TagValue[] | message | the message |
System.Int32 | indexOfGroupTags | the index of group tag |
System.Int32 | startGroupTag | the start group tag |
TagValue | lengthOfGroupTag | the length of group tag |
System.Collections.Generic.ISet<System.Int32> | stackOfGroupsTag | the group tags |
System.String | messageType | the message type |
System.Int32 | rootGroupStartTag | the root group start tag |
Returns
Type | Description |
---|---|
System.Int32 |
CountLengthForOneGroupUnit(FixMessage, Int32, Int32, TagValue, ISet<Int32>, String, Int32)
Counts the group length.
Declaration
public int CountLengthForOneGroupUnit(FixMessage message, int indexOfGroupTags, int startGroupTag, TagValue lengthOfGroupTag, ISet<int> stackOfGroupsTag, string messageType, int rootGroupStartTag)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | the message |
System.Int32 | indexOfGroupTags | the index of group tag |
System.Int32 | startGroupTag | the start group tag |
TagValue | lengthOfGroupTag | the length of group tag |
System.Collections.Generic.ISet<System.Int32> | stackOfGroupsTag | the group tags |
System.String | messageType | the message type |
System.Int32 | rootGroupStartTag | the root group start tag |
Returns
Type | Description |
---|---|
System.Int32 |
CountLengthForOneGroupUnit(TagValue[], Int32, Int32, TagValue, ISet<Int32>, String, Int32)
Counts the group length.
Declaration
public int CountLengthForOneGroupUnit(TagValue[] message, int indexOfGroupTags, int startGroupTag, TagValue lengthOfGroupTag, ISet<int> stackOfGroupsTag, string messageType, int rootGroupStartTag)
Parameters
Type | Name | Description |
---|---|---|
TagValue[] | message | the message |
System.Int32 | indexOfGroupTags | the index of group tag |
System.Int32 | startGroupTag | the start group tag |
TagValue | lengthOfGroupTag | the length of group tag |
System.Collections.Generic.ISet<System.Int32> | stackOfGroupsTag | the group tags |
System.String | messageType | the message type |
System.Int32 | rootGroupStartTag | the root group start tag |
Returns
Type | Description |
---|---|
System.Int32 |
DescrToHtmlStr(Descr)
Declaration
public static string DescrToHtmlStr(Descr descr)
Parameters
Type | Name | Description |
---|---|---|
Descr | descr |
Returns
Type | Description |
---|---|
System.String |
FindGroup(String, Int32)
Find group by start tag.
Declaration
public Group FindGroup(string msgType, int startTagId)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type. |
System.Int32 | startTagId | the start tag if repeating group. |
Returns
Type | Description |
---|---|
Group |
GetAllTags()
Gets tags.
Declaration
public int[] GetAllTags()
Returns
Type | Description |
---|---|
System.Int32[] |
GetBlockDefUtils()
Method getBlockDefUtils returns the blockDefUtils of this FixUtils object.
Declaration
public BlockDefinitionsUtils GetBlockDefUtils()
Returns
Type | Description |
---|---|
BlockDefinitionsUtils | the blockDefUtils of this FixUtils object. |
GetConditionalCache()
Gets conditional cache.
Declaration
public Dictionary<string, IConditionalMessage> GetConditionalCache()
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, IConditionalMessage> |
GetField(String, Nullable<Int32>)
Gets the field.
Declaration
public Field GetField(string msgType, int? tag)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type |
System.Nullable<System.Int32> | tag | the tag |
Returns
Type | Description |
---|---|
Field | field if tag occurred otherwise nl |
GetFieldDef()
Gets fields.
Declaration
public Fielddef[] GetFieldDef()
Returns
Type | Description |
---|---|
Fielddef[] |
GetFieldDefByName(String)
Gets field.
Declaration
public Fielddef GetFieldDefByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the field name |
Returns
Type | Description |
---|---|
Fielddef |
GetFieldDefByTag(Int32)
Gets field.
Declaration
public Fielddef GetFieldDefByTag(int tag)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag | the tag |
Returns
Type | Description |
---|---|
Fielddef |
GetFieldDefs<T1>(IList<T1>, Boolean)
Gets the collection of field defs.
Declaration
public IList<Fielddef> GetFieldDefs<T1>(IList<T1> fieldsWithGroupsAndBlocks, bool useGroupTags)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<T1> | fieldsWithGroupsAndBlocks | the collection with fields, groups and blocks |
System.Boolean | useGroupTags | the flag provides to include the fields of group to result collection |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Fielddef> |
Type Parameters
Name | Description |
---|---|
T1 |
GetFieldDefsHier<T1>(IList<T1>)
Gets the collection of field defs.
Declaration
public IList<object> GetFieldDefsHier<T1>(IList<T1> fieldsWithGroupsAndBlocks)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<T1> | fieldsWithGroupsAndBlocks | the collection with fields, groups and blocks |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Object> |
Type Parameters
Name | Description |
---|---|
T1 |
GetFields(String)
Returns list of tags of fields from input list.
Declaration
public IList<Field> GetFields(string messageType)
Parameters
Type | Name | Description |
---|---|---|
System.String | messageType | the type of FIX Message. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Field> | List of tags of fields |
GetFields<T1>(IList<T1>)
Returns list of tags of fields from input list.
Declaration
public IList<Field> GetFields<T1>(IList<T1> list)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<T1> | list | Input list |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Field> | List of tags of fields |
Type Parameters
Name | Description |
---|---|
T1 |
GetFieldsByMessageType(String)
Gets fields for message.
Declaration
public IList<Fielddef> GetFieldsByMessageType(string messageType)
Parameters
Type | Name | Description |
---|---|---|
System.String | messageType | the message type of message |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Fielddef> |
GetFieldsTags<T1>(IList<T1>)
Returns list of tags of fields from input list.
Declaration
public IList<int> GetFieldsTags<T1>(IList<T1> list)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<T1> | list | Input list |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Int32> | List of tags of fields |
Type Parameters
Name | Description |
---|---|
T1 |
GetFieldTagByName(String)
Gets field tag.
Declaration
public int GetFieldTagByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the field name |
Returns
Type | Description |
---|---|
System.Int32 |
GetFieldTypeByFieldName(String)
Gets field type by field name.
Declaration
public string GetFieldTypeByFieldName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the field name |
Returns
Type | Description |
---|---|
System.String |
GetFieldTypeByFieldTag(Int32)
Gets field type by field tag.
Declaration
public string GetFieldTypeByFieldTag(int tag)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag | the filed tag. |
Returns
Type | Description |
---|---|
System.String |
GetFixdic()
Method getFixdic returns the fixdic of this FixUtils object.
Declaration
public Dictionaries GetFixdic()
Returns
Type | Description |
---|---|
Dictionaries | the fixdic of this FixUtils object. |
GetGroupContent(String, Int32)
Get repeating group content.
Declaration
public IList<object> GetGroupContent(string msgType, int startTagId)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type. |
System.Int32 | startTagId | the start tag if repeating group. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Object> |
GetGroupFieldDefs(String, Int32)
Get all field defs in repeating group.
Declaration
public IList<Fielddef> GetGroupFieldDefs(string msgType, int startTagId)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type. |
System.Int32 | startTagId | the start tag if repeating group. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Fielddef> |
GetGroupsCache(String)
Declaration
public GroupsCache GetGroupsCache(string msgType)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType |
Returns
Type | Description |
---|---|
GroupsCache |
GetGroupsTags(String, Int32, FixMessage, Boolean)
Gets group tags.
Declaration
public IDictionary<int, Field> GetGroupsTags(string msgType, int groupTag, FixMessage fixMessage, bool withInternalGroup)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type |
System.Int32 | groupTag | the group tag |
FixMessage | fixMessage | the list of fields |
System.Boolean | withInternalGroup | if flag is true the inner groups will be included |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.Int32, Field> |
GetGroupTagsWithInternalGroups(String, Int32, FixMessage)
Gets group tags, the returned result includes the inner groups.
Declaration
public IDictionary<int, Field> GetGroupTagsWithInternalGroups(string msgType, int groupTag, FixMessage fixMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type |
System.Int32 | groupTag | the group tag |
FixMessage | fixMessage | the list of fields |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.Int32, Field> |
GetGroupTagsWithOutInternalGroups(String, Int32, FixMessage)
Gets group tags, the returned result does not include the inner groups.
Declaration
public IDictionary<int, Field> GetGroupTagsWithOutInternalGroups(string msgType, int tag, FixMessage fixMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type |
System.Int32 | tag | the tag |
FixMessage | fixMessage | the list of fields |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.Int32, Field> |
GetMessageDefUtils()
Method getDefUtils returns the defUtils of this FixUtils object.
Declaration
public MessageDefinitionsUtils GetMessageDefUtils()
Returns
Type | Description |
---|---|
MessageDefinitionsUtils | the defUtils of this FixUtils object. |
GetMessageFieldDefHier(String)
Get message type field def hierarchy.
Declaration
public IList<object> GetMessageFieldDefHier(string msgType)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Object> |
GetRequiredTagsForMessage(String)
Method getRequiredTagsForMessage returns array of required tags, or empty array if message does not have required tags.
Declaration
public ISet<int> GetRequiredTagsForMessage(string msgType)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the type of message |
Returns
Type | Description |
---|---|
System.Collections.Generic.ISet<System.Int32> | int[] Array of required tags |
Exceptions
Type | Condition |
---|---|
MessageDefinitionsException | if message does not exist |
GetSmhDef()
Method getSmhDef returns the smhDef of this FixUtils object.
Declaration
public Blockdef GetSmhDef()
Returns
Type | Description |
---|---|
Blockdef | the smhDef of this FixUtils object. |
GetSmtDef()
Method getSmtDef returns the smtDef of this FixUtils object.
Declaration
public Blockdef GetSmtDef()
Returns
Type | Description |
---|---|
Blockdef | the smtDef of this FixUtils object. |
GetStartTagForGroup(String, Int32)
Returns start tag for group by goup tag.
Declaration
public int GetStartTagForGroup(string msgType, int tag)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | Type of message. |
System.Int32 | tag | Tag of Group length. |
Returns
Type | Description |
---|---|
System.Int32 | Start field tag of group, if msgType does not exist return -1 |
GetTagInfoAboutGroup(IList<Object>, Int32)
Declaration
public GroupTagInfo GetTagInfoAboutGroup(IList<object> fieldOrDescrOrAlias, int tag)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.Object> | fieldOrDescrOrAlias | |
System.Int32 | tag |
Returns
Type | Description |
---|---|
GroupTagInfo |
GetTagsByMsgType(String)
Gets tags for message.
Declaration
public IList<int> GetTagsByMsgType(string messageType)
Parameters
Type | Name | Description |
---|---|---|
System.String | messageType | the message type of message |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Int32> |
GetValblockdef(String)
Gets valblockdef by idRef.
Declaration
public Valblockdef GetValblockdef(string idRef)
Parameters
Type | Name | Description |
---|---|---|
System.String | idRef | the id ref name |
Returns
Type | Description |
---|---|
Valblockdef | Valblockdef |
GetValblockdefs()
Gets val blocks.
Declaration
public IList<Valblockdef> GetValblockdefs()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Valblockdef> |
GetVersion()
Gets fix version.
Declaration
public FixVersion GetVersion()
Returns
Type | Description |
---|---|
FixVersion |
GetVersionContainer()
Declaration
public FixVersionContainer GetVersionContainer()
Returns
Type | Description |
---|---|
FixVersionContainer |
HasRequiredTagInMessage<T1>(IList<T1>, FixMessage)
Checks if fields list of message Contains tags from block
Declaration
public bool HasRequiredTagInMessage<T1>(IList<T1> list, FixMessage fixMessage)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<T1> | list | the list of field of block |
FixMessage | fixMessage | the field list of message |
Returns
Type | Description |
---|---|
System.Boolean | true if Contains in otherwise false |
Type Parameters
Name | Description |
---|---|
T1 |
HasRequiredTagInMessage<T1>(IList<T1>, FixMessage, Boolean)
Declaration
public bool HasRequiredTagInMessage<T1>(IList<T1> list, FixMessage fixMessage, bool withInternalGroup)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<T1> | list | |
FixMessage | fixMessage | |
System.Boolean | withInternalGroup |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
T1 |
IsGroupTag(String, Int32)
Checks if group groupTag
defined for message type msgType
Declaration
public bool IsGroupTag(string msgType, int groupTag)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type |
System.Int32 | groupTag | the group tag |
Returns
Type | Description |
---|---|
System.Boolean |
IsHeader(Int32)
Declaration
public bool IsHeader(int tag)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag |
Returns
Type | Description |
---|---|
System.Boolean |
IsKnownTag(Int32)
Checks if tag exist.
Declaration
public bool IsKnownTag(int tag)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag | the tag |
Returns
Type | Description |
---|---|
System.Boolean |
IsMessageContainField(String, Int32)
Checks if message body contain tag. Note: tags from group ignored.
Declaration
public bool IsMessageContainField(string messageType, int tag)
Parameters
Type | Name | Description |
---|---|---|
System.String | messageType | the message type |
System.Int32 | tag | the tag |
Returns
Type | Description |
---|---|
System.Boolean |
IsRequiredTag(String, Int32)
Checks if tag is required for message type.
Declaration
public bool IsRequiredTag(string msgType, int tag)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type |
System.Int32 | tag | the tag |
Returns
Type | Description |
---|---|
System.Boolean |
IsTagDefinedForMessage(String, Int32)
Method isTagDefinedForMessage, verifies whether the tag is present in a message by type of message.
Declaration
public bool IsTagDefinedForMessage(string msgType, int tagNum)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | the message type |
System.Int32 | tagNum | the num of tag |
Returns
Type | Description |
---|---|
System.Boolean | true if presents, otherwise false |
IsTagDefinedForMessageOrBlock(String, Int32)
Verifies whether the tag is defines for message by type of message
Declaration
public bool IsTagDefinedForMessageOrBlock(string shortName, int tagNum)
Parameters
Type | Name | Description |
---|---|---|
System.String | shortName | the type of message |
System.Int32 | tagNum | the tag |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsTrailer(Int32)
Declaration
public bool IsTrailer(int tag)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag |
Returns
Type | Description |
---|---|
System.Boolean |
PrepareFieldsDefinitions(Dictionaries)
Prepare fields definitions for input dictionary of FIX protocol.
Declaration
public void PrepareFieldsDefinitions(Dictionaries dictionaries)
Parameters
Type | Name | Description |
---|---|---|
Dictionaries | dictionaries | Input dictionary of FIX protocol |