DataDictionary.cpp
Go to the documentation of this file.
/****************************************************************************
** Copyright (c) 2001-2014
**
** This file is part of the QuickFIX FIX Engine
**
** This file may be distributed under the terms of the quickfixengine.org
** license as defined by quickfixengine.org and appearing in the file
** LICENSE included in the packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.quickfixengine.org/LICENSE for licensing information.
**
** Contact ask@quickfixengine.org if any conditions of this licensing are
** not clear to you.
**
****************************************************************************/
#ifdef _MSC_VER
#include "stdafx.h"
#else
#include "config.h"
#endif
#include "DataDictionary.h"
#include "Message.h"
#include <fstream>
#include <memory>
#include "PUGIXML_DOMDocument.h"
#ifdef _MSC_VER
#define RESET_AUTO_PTR(OLD, NEW) OLD = NEW;
#else
#define RESET_AUTO_PTR(OLD, NEW) OLD.reset( NEW.release() );
#endif
namespace FIX
{
DataDictionary::DataDictionary()
: m_hasVersion( false ), m_checkFieldsOutOfOrder( true ),
m_checkFieldsHaveValues( true ), m_checkUserDefinedFields( true ), m_allowUnknownMessageFields( false ), m_storeMsgFieldsOrder(false)
{}
DataDictionary::DataDictionary( std::istream& stream, bool preserveMsgFldsOrder )
throw( ConfigError )
: m_hasVersion( false ), m_checkFieldsOutOfOrder( true ),
m_checkFieldsHaveValues( true ), m_checkUserDefinedFields( true ), m_allowUnknownMessageFields( false ), m_storeMsgFieldsOrder(preserveMsgFldsOrder)
{
readFromStream( stream );
}
DataDictionary::DataDictionary( const std::string& url, bool preserveMsgFldsOrder )
throw( ConfigError )
: m_hasVersion( false ), m_checkFieldsOutOfOrder( true ),
m_checkFieldsHaveValues( true ), m_checkUserDefinedFields( true ), m_allowUnknownMessageFields( false ), m_storeMsgFieldsOrder(preserveMsgFldsOrder), m_orderedFieldsArray(0)
{
readFromURL( url );
}
DataDictionary::DataDictionary( const DataDictionary& copy )
{
*this = copy;
}
DataDictionary::~DataDictionary()
{
FieldToGroup::iterator i;
for ( i = m_groups.begin(); i != m_groups.end(); ++i )
{
const FieldPresenceMap& presenceMap = i->second;
FieldPresenceMap::const_iterator iter = presenceMap.begin();
for ( ; iter != presenceMap.end(); ++iter )
delete iter->second.second;
}
}
DataDictionary& DataDictionary::operator=( const DataDictionary& rhs )
{
m_hasVersion = rhs.m_hasVersion;
m_checkFieldsOutOfOrder = rhs.m_checkFieldsOutOfOrder;
m_checkFieldsHaveValues = rhs.m_checkFieldsHaveValues;
m_storeMsgFieldsOrder = rhs.m_storeMsgFieldsOrder;
m_checkUserDefinedFields = rhs.m_checkUserDefinedFields;
m_allowUnknownMessageFields = rhs.m_allowUnknownMessageFields;
m_beginString = rhs.m_beginString;
m_messageFields = rhs.m_messageFields;
m_requiredFields = rhs.m_requiredFields;
m_messages = rhs.m_messages;
m_fields = rhs.m_fields;
m_orderedFields = rhs.m_orderedFields;
m_orderedFieldsArray = rhs.m_orderedFieldsArray;
m_headerFields = rhs.m_headerFields;
m_trailerFields = rhs.m_trailerFields;
m_fieldTypes = rhs.m_fieldTypes;
m_fieldValues = rhs.m_fieldValues;
m_fieldNames = rhs.m_fieldNames;
m_names = rhs.m_names;
m_valueNames = rhs.m_valueNames;
m_dataFields = rhs.m_dataFields;
m_headerOrderedFields = rhs.m_headerOrderedFields;
m_headerOrder = rhs.m_headerOrder;
m_trailerOrderedFields = rhs.m_trailerOrderedFields;
m_trailerOrder = rhs.m_trailerOrder;
m_messageOrderedFields = rhs.m_messageOrderedFields;
FieldToGroup::const_iterator i = rhs.m_groups.begin();
for ( ; i != rhs.m_groups.end(); ++i )
{
const FieldPresenceMap& presenceMap = i->second;
FieldPresenceMap::const_iterator iter = presenceMap.begin();
for ( ; iter != presenceMap.end(); ++iter )
{
addGroup( iter->first, i->first, iter->second.first, *iter->second.second );
}
}
return *this;
}
void DataDictionary::validate( const Message& message,
const DataDictionary* const pSessionDD,
const DataDictionary* const pAppDD )
throw( FIX::Exception )
{
const Header& header = message.getHeader();
const BeginString& beginString = FIELD_GET_REF( header, BeginString );
#ifdef HAVE_EMX
const std::string & msgType = message.getSubMessageType();
if (msgType.empty())
{
throw InvalidMessageType("empty subMsgType, check Tag 9426/MESSAGE_ID");
}
#else
const MsgType& msgType = FIELD_GET_REF( header, MsgType );
#endif
if ( pSessionDD != 0 && pSessionDD->m_hasVersion )
{
if( pSessionDD->getVersion() != beginString )
{
throw UnsupportedVersion();
}
}
int field = 0;
if( (pSessionDD !=0 && pSessionDD->m_checkFieldsOutOfOrder) ||
(pAppDD != 0 && pAppDD->m_checkFieldsOutOfOrder) )
{
if ( !message.hasValidStructure(field) )
throw TagOutOfOrder(field);
}
if ( pAppDD != 0 && pAppDD->m_hasVersion )
{
pAppDD->checkMsgType( msgType );
pAppDD->checkHasRequired( message.getHeader(), message, message.getTrailer(), msgType );
}
if( pSessionDD != 0 )
{
pSessionDD->iterate( message.getHeader(), msgType );
pSessionDD->iterate( message.getTrailer(), msgType );
}
if( pAppDD != 0 )
{
pAppDD->iterate( message, msgType );
}
}
void DataDictionary::iterate( const FieldMap& map, const MsgType& msgType ) const
{
int lastField = 0;
FieldMap::const_iterator i;
for ( i = map.begin(); i != map.end(); ++i )
{
const FieldBase& field = (*i);
if( i != map.begin() && (field.getTag() == lastField) )
throw RepeatedTag( lastField );
checkHasValue( field );
if ( m_hasVersion )
{
checkValidFormat( field );
checkValue( field );
}
if ( m_beginString.getValue().length() && shouldCheckTag(field) )
{
checkValidTagNumber( field );
if ( !Message::isHeaderField( field, this )
&& !Message::isTrailerField( field, this ) )
{
checkIsInMessage( field, msgType );
checkGroupCount( field, map, msgType );
}
}
lastField = field.getTag();
}
}
void DataDictionary::readFromURL( const std::string& url )
throw( ConfigError )
{
DOMDocumentPtr pDoc(new PUGIXML_DOMDocument());
if(!pDoc->load(url))
throw ConfigError(url + ": Could not parse data dictionary file");
try
{
readFromDocument( pDoc );
}
catch( ConfigError& e )
{
throw ConfigError( url + ": " + e.what() );
}
}
void DataDictionary::readFromStream( std::istream& stream )
throw( ConfigError )
{
DOMDocumentPtr pDoc(new PUGIXML_DOMDocument());
if(!pDoc->load(stream))
throw ConfigError("Could not parse data dictionary stream");
readFromDocument( pDoc );
}
void DataDictionary::readFromDocument( const DOMDocumentPtr &pDoc )
throw( ConfigError )
{
// VERSION
DOMNodePtr pFixNode = pDoc->getNode("/fix");
if(!pFixNode.get())
throw ConfigError("Could not parse data dictionary file"
", or no <fix> node found at root");
DOMAttributesPtr attrs = pFixNode->getAttributes();
std::string type = "FIX";
if(attrs->get("type", type))
{
if(type != "FIX" && type != "FIXT")
throw ConfigError("type attribute must be FIX or FIXT");
}
std::string major;
if(!attrs->get("major", major))
throw ConfigError("major attribute not found on <fix>");
std::string minor;
if(!attrs->get("minor", minor))
throw ConfigError("minor attribute not found on <fix>");
setVersion(type + "." + major + "." + minor);
// FIELDS
DOMNodePtr pFieldsNode = pDoc->getNode("/fix/fields");
if(!pFieldsNode.get())
throw ConfigError("<fields> section not found in data dictionary");
DOMNodePtr pFieldNode = pFieldsNode->getFirstChildNode();
if(!pFieldNode.get()) throw ConfigError("No fields defined");
while(pFieldNode.get())
{
if(pFieldNode->getName() == "field")
{
DOMAttributesPtr attrs = pFieldNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError("<field> does not have a name attribute");
std::string number;
if(!attrs->get("number", number))
throw ConfigError("<field> " + name + " does not have a number attribute");
int num = atoi(number.c_str());
std::string type;
if(!attrs->get("type", type))
throw ConfigError("<field> " + name + " does not have a type attribute");
addField(num);
addFieldType(num, XMLTypeToType(type));
addFieldName(num, name);
DOMNodePtr pFieldValueNode = pFieldNode->getFirstChildNode();
while(pFieldValueNode.get())
{
if(pFieldValueNode->getName() == "value")
{
DOMAttributesPtr attrs = pFieldValueNode->getAttributes();
std::string enumeration;
if(!attrs->get("enum", enumeration))
throw ConfigError("<value> does not have enum attribute in field " + name);
addFieldValue(num, enumeration);
std::string description;
if(attrs->get("description", description))
addValueName(num, enumeration, description);
}
RESET_AUTO_PTR(pFieldValueNode, pFieldValueNode->getNextSiblingNode());
}
}
RESET_AUTO_PTR(pFieldNode, pFieldNode->getNextSiblingNode());
}
// HEADER
if( type == "FIXT" || (type == "FIX" && major < "5") )
{
DOMNodePtr pHeaderNode = pDoc->getNode("/fix/header");
if(!pHeaderNode.get())
throw ConfigError("<header> section not found in data dictionary");
DOMNodePtr pHeaderFieldNode = pHeaderNode->getFirstChildNode();
if(!pHeaderFieldNode.get()) throw ConfigError("No header fields defined");
while(pHeaderFieldNode.get())
{
if(pHeaderFieldNode->getName() == "field" || pHeaderFieldNode->getName() == "group" )
{
DOMAttributesPtr attrs = pHeaderFieldNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError("<field> does not have a name attribute");
std::string required = "false";
attrs->get("required", required);
addHeaderField(lookupXMLFieldNumber(pDoc.get(), name), required == "true");
}
if(pHeaderFieldNode->getName() == "group")
{
DOMAttributesPtr attrs = pHeaderFieldNode->getAttributes();
std::string required;
attrs->get("required", required);
bool isRequired = (required == "Y" || required == "y");
addXMLGroup(pDoc.get(), pHeaderFieldNode.get(), "_header_", *this, isRequired);
}
RESET_AUTO_PTR(pHeaderFieldNode, pHeaderFieldNode->getNextSiblingNode());
}
}
// TRAILER
if( type == "FIXT" || (type == "FIX" && major < "5") )
{
DOMNodePtr pTrailerNode = pDoc->getNode("/fix/trailer");
if(!pTrailerNode.get())
throw ConfigError("<trailer> section not found in data dictionary");
DOMNodePtr pTrailerFieldNode = pTrailerNode->getFirstChildNode();
if(!pTrailerFieldNode.get()) throw ConfigError("No trailer fields defined");
while(pTrailerFieldNode.get())
{
if(pTrailerFieldNode->getName() == "field" || pTrailerFieldNode->getName() == "group" )
{
DOMAttributesPtr attrs = pTrailerFieldNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError("<field> does not have a name attribute");
std::string required = "false";
attrs->get("required", required);
addTrailerField(lookupXMLFieldNumber(pDoc.get(), name), required == "true");
}
if(pTrailerFieldNode->getName() == "group")
{
DOMAttributesPtr attrs = pTrailerFieldNode->getAttributes();
std::string required;
attrs->get("required", required);
bool isRequired = (required == "Y" || required == "y");
addXMLGroup(pDoc.get(), pTrailerFieldNode.get(), "_trailer_", *this, isRequired);
}
RESET_AUTO_PTR(pTrailerFieldNode, pTrailerFieldNode->getNextSiblingNode());
}
}
// MSGTYPE
DOMNodePtr pMessagesNode = pDoc->getNode("/fix/messages");
if(!pMessagesNode.get())
throw ConfigError("<messages> section not found in data dictionary");
DOMNodePtr pMessageNode = pMessagesNode->getFirstChildNode();
if(!pMessageNode.get()) throw ConfigError("No messages defined");
while(pMessageNode.get())
{
if(pMessageNode->getName() == "message")
{
DOMAttributesPtr attrs = pMessageNode->getAttributes();
std::string msgtype;
if(!attrs->get("msgtype", msgtype))
throw ConfigError("<field> does not have a name attribute");
addMsgType(msgtype);
std::string name;
if(attrs->get("name", name))
addValueName( 35, msgtype, name );
DOMNodePtr pMessageFieldNode = pMessageNode->getFirstChildNode();
while( pMessageFieldNode.get() )
{
if(pMessageFieldNode->getName() == "field"
|| pMessageFieldNode->getName() == "group")
{
DOMAttributesPtr attrs = pMessageFieldNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError("<field> does not have a name attribute");
int num = lookupXMLFieldNumber(pDoc.get(), name);
addMsgField(msgtype, num);
std::string required;
if(attrs->get("required", required)
&& (required == "Y" || required == "y"))
{
addRequiredField(msgtype, num);
}
}
else if(pMessageFieldNode->getName() == "component")
{
DOMAttributesPtr attrs = pMessageFieldNode->getAttributes();
std::string required;
attrs->get("required", required);
bool isRequired = (required == "Y" || required == "y");
addXMLComponentFields(pDoc.get(), pMessageFieldNode.get(),
msgtype, *this, isRequired);
}
if(pMessageFieldNode->getName() == "group")
{
DOMAttributesPtr attrs = pMessageFieldNode->getAttributes();
std::string required;
attrs->get("required", required);
bool isRequired = (required == "Y" || required == "y");
addXMLGroup(pDoc.get(), pMessageFieldNode.get(), msgtype, *this, isRequired);
}
RESET_AUTO_PTR(pMessageFieldNode,
pMessageFieldNode->getNextSiblingNode());
}
}
RESET_AUTO_PTR(pMessageNode, pMessageNode->getNextSiblingNode());
}
}
message_order const& DataDictionary::getOrderedFields() const
{
if( m_orderedFieldsArray ) return m_orderedFieldsArray;
int * tmp = new int[m_orderedFields.size() + 1];
int * i = tmp;
OrderedFields::const_iterator iter;
for( iter = m_orderedFields.begin(); iter != m_orderedFields.end(); *(i++) = *(iter++) ) {}
*i = 0;
m_orderedFieldsArray = message_order(tmp);
delete [] tmp;
return m_orderedFieldsArray;
}
message_order const& DataDictionary::getHeaderOrderedFields() const throw( ConfigError )
{
if( m_headerOrder ) return m_headerOrder;
if (m_headerOrderedFields.size() == 0)
throw ConfigError("<Header> does not have a stored message order");
int * tmp = new int[m_headerOrderedFields.size() + 1];
int * i = tmp;
OrderedFields::const_iterator iter;
for( iter = m_headerOrderedFields.begin(); iter != m_headerOrderedFields.end(); *(i++) = *(iter++) ) {}
*i = 0;
m_headerOrder = message_order(tmp);
delete [] tmp;
return m_headerOrder;
}
message_order const& DataDictionary::getTrailerOrderedFields() const throw( ConfigError )
{
if( m_trailerOrder ) return m_trailerOrder;
if (m_trailerOrderedFields.size() == 0)
throw ConfigError("<Trailer> does not have a stored message order");
int * tmp = new int[m_trailerOrderedFields.size() + 1];
int * i = tmp;
OrderedFields::const_iterator iter;
for( iter = m_trailerOrderedFields.begin(); iter != m_trailerOrderedFields.end(); *(i++) = *(iter++) ) {}
*i = 0;
m_trailerOrder = message_order(tmp);
delete [] tmp;
return m_trailerOrder;
}
const message_order &DataDictionary::getMessageOrderedFields(const std::string & msgType) const throw( ConfigError )
{
MsgTypeToOrderedFields::const_iterator iter = m_messageOrderedFields.find(msgType);
if (iter == m_messageOrderedFields.end())
throw ConfigError("<Message> " + msgType + " does not have a stored message order");
return iter->second.getMessageOrder();
}
int DataDictionary::lookupXMLFieldNumber( DOMDocument* pDoc, DOMNode* pNode ) const
{
DOMAttributesPtr attrs = pNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError("No name given to field");
return lookupXMLFieldNumber( pDoc, name );
}
int DataDictionary::lookupXMLFieldNumber
( DOMDocument* pDoc, const std::string& name ) const
{
NameToField::const_iterator i = m_names.find(name);
if( i == m_names.end() )
throw ConfigError("Field " + name + " not defined in fields section");
return i->second;
}
int DataDictionary::addXMLComponentFields( DOMDocument* pDoc, DOMNode* pNode,
const std::string& msgtype,
DataDictionary& DD,
bool componentRequired )
{
int firstField = 0;
DOMAttributesPtr attrs = pNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError("No name given to component");
DOMNodePtr pComponentNode =
pDoc->getNode("/fix/components/component[@name='" + name + "']");
if(pComponentNode.get() == 0)
throw ConfigError("Component not found: " + name);
DOMNodePtr pComponentFieldNode = pComponentNode->getFirstChildNode();
while(pComponentFieldNode.get())
{
if(pComponentFieldNode->getName() == "field"
|| pComponentFieldNode->getName() == "group")
{
DOMAttributesPtr attrs = pComponentFieldNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError("No name given to field");
int field = lookupXMLFieldNumber(pDoc, name);
if( firstField == 0 ) firstField = field;
std::string required;
if(attrs->get("required", required)
&& (required == "Y" || required =="y")
&& componentRequired)
{
addRequiredField(msgtype, field);
}
DD.addField(field);
DD.addMsgField(msgtype, field);
}
if(pComponentFieldNode->getName() == "component")
{
DOMAttributesPtr attrs = pComponentFieldNode->getAttributes();
std::string required;
attrs->get("required", required);
bool isRequired = (required == "Y" || required == "y");
addXMLComponentFields(pDoc, pComponentFieldNode.get(),
msgtype, DD, isRequired);
}
if(pComponentFieldNode->getName() == "group")
{
DOMAttributesPtr attrs = pComponentFieldNode->getAttributes();
std::string required;
attrs->get("required", required);
bool isRequired = (required == "Y" || required == "y");
addXMLGroup(pDoc, pComponentFieldNode.get(), msgtype, DD, isRequired);
}
RESET_AUTO_PTR(pComponentFieldNode,
pComponentFieldNode->getNextSiblingNode());
}
return firstField;
}
void DataDictionary::addXMLGroup( DOMDocument* pDoc, DOMNode* pNode,
const std::string& msgtype,
DataDictionary& DD, bool groupRequired )
{
DOMAttributesPtr attrs = pNode->getAttributes();
std::string name;
if(!attrs->get("name", name))
throw ConfigError("No name given to group");
int group = lookupXMLFieldNumber( pDoc, name );
int delim = 0;
int field = 0;
DataDictionary groupDD;
DOMNodePtr node = pNode->getFirstChildNode();
while(node.get())
{
if( node->getName() == "field" )
{
field = lookupXMLFieldNumber( pDoc, node.get() );
groupDD.addField( field );
DOMAttributesPtr attrs = node->getAttributes();
std::string required;
if( attrs->get("required", required)
&& ( required == "Y" || required =="y" )
&& groupRequired )
{
groupDD.addRequiredField(msgtype, field);
}
}
else if( node->getName() == "component" )
{
field = addXMLComponentFields( pDoc, node.get(), msgtype, groupDD, false );
}
else if( node->getName() == "group" )
{
field = lookupXMLFieldNumber( pDoc, node.get() );
groupDD.addField( field );
DOMAttributesPtr attrs = node->getAttributes();
std::string required;
if( attrs->get("required", required )
&& ( required == "Y" || required =="y" )
&& groupRequired)
{
groupDD.addRequiredField(msgtype, field);
}
bool isRequired = false;
if( attrs->get("required", required) )
isRequired = (required == "Y" || required == "y");
addXMLGroup( pDoc, node.get(), msgtype, groupDD, isRequired );
}
if( delim == 0 ) delim = field;
RESET_AUTO_PTR(node, node->getNextSiblingNode());
}
if( delim ) DD.addGroup( msgtype, group, delim, groupDD );
}
TYPE::Type DataDictionary::XMLTypeToType( const std::string& type ) const
{
if ( m_beginString < "FIX.4.2" && type == "CHAR" )
return TYPE::String;
if ( type == "STRING" ) return TYPE::String;
if ( type == "CHAR" ) return TYPE::Char;
if ( type == "PRICE" ) return TYPE::Price;
if ( type == "INT" ) return TYPE::Int;
if ( type == "AMT" ) return TYPE::Amt;
if ( type == "QTY" ) return TYPE::Qty;
if ( type == "CURRENCY" ) return TYPE::Currency;
if ( type == "MULTIPLEVALUESTRING" ) return TYPE::MultipleValueString;
if ( type == "MULTIPLESTRINGVALUE" ) return TYPE::MultipleStringValue;
if ( type == "MULTIPLECHARVALUE" ) return TYPE::MultipleCharValue;
if ( type == "EXCHANGE" ) return TYPE::Exchange;
if ( type == "UTCTIMESTAMP" ) return TYPE::UtcTimeStamp;
if ( type == "BOOLEAN" ) return TYPE::Boolean;
if ( type == "LOCALMKTDATE" ) return TYPE::LocalMktDate;
if ( type == "DATA" ) return TYPE::Data;
if ( type == "FLOAT" ) return TYPE::Float;
if ( type == "PRICEOFFSET" ) return TYPE::PriceOffset;
if ( type == "MONTHYEAR" ) return TYPE::MonthYear;
if ( type == "DAYOFMONTH" ) return TYPE::DayOfMonth;
if ( type == "UTCDATE" ) return TYPE::UtcDate;
if ( type == "UTCDATEONLY" ) return TYPE::UtcDateOnly;
if ( type == "UTCTIMEONLY" ) return TYPE::UtcTimeOnly;
if ( type == "NUMINGROUP" ) return TYPE::NumInGroup;
if ( type == "PERCENTAGE" ) return TYPE::Percentage;
if ( type == "SEQNUM" ) return TYPE::SeqNum;
if ( type == "LENGTH" ) return TYPE::Length;
if ( type == "COUNTRY" ) return TYPE::Country;
if ( type == "TIME" ) return TYPE::UtcTimeStamp;
return TYPE::Unknown;
}
}
FIX::DataDictionary::m_orderedFieldsArray
OrderedFieldsArray m_orderedFieldsArray
Definition: DataDictionary.h:612
FIX::FieldMap
Stores and organizes a collection of Fields.
Definition: FieldMap.h:63
FIX::DataDictionary::m_checkFieldsHaveValues
bool m_checkFieldsHaveValues
Definition: DataDictionary.h:601
FIX::DataDictionary::checkGroupCount
void checkGroupCount(const FieldBase &field, const FieldMap &fieldMap, const MsgType &msgType) const
Check if group count matches number of groups in.
Definition: DataDictionary.h:535
FIX::DataDictionary::m_trailerFields
NonBodyFields m_trailerFields
Definition: DataDictionary.h:614
FIX::DataDictionary::m_orderedFields
OrderedFields m_orderedFields
Definition: DataDictionary.h:611
FIX::DataDictionary::getTrailerOrderedFields
message_order const & getTrailerOrderedFields() const
Definition: DataDictionary.cpp:478
FIX::DataDictionary::readFromDocument
void readFromDocument(const DOMDocumentPtr &pDoc)
Definition: DataDictionary.cpp:234
FIX::DOMAttributesPtr
SmartPtr< DOMAttributes > DOMAttributesPtr
Definition: DOMDocument.h:45
FIX::TYPE::LocalMktDate
@ LocalMktDate
Definition: FieldTypes.h:942
FIX::TYPE::SeqNum
@ SeqNum
Definition: FieldTypes.h:953
FIX::TYPE::Percentage
@ Percentage
Definition: FieldTypes.h:952
FIX::DataDictionary::checkIsInMessage
void checkIsInMessage(const FieldBase &field, const MsgType &msgType) const
Check if a field is in this message type.
Definition: DataDictionary.h:526
FIX::TYPE::UtcDate
@ UtcDate
Definition: FieldTypes.h:948
FIX::DataDictionary::readFromStream
void readFromStream(std::istream &stream)
Definition: DataDictionary.cpp:223
FIX::Exception
Base QuickFIX exception type.
Definition: Exceptions.h:50
FIX::TYPE::PriceOffset
@ PriceOffset
Definition: FieldTypes.h:945
FIX::TYPE::Price
@ Price
Definition: FieldTypes.h:931
FIX::TYPE::Char
@ Char
Definition: FieldTypes.h:930
FIX::DataDictionary::m_dataFields
MsgFields m_dataFields
Definition: DataDictionary.h:621
FIX::TYPE::NumInGroup
@ NumInGroup
Definition: FieldTypes.h:951
FIX::DataDictionary::getMessageOrderedFields
message_order const & getMessageOrderedFields(const std::string &msgType) const
Definition: DataDictionary.cpp:498
FIX::TYPE::Int
@ Int
Definition: FieldTypes.h:932
FIX::DataDictionary::m_storeMsgFieldsOrder
bool m_storeMsgFieldsOrder
Definition: DataDictionary.h:604
FIX::DataDictionary::m_trailerOrderedFields
OrderedFields m_trailerOrderedFields
Definition: DataDictionary.h:624
FIX::UnsupportedVersion
Version of FIX is not supported.
Definition: Exceptions.h:200
FIX::TYPE::MultipleValueString
@ MultipleValueString
Definition: FieldTypes.h:936
FIX::DataDictionary::operator=
DataDictionary & operator=(const DataDictionary &rhs)
Definition: DataDictionary.cpp:80
FIX::TYPE::DayOfMonth
@ DayOfMonth
Definition: FieldTypes.h:947
FIX::PUGIXML_DOMDocument
XML document as represented by pugixml.
Definition: PUGIXML_DOMDocument.h:81
FIX::FieldMap::begin
iterator begin()
Definition: FieldMap.h:292
FIX::DataDictionary::m_beginString
BeginString m_beginString
Definition: DataDictionary.h:606
FIX::TYPE::Boolean
@ Boolean
Definition: FieldTypes.h:941
FIX::DataDictionary::m_fieldValues
FieldToValue m_fieldValues
Definition: DataDictionary.h:616
FIX::ConfigError
Application is not configured correctly
Definition: Exceptions.h:104
FIX::DataDictionary::m_checkFieldsOutOfOrder
bool m_checkFieldsOutOfOrder
Definition: DataDictionary.h:600
FIX::InvalidMessageType
Not a known message type.
Definition: Exceptions.h:186
FIX::DataDictionary::m_messages
MsgTypes m_messages
Definition: DataDictionary.h:609
FIX::DataDictionary::readFromURL
void readFromURL(const std::string &url)
Definition: DataDictionary.cpp:205
FIX::DataDictionary::m_names
NameToField m_names
Definition: DataDictionary.h:618
FIX::DataDictionary::m_allowUnknownMessageFields
bool m_allowUnknownMessageFields
Definition: DataDictionary.h:603
FIX::TYPE::Currency
@ Currency
Definition: FieldTypes.h:935
FIX::DataDictionary::m_messageOrderedFields
MsgTypeToOrderedFields m_messageOrderedFields
Definition: DataDictionary.h:626
FIX::DataDictionary::m_trailerOrder
OrderedFieldsArray m_trailerOrder
Definition: DataDictionary.h:625
FIX::TYPE::UtcTimeStamp
@ UtcTimeStamp
Definition: FieldTypes.h:940
FIX::Message::isTrailerField
static bool isTrailerField(int field)
Definition: Message.cpp:567
FIX::DOMNodePtr
SmartPtr< DOMNode > DOMNodePtr
Definition: DOMDocument.h:59
RESET_AUTO_PTR
#define RESET_AUTO_PTR(OLD, NEW)
Definition: DataDictionary.cpp:36
FIX::DataDictionary::addXMLGroup
void addXMLGroup(DOMDocument *, DOMNode *, const std::string &msgtype, DataDictionary &, bool)
Definition: DataDictionary.cpp:589
FIX::DataDictionary::checkValidTagNumber
void checkValidTagNumber(const FieldBase &field) const
Check if field tag number is defined in spec.
Definition: DataDictionary.h:423
FIX::TYPE::Amt
@ Amt
Definition: FieldTypes.h:933
FIX::DOMNode::getAttributes
virtual SmartPtr< DOMAttributes > getAttributes()=0
FIX::DataDictionary::addField
void addField(int field)
Definition: DataDictionary.h:156
FIX::TYPE::Float
@ Float
Definition: FieldTypes.h:944
FIX::DataDictionary::getHeaderOrderedFields
message_order const & getHeaderOrderedFields() const
Definition: DataDictionary.cpp:458
FIX::DataDictionary::m_valueNames
ValueToName m_valueNames
Definition: DataDictionary.h:619
FIX::DataDictionary::getOrderedFields
message_order const & getOrderedFields() const
Definition: DataDictionary.cpp:441
FIX::DataDictionary::m_messageFields
MsgTypeToField m_messageFields
Definition: DataDictionary.h:607
FIX::FieldBase::getTag
int getTag() const
Get the fields integer tag.
Definition: Field.h:178
FIX::DataDictionary::m_headerOrderedFields
OrderedFields m_headerOrderedFields
Definition: DataDictionary.h:622
FIX::DOMDocument
Interface that represents document of underlying XML parser.
Definition: DOMDocument.h:62
PUGIXML_DOMDocument.h
FIX::DataDictionary::addXMLComponentFields
int addXMLComponentFields(DOMDocument *, DOMNode *, const std::string &msgtype, DataDictionary &, bool)
Definition: DataDictionary.cpp:525
FIX::TYPE::UtcTimeOnly
@ UtcTimeOnly
Definition: FieldTypes.h:950
FIX::DataDictionary::lookupXMLFieldNumber
int lookupXMLFieldNumber(DOMDocument *, DOMNode *) const
Definition: DataDictionary.cpp:507
FIX::DOMNode::getFirstChildNode
virtual SmartPtr< DOMNode > getFirstChildNode()=0
FIX::TYPE::String
@ String
Definition: FieldTypes.h:929
FIX::DataDictionary::FieldPresenceMap
std::map< std::string, std::pair< int, DataDictionary * > > FieldPresenceMap
Definition: DataDictionary.h:126
FIX::DataDictionary::XMLTypeToType
TYPE::Type XMLTypeToType(const std::string &xmlType) const
Definition: DataDictionary.cpp:646
FIX::DataDictionary::validate
static void validate(const Message &message, const DataDictionary *const pSessionDD, const DataDictionary *const pAppID)
Validate a message.
Definition: DataDictionary.cpp:123
FIX::TYPE::Length
@ Length
Definition: FieldTypes.h:954
FIX::DataDictionary::m_groups
FieldToGroup m_groups
Definition: DataDictionary.h:620
FIX::DataDictionary::shouldCheckTag
bool shouldCheckTag(const FieldBase &field) const
If we need to check for the tag in the dictionary.
Definition: DataDictionary.h:412
FIX::DataDictionary::m_fieldTypes
FieldTypes m_fieldTypes
Definition: DataDictionary.h:615
FIX::DOMDocumentPtr
SmartPtr< DOMDocument > DOMDocumentPtr
Definition: DOMDocument.h:73
FIX::Message
Base class for all FIX messages.
Definition: Message.h:134
FIX::TYPE::Data
@ Data
Definition: FieldTypes.h:943
FIX::TYPE::Exchange
@ Exchange
Definition: FieldTypes.h:939
FIX
Definition: Acceptor.cpp:34
FIX::DataDictionary
Represents a data dictionary for a version of FIX.
Definition: DataDictionary.h:66
FIX::DOMNode
Interface that represents node from underlying XML parser.
Definition: DOMDocument.h:48
FIX::DataDictionary::m_hasVersion
bool m_hasVersion
Definition: DataDictionary.h:599
FIX::TYPE::MonthYear
@ MonthYear
Definition: FieldTypes.h:946
FIX::DataDictionary::~DataDictionary
virtual ~DataDictionary()
Definition: DataDictionary.cpp:67
FIX::Header
Definition: Message.h:58
FIX::Message::isHeaderField
static bool isHeaderField(int field)
Definition: Message.cpp:514
FIX::DataDictionary::checkHasValue
void checkHasValue(const FieldBase &field) const
Check if a field has a value.
Definition: DataDictionary.h:517
FIX::DataDictionary::checkValue
void checkValue(const FieldBase &field) const
Definition: DataDictionary.h:506
FIX::DataDictionary::m_checkUserDefinedFields
bool m_checkUserDefinedFields
Definition: DataDictionary.h:602
FIX::FieldMap::end
iterator end()
Definition: FieldMap.h:293
FIX::DataDictionary::m_requiredFields
MsgTypeToField m_requiredFields
Definition: DataDictionary.h:608
FIX::TYPE::Unknown
@ Unknown
Definition: FieldTypes.h:928
FIX::FieldBase
Base representation of all Field classes.
Definition: Field.h:66
FIX::TYPE::Qty
@ Qty
Definition: FieldTypes.h:934
FIX::TYPE::Country
@ Country
Definition: FieldTypes.h:955
FIX::DataDictionary::m_fieldNames
FieldToName m_fieldNames
Definition: DataDictionary.h:617
FIX::DataDictionary::addGroup
void addGroup(const std::string &msg, int field, int delim, const DataDictionary &dataDictionary)
Definition: DataDictionary.h:322
FIX::message_order
Sorts fields in header, normal, or trailer order.
Definition: MessageSorters.h:130
FIX::DataDictionary::m_headerFields
NonBodyFields m_headerFields
Definition: DataDictionary.h:613
FIX::TYPE::UtcDateOnly
@ UtcDateOnly
Definition: FieldTypes.h:949
FIELD_GET_REF
#define FIELD_GET_REF(MAP, FLD)
Definition: FieldMap.h:376
FIX::DataDictionary::checkValidFormat
void checkValidFormat(const FieldBase &field) const
Definition: DataDictionary.h:430
FIX::DataDictionary::m_fields
Fields m_fields
Definition: DataDictionary.h:610
FIX::DataDictionary::addRequiredField
void addRequiredField(const std::string &msgType, int field)
Definition: DataDictionary.h:276
FIX::DataDictionary::iterate
void iterate(const FieldMap &map, const MsgType &msgType) const
Iterate through fields while applying checks.
Definition: DataDictionary.cpp:173
FIX::TagOutOfOrder
Tag is not in the correct order.
Definition: Exceptions.h:207
FIX::DOMDocument::getNode
virtual SmartPtr< DOMNode > getNode(const std::string &)=0
FIX::TYPE::Type
Type
Definition: FieldTypes.h:926
FIX::RepeatedTag
Repeated tag not part of repeating group.
Definition: Exceptions.h:216
FIX::DataDictionary::DataDictionary
DataDictionary()
Definition: DataDictionary.cpp:41
FIX::DataDictionary::m_headerOrder
OrderedFieldsArray m_headerOrder
Definition: DataDictionary.h:623
FIX::DataDictionary::addMsgField
void addMsgField(const std::string &msgType, int field)
Definition: DataDictionary.h:213
Message.h
FIX::TYPE::MultipleCharValue
@ MultipleCharValue
Definition: FieldTypes.h:938
FIX::FieldMap::const_iterator
Fields::const_iterator const_iterator
Definition: FieldMap.h:134
FIX::TYPE::MultipleStringValue
@ MultipleStringValue
Definition: FieldTypes.h:937
DataDictionary.h