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 |
---|---|---|
Fix |
version | the Version of FIX protocol |
Exceptions
Type | Condition |
---|---|
System. |
FixUtil(FixVersionContainer, FixVersionContainer)
Constructor FixUtils creates a new FixUtils instance.
Declaration
public FixUtil(FixVersionContainer version, FixVersionContainer appFixVersion)
Parameters
Type | Name | Description |
---|---|---|
Fix |
version | the Version of FIX protocol |
Fix |
appFixVersion | the App version of FIX protocol |
Exceptions
Type | Condition |
---|---|
System. |
Methods
CommentToHtmlStr(Comment)
Declaration
public static string CommentToHtmlStr(Comment comment)
Parameters
Type | Name | Description |
---|---|---|
Comment | comment |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
Fix |
message | the message |
System. |
indexOfGroupTags | the index of group tag |
System. |
startGroupTag | the start group tag |
Tag |
lengthOfGroupTag | the length of group tag |
System. |
stackOfGroupsTag | the group tags |
System. |
messageType | the message type |
System. |
rootGroupStartTag | the root group start tag |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
Tag |
message | the message |
System. |
indexOfGroupTags | the index of group tag |
System. |
startGroupTag | the start group tag |
Tag |
lengthOfGroupTag | the length of group tag |
System. |
stackOfGroupsTag | the group tags |
System. |
messageType | the message type |
System. |
rootGroupStartTag | the root group start tag |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
Fix |
message | the message |
System. |
indexOfGroupTags | the index of group tag |
System. |
startGroupTag | the start group tag |
Tag |
lengthOfGroupTag | the length of group tag |
System. |
stackOfGroupsTag | the group tags |
System. |
messageType | the message type |
System. |
rootGroupStartTag | the root group start tag |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
Tag |
message | the message |
System. |
indexOfGroupTags | the index of group tag |
System. |
startGroupTag | the start group tag |
Tag |
lengthOfGroupTag | the length of group tag |
System. |
stackOfGroupsTag | the group tags |
System. |
messageType | the message type |
System. |
rootGroupStartTag | the root group start tag |
Returns
Type | Description |
---|---|
System. |
DescrToHtmlStr(Descr)
Declaration
public static string DescrToHtmlStr(Descr descr)
Parameters
Type | Name | Description |
---|---|---|
Descr | descr |
Returns
Type | Description |
---|---|
System. |
FindGroup(String, Int32)
Find group by start tag.
Declaration
public Group FindGroup(string msgType, int startTagId)
Parameters
Type | Name | Description |
---|---|---|
System. |
msgType | the message type. |
System. |
startTagId | the start tag if repeating group. |
Returns
Type | Description |
---|---|
Group |
GetAllTags()
Gets tags.
Declaration
public int[] GetAllTags()
Returns
Type | Description |
---|---|
System. |
GetBlockDefUtils()
Method getBlockDefUtils returns the blockDefUtils of this FixUtils object.
Declaration
public BlockDefinitionsUtils GetBlockDefUtils()
Returns
Type | Description |
---|---|
Block |
the blockDefUtils of this FixUtils object. |
GetConditionalCache()
Gets conditional cache.
Declaration
public Dictionary<string, IConditionalMessage> GetConditionalCache()
Returns
Type | Description |
---|---|
System. |
GetField(String, Nullable<Int32>)
Gets the field.
Declaration
public Field GetField(string msgType, int? tag)
Parameters
Type | Name | Description |
---|---|---|
System. |
msgType | the message type |
System. |
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. |
name | the field name |
Returns
Type | Description |
---|---|
Fielddef |
GetFieldDefByTag(Int32)
Gets field.
Declaration
public Fielddef GetFieldDefByTag(int tag)
Parameters
Type | Name | Description |
---|---|---|
System. |
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. |
fieldsWithGroupsAndBlocks | the collection with fields, groups and blocks |
System. |
useGroupTags | the flag provides to include the fields of group to result collection |
Returns
Type | Description |
---|---|
System. |
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. |
fieldsWithGroupsAndBlocks | the collection with fields, groups and blocks |
Returns
Type | Description |
---|---|
System. |
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. |
messageType | the type of FIX Message. |
Returns
Type | Description |
---|---|
System. |
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. |
list | Input list |
Returns
Type | Description |
---|---|
System. |
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. |
messageType | the message type of message |
Returns
Type | Description |
---|---|
System. |
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. |
list | Input list |
Returns
Type | Description |
---|---|
System. |
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. |
name | the field name |
Returns
Type | Description |
---|---|
System. |
GetFieldTypeByFieldName(String)
Gets field type by field name.
Declaration
public string GetFieldTypeByFieldName(string name)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | the field name |
Returns
Type | Description |
---|---|
System. |
GetFieldTypeByFieldTag(Int32)
Gets field type by field tag.
Declaration
public string GetFieldTypeByFieldTag(int tag)
Parameters
Type | Name | Description |
---|---|---|
System. |
tag | the filed tag. |
Returns
Type | Description |
---|---|
System. |
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. |
msgType | the message type. |
System. |
startTagId | the start tag if repeating group. |
Returns
Type | Description |
---|---|
System. |
GetGroupFieldDefs(String, Int32)
Get all field defs in repeating group.
Declaration
public IList<Fielddef> GetGroupFieldDefs(string msgType, int startTagId)
Parameters
Type | Name | Description |
---|---|---|
System. |
msgType | the message type. |
System. |
startTagId | the start tag if repeating group. |
Returns
Type | Description |
---|---|
System. |
GetGroupsCache(String)
Declaration
public GroupsCache GetGroupsCache(string msgType)
Parameters
Type | Name | Description |
---|---|---|
System. |
msgType |
Returns
Type | Description |
---|---|
Groups |
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. |
msgType | the message type |
System. |
groupTag | the group tag |
Fix |
fixMessage | the list of fields |
System. |
withInternalGroup | if flag is true the inner groups will be included |
Returns
Type | Description |
---|---|
System. |
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. |
msgType | the message type |
System. |
groupTag | the group tag |
Fix |
fixMessage | the list of fields |
Returns
Type | Description |
---|---|
System. |
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. |
msgType | the message type |
System. |
tag | the tag |
Fix |
fixMessage | the list of fields |
Returns
Type | Description |
---|---|
System. |
GetMessageDefUtils()
Method getDefUtils returns the defUtils of this FixUtils object.
Declaration
public MessageDefinitionsUtils GetMessageDefUtils()
Returns
Type | Description |
---|---|
Message |
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. |
msgType | the message type. |
Returns
Type | Description |
---|---|
System. |
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. |
msgType | the type of message |
Returns
Type | Description |
---|---|
System. |
int[] Array of required tags |
Exceptions
Type | Condition |
---|---|
Message |
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. |
msgType | Type of message. |
System. |
tag | Tag of Group length. |
Returns
Type | Description |
---|---|
System. |
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. |
fieldOrDescrOrAlias | |
System. |
tag |
Returns
Type | Description |
---|---|
Group |
GetTagsByMsgType(String)
Gets tags for message.
Declaration
public IList<int> GetTagsByMsgType(string messageType)
Parameters
Type | Name | Description |
---|---|---|
System. |
messageType | the message type of message |
Returns
Type | Description |
---|---|
System. |
GetValblockdef(String)
Gets valblockdef by idRef.
Declaration
public Valblockdef GetValblockdef(string idRef)
Parameters
Type | Name | Description |
---|---|---|
System. |
idRef | the id ref name |
Returns
Type | Description |
---|---|
Valblockdef | Valblockdef |
GetValblockdefs()
Gets val blocks.
Declaration
public IList<Valblockdef> GetValblockdefs()
Returns
Type | Description |
---|---|
System. |
GetVersion()
Gets fix version.
Declaration
public FixVersion GetVersion()
Returns
Type | Description |
---|---|
Fix |
GetVersionContainer()
Declaration
public FixVersionContainer GetVersionContainer()
Returns
Type | Description |
---|---|
Fix |
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. |
list | the list of field of block |
Fix |
fixMessage | the field list of message |
Returns
Type | Description |
---|---|
System. |
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. |
list | |
Fix |
fixMessage | |
System. |
withInternalGroup |
Returns
Type | Description |
---|---|
System. |
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. |
msgType | the message type |
System. |
groupTag | the group tag |
Returns
Type | Description |
---|---|
System. |
IsHeader(Int32)
Declaration
public bool IsHeader(int tag)
Parameters
Type | Name | Description |
---|---|---|
System. |
tag |
Returns
Type | Description |
---|---|
System. |
IsKnownTag(Int32)
Checks if tag exist.
Declaration
public bool IsKnownTag(int tag)
Parameters
Type | Name | Description |
---|---|---|
System. |
tag | the tag |
Returns
Type | Description |
---|---|
System. |
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. |
messageType | the message type |
System. |
tag | the tag |
Returns
Type | Description |
---|---|
System. |
IsRequiredTag(String, Int32)
Checks if tag is required for message type.
Declaration
public bool IsRequiredTag(string msgType, int tag)
Parameters
Type | Name | Description |
---|---|---|
System. |
msgType | the message type |
System. |
tag | the tag |
Returns
Type | Description |
---|---|
System. |
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. |
msgType | the message type |
System. |
tagNum | the num of tag |
Returns
Type | Description |
---|---|
System. |
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. |
shortName | the type of message |
System. |
tagNum | the tag |
Returns
Type | Description |
---|---|
System. |
|
IsTrailer(Int32)
Declaration
public bool IsTrailer(int tag)
Parameters
Type | Name | Description |
---|---|---|
System. |
tag |
Returns
Type | Description |
---|---|
System. |
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 |