DataDictionary.h
Go to the documentation of this file.
/* -*- C++ -*- */
/****************************************************************************
** 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.
**
****************************************************************************/
#ifndef FIX_DATADICTIONARY_H
#define FIX_DATADICTIONARY_H
#ifdef _MSC_VER
#pragma warning( disable : 4503 4355 4786 4290 )
#endif
#include "Fields.h"
#include "FieldMap.h"
#include "DOMDocument.h"
#include "Exceptions.h"
#include <set>
#include <map>
#include <string.h>
namespace FIX
{
class FieldMap;
class Message;
class DataDictionary
{
typedef std::set < int > MsgFields;
typedef std::map < std::string, MsgFields > MsgTypeToField;
typedef std::set < std::string > MsgTypes;
typedef std::set < int > Fields;
typedef std::map < int, bool > NonBodyFields;
typedef std::vector< int > OrderedFields;
typedef message_order OrderedFieldsArray;
typedef std::map < int, TYPE::Type > FieldTypes;
typedef std::set < std::string > Values;
typedef std::map < int, Values > FieldToValue;
typedef std::map < int, std::string > FieldToName;
typedef std::map < std::string, int > NameToField;
typedef std::map < std::pair < int, std::string > , std::string > ValueToName;
// while FieldToGroup structure seems to be overcomplicated
// in reality it yields a lot of performance because:
// 1) avoids memory copying;
// 2) first lookup is done by comparing integers and not string objects
// TODO: use hash_map with good hashing algorithm
typedef std::map < std::string, std::pair < int, DataDictionary* > > FieldPresenceMap;
typedef std::map < int, FieldPresenceMap > FieldToGroup;
public:
DataDictionary();
DataDictionary( const DataDictionary& copy );
DataDictionary( std::istream& stream ) throw( ConfigError );
DataDictionary( const std::string& url ) throw( ConfigError );
virtual ~DataDictionary();
void readFromURL( const std::string& url ) throw( ConfigError );
void readFromDocument( DOMDocumentPtr pDoc ) throw( ConfigError );
void readFromStream( std::istream& stream ) throw( ConfigError );
message_order const& getOrderedFields() const;
// storage functions
void setVersion( const std::string& beginString )
{
m_beginString = beginString;
m_hasVersion = true;
}
std::string getVersion() const
{
return m_beginString.getString();
}
void addField( int field )
{
m_fields.insert( field );
m_orderedFields.push_back( field );
}
void addFieldName( int field, const std::string& name )
{
if( m_names.insert( std::make_pair(name, field) ).second == false )
throw ConfigError( "Field named " + name + " defined multiple times" );
m_fieldNames[field] = name;
}
bool getFieldName( int field, std::string& name ) const
{
FieldToName::const_iterator i = m_fieldNames.find( field );
if(i == m_fieldNames.end()) return false;
name = i->second;
return true;
}
bool getFieldTag( const std::string& name, int& field ) const
{
NameToField::const_iterator i = m_names.find( name );
if(i == m_names.end()) return false;
field = i->second;
return true;
}
void addValueName( int field, const std::string& value, const std::string& name )
{
m_valueNames[std::make_pair(field, value)] = name;
}
bool getValueName( int field, const std::string& value, std::string& name ) const
{
ValueToName::const_iterator i = m_valueNames.find( std::make_pair(field, value) );
if(i == m_valueNames.end()) return false;
name = i->second;
return true;
}
bool isField( int field ) const
{
return m_fields.find( field ) != m_fields.end();
}
void addMsgType( const std::string& msgType )
{
m_messages.insert( msgType );
}
bool isMsgType( const std::string& msgType ) const
{
return m_messages.find( msgType ) != m_messages.end();
}
void addMsgField( const std::string& msgType, int field )
{
m_messageFields[ msgType ].insert( field );
}
bool isMsgField( const std::string& msgType, int field ) const
{
MsgTypeToField::const_iterator i = m_messageFields.find( msgType );
if ( i == m_messageFields.end() ) return false;
return i->second.find( field ) != i->second.end();
}
void addHeaderField( int field, bool required )
{
m_headerFields[ field ] = required;
}
bool isHeaderField( int field ) const
{
return m_headerFields.find( field ) != m_headerFields.end();
}
void addTrailerField( int field, bool required )
{
m_trailerFields[ field ] = required;
}
bool isTrailerField( int field ) const
{
return m_trailerFields.find( field ) != m_trailerFields.end();
}
void addFieldType( int field, FIX::TYPE::Type type )
{
m_fieldTypes[ field ] = type;
if( type == FIX::TYPE::Data )
m_dataFields.insert( field );
}
bool getFieldType( int field, FIX::TYPE::Type& type ) const
{
FieldTypes::const_iterator i = m_fieldTypes.find( field );
if ( i == m_fieldTypes.end() ) return false;
type = i->second;
return true;
}
void addRequiredField( const std::string& msgType, int field )
{
m_requiredFields[ msgType ].insert( field );
}
bool isRequiredField( const std::string& msgType, int field ) const
{
MsgTypeToField::const_iterator i = m_requiredFields.find( msgType );
if ( i == m_requiredFields.end() ) return false;
return i->second.find( field ) != i->second.end();
}
void addFieldValue( int field, const std::string& value )
{
m_fieldValues[ field ].insert( value );
}
bool hasFieldValue( int field ) const
{
FieldToValue::const_iterator i = m_fieldValues.find( field );
return i != m_fieldValues.end();
}
bool isFieldValue( int field, const std::string& value ) const
{
FieldToValue::const_iterator i = m_fieldValues.find( field );
if ( i == m_fieldValues.end() )
return false;
if( !isMultipleValueField( field ) )
return i->second.find( value ) != i->second.end();
// MultipleValue
std::string::size_type startPos = 0;
std::string::size_type endPos = 0;
do
{
endPos = value.find_first_of(' ', startPos);
std::string singleValue =
value.substr( startPos, endPos - startPos );
if( i->second.find( singleValue ) == i->second.end() )
return false;
startPos = endPos + 1;
} while( endPos != std::string::npos );
return true;
}
void addGroup( const std::string& msg, int field, int delim,
const DataDictionary& dataDictionary )
{
DataDictionary * pDD = new DataDictionary( dataDictionary );
pDD->setVersion( getVersion() );
FieldPresenceMap& presenceMap = m_groups[ field ];
presenceMap[ msg ] = std::make_pair( delim, pDD );
}
bool isGroup( const std::string& msg, int field ) const
{
FieldToGroup::const_iterator i = m_groups.find( field );
if ( i == m_groups.end() ) return false;
const FieldPresenceMap& presenceMap = i->second;
FieldPresenceMap::const_iterator iter = presenceMap.find( msg );
return ( iter != presenceMap.end() );
}
bool getGroup( const std::string& msg, int field, int& delim,
const DataDictionary*& pDataDictionary ) const
{
FieldToGroup::const_iterator i = m_groups.find( field );
if ( i == m_groups.end() ) return false;
const FieldPresenceMap& presenceMap = i->second;
FieldPresenceMap::const_iterator iter = presenceMap.find( msg );
if( iter == presenceMap.end() ) return false;
std::pair < int, DataDictionary* > pair = iter->second;
delim = pair.first;
pDataDictionary = pair.second;
return true;
}
bool isDataField( int field ) const
{
MsgFields::const_iterator iter = m_dataFields.find( field );
return iter != m_dataFields.end();
}
bool isMultipleValueField( int field ) const
{
FieldTypes::const_iterator i = m_fieldTypes.find( field );
return i != m_fieldTypes.end()
&& (i->second == TYPE::MultipleValueString
|| i->second == TYPE::MultipleCharValue
|| i->second == TYPE::MultipleStringValue );
}
void checkFieldsOutOfOrder( bool value )
{ m_checkFieldsOutOfOrder = value; }
void checkFieldsHaveValues( bool value )
{ m_checkFieldsHaveValues = value; }
void checkUserDefinedFields( bool value )
{ m_checkUserDefinedFields = value; }
static void validate( const Message& message,
const DataDictionary* const pSessionDD,
const DataDictionary* const pAppID ) throw( FIX::Exception );
void validate( const Message& message ) const throw ( FIX::Exception )
{ validate( message, false ); }
void validate( const Message& message, bool bodyOnly ) const throw( FIX::Exception )
{ validate( message, bodyOnly ? (DataDictionary*)0 : this, this ); }
DataDictionary& operator=( const DataDictionary& rhs );
private:
void iterate( const FieldMap& map, const MsgType& msgType ) const;
void checkMsgType( const MsgType& msgType ) const
{
if ( !isMsgType( msgType.getValue() ) )
throw InvalidMessageType();
}
bool shouldCheckTag( const FieldBase& field ) const
{
if( !m_checkUserDefinedFields && field.getField() >= FIELD::UserMin )
return false;
else
return true;
}
void checkValidTagNumber( const FieldBase& field ) const
throw( InvalidTagNumber )
{
if( m_fields.find( field.getField() ) == m_fields.end() )
throw InvalidTagNumber( field.getField() );
}
void checkValidFormat( const FieldBase& field ) const
throw( IncorrectDataFormat )
{
try
{
TYPE::Type type = TYPE::Unknown;
getFieldType( field.getField(), type );
switch ( type )
{
case TYPE::String:
STRING_CONVERTOR::convert( field.getString() ); break;
case TYPE::Char:
CHAR_CONVERTOR::convert( field.getString() ); break;
case TYPE::Price:
PRICE_CONVERTOR::convert( field.getString() ); break;
case TYPE::Int:
INT_CONVERTOR::convert( field.getString() ); break;
case TYPE::Amt:
AMT_CONVERTOR::convert( field.getString() ); break;
case TYPE::Qty:
QTY_CONVERTOR::convert( field.getString() ); break;
case TYPE::Currency:
CURRENCY_CONVERTOR::convert( field.getString() ); break;
case TYPE::MultipleValueString:
MULTIPLEVALUESTRING_CONVERTOR::convert( field.getString() ); break;
case TYPE::MultipleStringValue:
MULTIPLESTRINGVALUE_CONVERTOR::convert( field.getString() ); break;
case TYPE::MultipleCharValue:
MULTIPLECHARVALUE_CONVERTOR::convert( field.getString() ); break;
case TYPE::Exchange:
EXCHANGE_CONVERTOR::convert( field.getString() ); break;
case TYPE::UtcTimeStamp:
UTCTIMESTAMP_CONVERTOR::convert( field.getString() ); break;
case TYPE::Boolean:
BOOLEAN_CONVERTOR::convert( field.getString() ); break;
case TYPE::LocalMktDate:
LOCALMKTDATE_CONVERTOR::convert( field.getString() ); break;
case TYPE::Data:
DATA_CONVERTOR::convert( field.getString() ); break;
case TYPE::Float:
FLOAT_CONVERTOR::convert( field.getString() ); break;
case TYPE::PriceOffset:
PRICEOFFSET_CONVERTOR::convert( field.getString() ); break;
case TYPE::MonthYear:
MONTHYEAR_CONVERTOR::convert( field.getString() ); break;
case TYPE::DayOfMonth:
DAYOFMONTH_CONVERTOR::convert( field.getString() ); break;
case TYPE::UtcDate:
UTCDATE_CONVERTOR::convert( field.getString() ); break;
case TYPE::UtcTimeOnly:
UTCTIMEONLY_CONVERTOR::convert( field.getString() ); break;
case TYPE::NumInGroup:
NUMINGROUP_CONVERTOR::convert( field.getString() ); break;
case TYPE::Percentage:
PERCENTAGE_CONVERTOR::convert( field.getString() ); break;
case TYPE::SeqNum:
SEQNUM_CONVERTOR::convert( field.getString() ); break;
case TYPE::Length:
LENGTH_CONVERTOR::convert( field.getString() ); break;
case TYPE::Country:
COUNTRY_CONVERTOR::convert( field.getString() ); break;
case TYPE::TzTimeOnly:
TZTIMEONLY_CONVERTOR::convert( field.getString() ); break;
case TYPE::TzTimeStamp:
TZTIMESTAMP_CONVERTOR::convert( field.getString() ); break;
case TYPE::XmlData:
XMLDATA_CONVERTOR::convert( field.getString() ); break;
case TYPE::Language:
LANGUAGE_CONVERTOR::convert( field.getString() ); break;
case TYPE::Unknown: break;
}
}
catch ( FieldConvertError& )
{ throw IncorrectDataFormat( field.getField(), field.getString() ); }
}
void checkValue( const FieldBase& field ) const
throw( IncorrectTagValue )
{
if ( !hasFieldValue( field.getField() ) ) return ;
const std::string& value = field.getString();
if ( !isFieldValue( field.getField(), value ) )
throw IncorrectTagValue( field.getField() );
}
void checkHasValue( const FieldBase& field ) const
throw( NoTagValue )
{
if ( m_checkFieldsHaveValues && !field.getString().length() )
throw NoTagValue( field.getField() );
}
void checkIsInMessage
( const FieldBase& field, const MsgType& msgType ) const
throw( TagNotDefinedForMessage )
{
if ( !isMsgField( msgType, field.getField() ) )
throw TagNotDefinedForMessage( field.getField() );
}
void checkGroupCount
( const FieldBase& field, const FieldMap& fieldMap, const MsgType& msgType ) const
throw( RepeatingGroupCountMismatch )
{
int fieldNum = field.getField();
if( isGroup(msgType, fieldNum) )
{
if( (int)fieldMap.groupCount(fieldNum)
!= IntConvertor::convert(field.getString()) )
throw RepeatingGroupCountMismatch(fieldNum);
}
}
void checkHasRequired
( const FieldMap& header, const FieldMap& body, const FieldMap& trailer,
const MsgType& msgType ) const
throw( RequiredTagMissing )
{
NonBodyFields::const_iterator iNBF;
for( iNBF = m_headerFields.begin(); iNBF != m_headerFields.end(); ++iNBF )
{
if( iNBF->second == true && !header.isSetField(iNBF->first) )
throw RequiredTagMissing( iNBF->first );
}
for( iNBF = m_trailerFields.begin(); iNBF != m_trailerFields.end(); ++iNBF )
{
if( iNBF->second == true && !trailer.isSetField(iNBF->first) )
throw RequiredTagMissing( iNBF->first );
}
MsgTypeToField::const_iterator iM
= m_requiredFields.find( msgType.getString() );
if ( iM == m_requiredFields.end() ) return ;
const MsgFields& fields = iM->second;
MsgFields::const_iterator iF;
for( iF = fields.begin(); iF != fields.end(); ++iF )
{
if( !body.isSetField(*iF) )
throw RequiredTagMissing( *iF );
}
FieldMap::g_iterator groups;
for( groups = body.g_begin(); groups != body.g_end(); ++groups )
{
int delim;
const DataDictionary* DD = 0;
int field = groups->first;
if( getGroup( msgType.getValue(), field, delim, DD ) )
{
std::vector<FieldMap*>::const_iterator group;
for( group = groups->second.begin(); group != groups->second.end(); ++group )
DD->checkHasRequired( **group, **group, **group, msgType );
}
}
}
int lookupXMLFieldNumber( DOMDocument*, DOMNode* ) const;
int lookupXMLFieldNumber( DOMDocument*, const std::string& name ) const;
int addXMLComponentFields( DOMDocument*, DOMNode*, const std::string& msgtype, DataDictionary&, bool );
void addXMLGroup( DOMDocument*, DOMNode*, const std::string& msgtype, DataDictionary&, bool );
TYPE::Type XMLTypeToType( const std::string& xmlType ) const;
bool m_hasVersion;
bool m_checkFieldsOutOfOrder;
bool m_checkFieldsHaveValues;
bool m_checkUserDefinedFields;
BeginString m_beginString;
MsgTypeToField m_messageFields;
MsgTypeToField m_requiredFields;
MsgTypes m_messages;
Fields m_fields;
OrderedFields m_orderedFields;
mutable OrderedFieldsArray m_orderedFieldsArray;
NonBodyFields m_headerFields;
NonBodyFields m_trailerFields;
FieldTypes m_fieldTypes;
FieldToValue m_fieldValues;
FieldToName m_fieldNames;
NameToField m_names;
ValueToName m_valueNames;
FieldToGroup m_groups;
MsgFields m_dataFields;
};
}
#endif //FIX_DATADICTIONARY_H
FIX::DataDictionary::isRequiredField
bool isRequiredField(const std::string &msgType, int field) const
Definition: DataDictionary.h:206
FIX::DataDictionary::Values
std::set< std::string > Values
Definition: DataDictionary.h:59
FIX::DataDictionary::m_requiredFields
MsgTypeToField m_requiredFields
Definition: DataDictionary.h:522
FIX::TYPE::Country
Definition: FieldTypes.h:689
FIX::FieldMap::isSetField
bool isSetField(const FieldBase &field) const
Check to see if a field is set.
Definition: FieldMap.h:144
FIX::FieldConvertError
Unable to convert field into its native format.
Definition: Exceptions.h:66
FIX::DataDictionary::m_checkFieldsHaveValues
bool m_checkFieldsHaveValues
Definition: DataDictionary.h:518
FIX::UtcTimeOnlyConvertor::convert
static std::string convert(const UtcTimeOnly &value, bool showMilliseconds=false)
Definition: FieldConvertors.h:689
FIX::TYPE::MultipleStringValue
Definition: FieldTypes.h:671
FIX::IncorrectDataFormat
Field has a badly formatted value.
Definition: Exceptions.h:146
FIX::DataDictionary::MsgTypes
std::set< std::string > MsgTypes
Definition: DataDictionary.h:53
FIX::CharConvertor::convert
static std::string convert(char value)
Definition: FieldConvertors.h:506
FIX::DataDictionary::m_names
NameToField m_names
Definition: DataDictionary.h:532
FIX::TYPE::Boolean
Definition: FieldTypes.h:675
FIX::DataDictionary::m_checkUserDefinedFields
bool m_checkUserDefinedFields
Definition: DataDictionary.h:519
FIX::UtcTimeStampConvertor::convert
static std::string convert(const UtcTimeStamp &value, bool showMilliseconds=false)
Definition: FieldConvertors.h:566
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:452
FIX::TYPE::Currency
Definition: FieldTypes.h:669
FIX::RepeatingGroupCountMismatch
Repeated group count not equal to actual count.
Definition: Exceptions.h:208
FIX::FieldBase::getString
const std::string & getString() const
Get the string representation of the fields value.
Definition: Field.h:112
FIX::DataDictionary
Represents a data dictionary for a version of FIX.
Definition: DataDictionary.h:49
FIX::DataDictionary::hasFieldValue
bool hasFieldValue(int field) const
Definition: DataDictionary.h:218
FIX::DataDictionary::iterate
void iterate(const FieldMap &map, const MsgType &msgType) const
Iterate through fields while applying checks.
Definition: DataDictionary.cpp:159
FIX::DataDictionary::NonBodyFields
std::map< int, bool > NonBodyFields
Definition: DataDictionary.h:55
FIX::DataDictionary::FieldToGroup
std::map< int, FieldPresenceMap > FieldToGroup
Definition: DataDictionary.h:70
FIX::DataDictionary::m_orderedFields
OrderedFields m_orderedFields
Definition: DataDictionary.h:525
FIX::FieldMap::g_iterator
Groups::const_iterator g_iterator
Definition: FieldMap.h:61
FIX::DataDictionary::isDataField
bool isDataField(int field) const
Definition: DataDictionary.h:285
FIX::DataDictionary::MsgTypeToField
std::map< std::string, MsgFields > MsgTypeToField
Definition: DataDictionary.h:52
FIX::DataDictionary::addGroup
void addGroup(const std::string &msg, int field, int delim, const DataDictionary &dataDictionary)
Definition: DataDictionary.h:247
FIX::DataDictionary::getGroup
bool getGroup(const std::string &msg, int field, int &delim, const DataDictionary *&pDataDictionary) const
Definition: DataDictionary.h:268
FIX::TYPE::Unknown
Definition: FieldTypes.h:662
FIX::TYPE::Amt
Definition: FieldTypes.h:667
FIX::TYPE::UtcTimeOnly
Definition: FieldTypes.h:684
FIX::TYPE::TzTimeStamp
Definition: FieldTypes.h:691
FIX::DataDictionary::m_headerFields
NonBodyFields m_headerFields
Definition: DataDictionary.h:527
FIX::TYPE::UtcDate
Definition: FieldTypes.h:682
FIX::DataDictionary::readFromDocument
void readFromDocument(DOMDocumentPtr pDoc)
Definition: DataDictionary.cpp:220
FIX::DataDictionary::NameToField
std::map< std::string, int > NameToField
Definition: DataDictionary.h:62
FIX::DataDictionary::checkValidFormat
void checkValidFormat(const FieldBase &field) const
Definition: DataDictionary.h:347
FIX::TYPE::LocalMktDate
Definition: FieldTypes.h:676
FIX::DataDictionary::addMsgField
void addMsgField(const std::string &msgType, int field)
Definition: DataDictionary.h:153
FIX::DataDictionary::m_fieldNames
FieldToName m_fieldNames
Definition: DataDictionary.h:531
FIX::DataDictionary::addTrailerField
void addTrailerField(int field, bool required)
Definition: DataDictionary.h:175
FIX::TYPE::Exchange
Definition: FieldTypes.h:673
FIX::DataDictionary::m_beginString
BeginString m_beginString
Definition: DataDictionary.h:520
FIX::DataDictionary::FieldToValue
std::map< int, Values > FieldToValue
Definition: DataDictionary.h:60
FIX::DataDictionary::m_fields
Fields m_fields
Definition: DataDictionary.h:524
FIX::DataDictionary::m_messages
MsgTypes m_messages
Definition: DataDictionary.h:523
FIX::DataDictionary::addXMLGroup
void addXMLGroup(DOMDocument *, DOMNode *, const std::string &msgtype, DataDictionary &, bool)
Definition: DataDictionary.cpp:526
FIX::DataDictionary::getFieldType
bool getFieldType(int field, FIX::TYPE::Type &type) const
Definition: DataDictionary.h:193
FIX::DataDictionary::isHeaderField
bool isHeaderField(int field) const
Definition: DataDictionary.h:170
FIX::DataDictionary::readFromURL
void readFromURL(const std::string &url)
Definition: DataDictionary.cpp:191
FIX::DataDictionary::isMsgType
bool isMsgType(const std::string &msgType) const
Definition: DataDictionary.h:148
FIX::DataDictionary::validate
void validate(const Message &message, bool bodyOnly) const
Definition: DataDictionary.h:314
FIX::DataDictionary::m_messageFields
MsgTypeToField m_messageFields
Definition: DataDictionary.h:521
FIX::InvalidTagNumber
Tag number does not exist in specification.
Definition: Exceptions.h:101
FIX::DataDictionary::validate
void validate(const Message &message) const
Definition: DataDictionary.h:312
FIX::IntConvertor::convert
static std::string convert(signed_int value)
Definition: FieldConvertors.h:154
FIX::DataDictionary::checkIsInMessage
void checkIsInMessage(const FieldBase &field, const MsgType &msgType) const
Check if a field is in this message type.
Definition: DataDictionary.h:443
FIX::DataDictionary::getValueName
bool getValueName(int field, const std::string &value, std::string &name) const
Definition: DataDictionary.h:130
FIX::DataDictionary::isMultipleValueField
bool isMultipleValueField(int field) const
Definition: DataDictionary.h:291
FIX::DataDictionary::m_fieldValues
FieldToValue m_fieldValues
Definition: DataDictionary.h:530
FIX::DataDictionary::readFromStream
void readFromStream(std::istream &stream)
Definition: DataDictionary.cpp:209
FIX::DataDictionary::isMsgField
bool isMsgField(const std::string &msgType, int field) const
Definition: DataDictionary.h:158
FIX::DataDictionary::addXMLComponentFields
int addXMLComponentFields(DOMDocument *, DOMNode *, const std::string &msgtype, DataDictionary &, bool)
Definition: DataDictionary.cpp:462
FIX::TYPE::MultipleValueString
Definition: FieldTypes.h:670
FIX::TYPE::Language
Definition: FieldTypes.h:693
FIX::TYPE::Data
Definition: FieldTypes.h:677
FIX
Definition: Acceptor.cpp:34
FIX::DataDictionary::m_checkFieldsOutOfOrder
bool m_checkFieldsOutOfOrder
Definition: DataDictionary.h:517
FIX::DataDictionary::OrderedFieldsArray
message_order OrderedFieldsArray
Definition: DataDictionary.h:57
FIX::DOMDocumentPtr
std::auto_ptr< DOMDocument > DOMDocumentPtr
Definition: DOMDocument.h:71
FIX::DataDictionary::validate
static void validate(const Message &message, const DataDictionary *const pSessionDD, const DataDictionary *const pAppID)
Validate a message.
Definition: DataDictionary.cpp:117
FIX::DataDictionary::checkFieldsOutOfOrder
void checkFieldsOutOfOrder(bool value)
Definition: DataDictionary.h:300
FIX::DataDictionary::checkValue
void checkValue(const FieldBase &field) const
Definition: DataDictionary.h:423
FIX::TYPE::Percentage
Definition: FieldTypes.h:686
FIX::FieldMap
Stores and organizes a collection of Fields.
Definition: FieldMap.h:46
FIX::DataDictionary::shouldCheckTag
bool shouldCheckTag(const FieldBase &field) const
If we need to check for the tag in the dictionary.
Definition: DataDictionary.h:331
FIX::DataDictionary::Fields
std::set< int > Fields
Definition: DataDictionary.h:54
FIX::DataDictionary::checkUserDefinedFields
void checkUserDefinedFields(bool value)
Definition: DataDictionary.h:304
FIX::TYPE::NumInGroup
Definition: FieldTypes.h:685
FIX::InvalidMessageType
Not a known message type.
Definition: Exceptions.h:169
FIX::DataDictionary::addHeaderField
void addHeaderField(int field, bool required)
Definition: DataDictionary.h:165
FIX::DoubleConvertor::convert
static std::string convert(double value, int padding=0)
Definition: FieldConvertors.h:401
FIX::DataDictionary::operator=
DataDictionary & operator=(const DataDictionary &rhs)
Definition: DataDictionary.cpp:81
FIX::ConfigError
Application is not configured correctly
Definition: Exceptions.h:87
FIX::DataDictionary::addValueName
void addValueName(int field, const std::string &value, const std::string &name)
Definition: DataDictionary.h:125
FIX::DataDictionary::checkMsgType
void checkMsgType(const MsgType &msgType) const
Check if message type is defined in spec.
Definition: DataDictionary.h:324
FIX::TYPE::Int
Definition: FieldTypes.h:666
FIX::DataDictionary::m_dataFields
MsgFields m_dataFields
Definition: DataDictionary.h:535
FIX::TYPE::Length
Definition: FieldTypes.h:688
FIX::DataDictionary::getOrderedFields
message_order const & getOrderedFields() const
Definition: DataDictionary.cpp:427
FIX::DataDictionary::isFieldValue
bool isFieldValue(int field, const std::string &value) const
Definition: DataDictionary.h:224
FIX::FieldMap::groupCount
size_t groupCount(int field) const
Count the number of instance of a group.
Definition: FieldMap.cpp:135
FIX::Message
Base class for all FIX messages.
Definition: Message.h:67
FIX::DataDictionary::lookupXMLFieldNumber
int lookupXMLFieldNumber(DOMDocument *, DOMNode *) const
Definition: DataDictionary.cpp:444
FIX::DataDictionary::isTrailerField
bool isTrailerField(int field) const
Definition: DataDictionary.h:180
FIX::DataDictionary::m_valueNames
ValueToName m_valueNames
Definition: DataDictionary.h:533
FIX::DataDictionary::isGroup
bool isGroup(const std::string &msg, int field) const
Definition: DataDictionary.h:257
FIX::DataDictionary::getVersion
std::string getVersion() const
Definition: DataDictionary.h:91
FieldMap.h
FIX::DataDictionary::getFieldTag
bool getFieldTag(const std::string &name, int &field) const
Definition: DataDictionary.h:117
FIX::FieldBase::getField
int getField() const
Get the fields integer tag.
Definition: Field.h:108
FIX::DataDictionary::checkHasRequired
void checkHasRequired(const FieldMap &header, const FieldMap &body, const FieldMap &trailer, const MsgType &msgType) const
Check if a message has all required fields.
Definition: DataDictionary.h:466
FIX::DataDictionary::addField
void addField(int field)
Definition: DataDictionary.h:96
FIX::DataDictionary::m_groups
FieldToGroup m_groups
Definition: DataDictionary.h:534
FIX::TYPE::MonthYear
Definition: FieldTypes.h:680
FIX::FieldMap::g_end
g_iterator g_end() const
Definition: FieldMap.h:217
FIX::DataDictionary::addFieldName
void addFieldName(int field, const std::string &name)
Definition: DataDictionary.h:102
FIX::UtcDateConvertor::convert
static std::string convert(const UtcDate &value)
Definition: FieldConvertors.h:782
FIX::BoolConvertor::convert
static std::string convert(bool value)
Definition: FieldConvertors.h:533
FIX::DataDictionary::getFieldName
bool getFieldName(int field, std::string &name) const
Definition: DataDictionary.h:109
FIX::DataDictionary::DataDictionary
DataDictionary()
Definition: DataDictionary.cpp:41
FIX::FieldMap::g_begin
g_iterator g_begin() const
Definition: FieldMap.h:216
FIX::FieldBase
Base representation of all Field classes.
Definition: Field.h:45
FIX::DataDictionary::checkValidTagNumber
void checkValidTagNumber(const FieldBase &field) const
Check if field tag number is defined in spec.
Definition: DataDictionary.h:340
FIX::DataDictionary::setVersion
void setVersion(const std::string &beginString)
Definition: DataDictionary.h:86
FIX::DataDictionary::FieldTypes
std::map< int, TYPE::Type > FieldTypes
Definition: DataDictionary.h:58
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:674
FIX::TYPE::TzTimeOnly
Definition: FieldTypes.h:690
FIX::TYPE::XmlData
Definition: FieldTypes.h:692
FIX::DataDictionary::isField
bool isField(int field) const
Definition: DataDictionary.h:138
FIX::message_order
Sorts fields in header, normal, or trailer order.
Definition: MessageSorters.h:113
FIX::TYPE::Type
Type
Definition: FieldTypes.h:660
FIX::DataDictionary::addFieldValue
void addFieldValue(int field, const std::string &value)
Definition: DataDictionary.h:213
FIX::DataDictionary::OrderedFields
std::vector< int > OrderedFields
Definition: DataDictionary.h:56
FIX::DataDictionary::m_hasVersion
bool m_hasVersion
Definition: DataDictionary.h:516
FIX::DataDictionary::MsgFields
std::set< int > MsgFields
Definition: DataDictionary.h:51
FIX::TYPE::Qty
Definition: FieldTypes.h:668
FIX::FIELD::BeginString
const int BeginString
Definition: FixFieldNumbers.h:499
FIX::DataDictionary::FieldToName
std::map< int, std::string > FieldToName
Definition: DataDictionary.h:61
FIX::DOMNode
Interface that represents node from underlying XML parser.
Definition: DOMDocument.h:46
FIX::DataDictionary::checkHasValue
void checkHasValue(const FieldBase &field) const
Check if a field has a value.
Definition: DataDictionary.h:434
FIX::EmptyConvertor::convert
static const std::string & convert(const std::string &value)
Definition: FieldConvertors.h:145
FIX::RequiredTagMissing
Required field is not in message.
Definition: Exceptions.h:110
FIX::NoTagValue
Field exists in message without a value.
Definition: Exceptions.h:128
FIX::IncorrectTagValue
Field has a value that is out of range.
Definition: Exceptions.h:137
FIX::DataDictionary::FieldPresenceMap
std::map< std::string, std::pair< int, DataDictionary *> > FieldPresenceMap
Definition: DataDictionary.h:69
FIX::DataDictionary::~DataDictionary
virtual ~DataDictionary()
Definition: DataDictionary.cpp:68
FIX::DataDictionary::m_trailerFields
NonBodyFields m_trailerFields
Definition: DataDictionary.h:528
FIX::FIELD::UserMin
const int UserMin
Definition: FieldNumbers.h:40
FIX::DataDictionary::checkFieldsHaveValues
void checkFieldsHaveValues(bool value)
Definition: DataDictionary.h:302
FIX::TagNotDefinedForMessage
Field does not belong to message.
Definition: Exceptions.h:119
FIX::TYPE::SeqNum
Definition: FieldTypes.h:687
FIX::DataDictionary::addMsgType
void addMsgType(const std::string &msgType)
Definition: DataDictionary.h:143
FIX::TYPE::Float
Definition: FieldTypes.h:678
FIX::TYPE::PriceOffset
Definition: FieldTypes.h:679
FIX::FIELD::MsgType
const int MsgType
Definition: FixFieldNumbers.h:363
Fields.h
DOMDocument.h
FIX::DataDictionary::m_orderedFieldsArray
OrderedFieldsArray m_orderedFieldsArray
Definition: DataDictionary.h:526
FIX::DataDictionary::ValueToName
std::map< std::pair< int, std::string >, std::string > ValueToName
Definition: DataDictionary.h:63
FIX::TYPE::Price
Definition: FieldTypes.h:665
FIX::TYPE::String
Definition: FieldTypes.h:663
FIX::DataDictionary::addFieldType
void addFieldType(int field, FIX::TYPE::Type type)
Definition: DataDictionary.h:185
FIX::TYPE::DayOfMonth
Definition: FieldTypes.h:681
FIX::TYPE::Char
Definition: FieldTypes.h:664
Exceptions.h
FIX::TYPE::MultipleCharValue
Definition: FieldTypes.h:672
FIX::DataDictionary::XMLTypeToType
TYPE::Type XMLTypeToType(const std::string &xmlType) const
Definition: DataDictionary.cpp:583
FIX::Exception
Base QuickFIX exception type.
Definition: Exceptions.h:33
FIX::DataDictionary::addRequiredField
void addRequiredField(const std::string &msgType, int field)
Definition: DataDictionary.h:201
FIX::DOMDocument
Interface that represents document of underlying XML parser.
Definition: DOMDocument.h:60
FIX::DataDictionary::m_fieldTypes
FieldTypes m_fieldTypes
Definition: DataDictionary.h:529