Field.h
Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 /****************************************************************************
00004 ** Copyright (c) 2001-2014
00005 **
00006 ** This file is part of the QuickFIX FIX Engine
00007 **
00008 ** This file may be distributed under the terms of the quickfixengine.org
00009 ** license as defined by quickfixengine.org and appearing in the file
00010 ** LICENSE included in the packaging of this file.
00011 **
00012 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00013 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00014 **
00015 ** See http://www.quickfixengine.org/LICENSE for licensing information.
00016 **
00017 ** Contact ask@quickfixengine.org if any conditions of this licensing are
00018 ** not clear to you.
00019 **
00020 ****************************************************************************/
00021 
00022 #ifndef FIX_FIELD
00023 #define FIX_FIELD
00024 
00025 #ifdef _MSC_VER
00026 #pragma warning( disable : 4786 )
00027 #endif
00028 
00029 #include <sstream>
00030 #include <numeric>
00031 #include "FieldNumbers.h"
00032 #include "FieldConvertors.h"
00033 #include "FieldTypes.h"
00034 #include "Utility.h"
00035 
00036 namespace FIX
00037 {
00045 class FieldBase
00046 {
00047 
00049   class field_metrics
00050   {
00051   public:
00052 
00053     field_metrics( const size_t length, const int checksum )
00054       : m_length( length )
00055       , m_checksum( checksum )
00056     {}
00057 
00058     size_t getLength() const
00059     { return m_length; }
00060 
00061     int getCheckSum() const
00062     { return m_checksum; }
00063 
00064     bool isValid() const
00065     { return m_length > 0; }
00066 
00067   private:
00068 
00069     size_t m_length;
00070     int m_checksum;
00071   };
00072 
00073   friend class Message;
00074 
00076   FieldBase( int field, 
00077              std::string::const_iterator valueStart, 
00078              std::string::const_iterator valueEnd,
00079              std::string::const_iterator tagStart, 
00080              std::string::const_iterator tagEnd )
00081     : m_field( field )
00082     , m_string( valueStart, valueEnd )
00083     , m_metrics( calculateMetrics( tagStart, tagEnd ) )
00084   {}
00085 
00086 public:
00087   FieldBase( int field, const std::string& string )
00088     : m_field( field ), m_string(string), m_metrics( no_metrics() )
00089   {}
00090 
00091   virtual ~FieldBase() {}
00092 
00093   void setField( int field )
00094   {
00095     m_field = field;
00096     m_metrics = no_metrics();
00097     m_data.clear();
00098   }
00099 
00100   void setString( const std::string& string )
00101   {
00102     m_string = string;
00103     m_metrics = no_metrics();
00104     m_data.clear();
00105   }
00106 
00108   int getField() const
00109   { return m_field; }
00110 
00112   const std::string& getString() const
00113   { return m_string; }
00114 
00116   const std::string& getFixString() const
00117   {
00118     if( m_data.empty() )
00119       encodeTo( m_data );
00120 
00121     return m_data;
00122   }
00123 
00125   size_t getLength() const
00126   {
00127     calculate();
00128     return m_metrics.getLength();
00129   }
00130 
00132   int getTotal() const
00133   {
00134     calculate();
00135     return m_metrics.getCheckSum();
00136   }
00137 
00139   bool operator < ( const FieldBase& field ) const
00140   { return m_field < field.m_field; }
00141 
00142 private:
00143 
00144   void calculate() const
00145   {
00146     if( m_metrics.isValid() ) return;
00147 
00148     m_metrics = calculateMetrics( getFixString() );
00149   }
00150 
00152   void encodeTo( std::string& result ) const
00153   {
00154     size_t tagLength = FIX::number_of_symbols_in( m_field ) + 1;
00155     size_t totalLength = tagLength + m_string.length() + 1;
00156 
00157     result.resize( totalLength );
00158 
00159     char * buf = (char*)result.c_str();
00160     FIX::integer_to_string( buf, tagLength, m_field );
00161 
00162     buf[tagLength - 1] = '=';
00163     memcpy( buf + tagLength, m_string.data(), m_string.length() );
00164     buf[totalLength - 1] = '\001';
00165   }
00166 
00167   static field_metrics no_metrics()
00168   {
00169     return field_metrics( 0, 0 );
00170   }
00171 
00173   static field_metrics calculateMetrics( 
00174     std::string::const_iterator const start,
00175     std::string::const_iterator const end )
00176   {
00177     int checksum = 0;
00178     for ( std::string::const_iterator str = start; str != end; ++str )
00179       checksum += (unsigned char)( *str );
00180 
00181     return field_metrics( std::distance( start, end ), checksum );
00182   }
00183 
00184   static field_metrics calculateMetrics( const std::string& field )
00185   {
00186     return calculateMetrics( field.begin(), field.end() );
00187   }
00188 
00189   int m_field;
00190   std::string m_string;
00191   mutable std::string m_data;
00192   mutable field_metrics m_metrics;
00193 };
00196 inline std::ostream& operator <<
00197 ( std::ostream& stream, const FieldBase& field )
00198 {
00199   stream << field.getString();
00200   return stream;
00201 }
00202 
00207 class StringField : public FieldBase
00208 {
00209 public:
00210   explicit StringField( int field, const std::string& data )
00211 : FieldBase( field, data ) {}
00212   StringField( int field )
00213 : FieldBase( field, "" ) {}
00214 
00215   void setValue( const std::string& value )
00216     { setString( value ); }
00217   const std::string& getValue() const
00218     { return getString(); }
00219   operator const std::string&() const
00220     { return getString(); }
00221 
00222   bool operator<( const StringField& rhs ) const
00223     { return getString() < rhs.getString(); }
00224   bool operator>( const StringField& rhs ) const
00225     { return getString() > rhs.getString(); }
00226   bool operator==( const StringField& rhs ) const
00227     { return getString() == rhs.getString(); }
00228   bool operator!=( const StringField& rhs ) const
00229     { return getString() != rhs.getString(); }
00230   bool operator<=( const StringField& rhs ) const
00231     { return getString() <= rhs.getString(); }
00232   bool operator>=( const StringField& rhs ) const
00233     { return getString() >= rhs.getString(); }
00234   friend bool operator<( const StringField&, const char* );
00235   friend bool operator<( const char*, const StringField& );
00236   friend bool operator>( const StringField&, const char* );
00237   friend bool operator>( const char*, const StringField& );
00238   friend bool operator==( const StringField&, const char* );
00239   friend bool operator==( const char*, const StringField& );
00240   friend bool operator!=( const StringField&, const char* );
00241   friend bool operator!=( const char*, const StringField& );
00242   friend bool operator<=( const StringField&, const char* );
00243   friend bool operator<=( const char*, const StringField& );
00244   friend bool operator>=( const StringField&, const char* );
00245   friend bool operator>=( const char*, const StringField& );
00246 
00247   friend bool operator<( const StringField&, const std::string& );
00248   friend bool operator<( const std::string&, const StringField& );
00249   friend bool operator>( const StringField&, const std::string& );
00250   friend bool operator>( const std::string&, const StringField& );
00251   friend bool operator==( const StringField&, const std::string& );
00252   friend bool operator==( const std::string&, const StringField& );
00253   friend bool operator!=( const StringField&, const std::string& );
00254   friend bool operator!=( const std::string&, const StringField& );
00255   friend bool operator<=( const StringField&, const std::string& );
00256   friend bool operator<=( const std::string&, const StringField& );
00257   friend bool operator>=( const StringField&, const std::string& );
00258   friend bool operator>=( const std::string&, const StringField& );
00259 };
00260 
00261 inline bool operator<( const StringField& lhs, const char* rhs )
00262   { return lhs.getValue() < rhs; }
00263 inline bool operator<( const char* lhs, const StringField& rhs )
00264   { return lhs < rhs.getValue(); }
00265 inline bool operator>( const StringField& lhs, const char* rhs )
00266   { return lhs.getValue() > rhs; }
00267 inline bool operator>( const char* lhs, const StringField& rhs )
00268   { return lhs > rhs.getValue(); }
00269 inline bool operator==( const StringField& lhs, const char* rhs )
00270   { return lhs.getValue() == rhs; }
00271 inline bool operator==( const char* lhs, const StringField& rhs )
00272   { return lhs == rhs.getValue(); }
00273 inline bool operator!=( const StringField& lhs, const char* rhs )
00274   { return lhs.getValue() != rhs; }
00275 inline bool operator!=( const char* lhs, const StringField& rhs )
00276   { return lhs != rhs.getValue(); }
00277 inline bool operator<=( const StringField& lhs, const char* rhs )
00278   { return lhs.getValue() <= rhs; }
00279 inline bool operator<=( const char* lhs, const StringField& rhs )
00280   { return lhs <= rhs.getValue(); }
00281 inline bool operator>=( const StringField& lhs, const char* rhs )
00282   { return lhs.getValue() >= rhs; }
00283 inline bool operator>=( const char* lhs, const StringField& rhs )
00284   { return lhs >= rhs.getValue(); }
00285 
00286 inline bool operator<( const StringField& lhs, const std::string& rhs )
00287   { return lhs.getValue() < rhs; }
00288 inline bool operator<( const std::string& lhs, const StringField& rhs )
00289   { return lhs < rhs.getValue(); }
00290 inline bool operator>( const StringField& lhs, const std::string& rhs )
00291   { return lhs.getValue() > rhs; }
00292 inline bool operator>( const std::string& lhs, const StringField& rhs )
00293   { return lhs > rhs.getValue(); }
00294 inline bool operator==( const StringField& lhs, const std::string& rhs )
00295   { return lhs.getValue() == rhs; }
00296 inline bool operator==( const std::string& lhs, const StringField& rhs )
00297   { return lhs == rhs.getValue(); }
00298 inline bool operator!=( const StringField& lhs, const std::string& rhs )
00299   { return lhs.getValue() != rhs; }
00300 inline bool operator!=( const std::string& lhs, const StringField& rhs )
00301   { return lhs != rhs.getValue(); }
00302 inline bool operator<=( const StringField& lhs, const std::string& rhs )
00303   { return lhs.getValue() <= rhs; }
00304 inline bool operator<=( const std::string& lhs, const StringField& rhs )
00305   { return lhs <= rhs.getValue(); }
00306 inline bool operator>=( const StringField& lhs, const std::string& rhs )
00307   { return lhs.getValue() >= rhs; }
00308 inline bool operator>=( const std::string& lhs, const StringField& rhs )
00309   { return lhs >= rhs.getValue(); }
00310 
00312 class CharField : public FieldBase
00313 {
00314 public:
00315   explicit CharField( int field, char data )
00316 : FieldBase( field, CharConvertor::convert( data ) ) {}
00317   CharField( int field )
00318 : FieldBase( field, "" ) {}
00319 
00320   void setValue( char value )
00321     { setString( CharConvertor::convert( value ) ); }
00322   char getValue() const throw ( IncorrectDataFormat )
00323     { try
00324       { return CharConvertor::convert( getString() ); }
00325       catch( FieldConvertError& )
00326       { throw IncorrectDataFormat( getField(), getString() ); } }
00327   operator char() const
00328     { return getValue(); }
00329 };
00330 
00332 class DoubleField : public FieldBase
00333 {
00334 public:
00335   explicit DoubleField( int field, double data, int padding = 0 )
00336 : FieldBase( field, DoubleConvertor::convert( data, padding ) ) {}
00337   DoubleField( int field )
00338 : FieldBase( field, "" ) {}
00339 
00340   void setValue( double value, int padding = 0 )
00341     { setString( DoubleConvertor::convert( value, padding ) ); }
00342   double getValue() const throw ( IncorrectDataFormat )
00343     { try
00344       { return DoubleConvertor::convert( getString() ); }
00345       catch( FieldConvertError& )
00346       { throw IncorrectDataFormat( getField(), getString() ); } }
00347   operator double() const
00348     { return getValue(); }
00349 };
00350 
00352 class IntField : public FieldBase
00353 {
00354 public:
00355   explicit IntField( int field, int data )
00356 : FieldBase( field, IntConvertor::convert( data ) ) {}
00357   IntField( int field )
00358 : FieldBase( field, "" ) {}
00359 
00360   void setValue( int value )
00361     { setString( IntConvertor::convert( value ) ); }
00362   int getValue() const throw ( IncorrectDataFormat )
00363     { try
00364       { return IntConvertor::convert( getString() ); }
00365       catch( FieldConvertError& )
00366       { throw IncorrectDataFormat( getField(), getString() ); } }
00367   operator const int() const
00368     { return getValue(); }
00369 };
00370 
00372 class BoolField : public FieldBase
00373 {
00374 public:
00375   explicit BoolField( int field, bool data )
00376 : FieldBase( field, BoolConvertor::convert( data ) ) {}
00377   BoolField( int field )
00378 : FieldBase( field, "" ) {}
00379 
00380   void setValue( bool value )
00381     { setString( BoolConvertor::convert( value ) ); }
00382   bool getValue() const throw ( IncorrectDataFormat )
00383     { try
00384       { return BoolConvertor::convert( getString() ); }
00385       catch( FieldConvertError& )
00386       { throw IncorrectDataFormat( getField(), getString() ); } }
00387   operator bool() const
00388     { return getValue(); }
00389 };
00390 
00392 class UtcTimeStampField : public FieldBase
00393 {
00394 public:
00395   explicit UtcTimeStampField( int field, const UtcTimeStamp& data, bool showMilliseconds = false )
00396 : FieldBase( field, UtcTimeStampConvertor::convert( data, showMilliseconds ) ) {}
00397   UtcTimeStampField( int field, bool showMilliseconds = false )
00398 : FieldBase( field, UtcTimeStampConvertor::convert( UtcTimeStamp(), showMilliseconds ) ) {}
00399 
00400   void setValue( const UtcTimeStamp& value )
00401     { setString( UtcTimeStampConvertor::convert( value ) ); }
00402   UtcTimeStamp getValue() const throw ( IncorrectDataFormat )
00403     { try
00404       { return UtcTimeStampConvertor::convert( getString() ); }
00405       catch( FieldConvertError& )
00406       { throw IncorrectDataFormat( getField(), getString() ); } }
00407   operator UtcTimeStamp() const
00408     { return getValue(); }
00409 
00410   bool operator<( const UtcTimeStampField& rhs ) const
00411     { return getValue() < rhs.getValue(); }
00412   bool operator==( const UtcTimeStampField& rhs ) const
00413     { return getValue() == rhs.getValue(); }
00414   bool operator!=( const UtcTimeStampField& rhs ) const
00415     { return getValue() != rhs.getValue(); }
00416 };
00417 
00419 class UtcDateField : public FieldBase
00420 {
00421 public:
00422   explicit UtcDateField( int field, const UtcDate& data )
00423 : FieldBase( field, UtcDateConvertor::convert( data ) ) {}
00424   UtcDateField( int field )
00425 : FieldBase( field, UtcDateConvertor::convert( UtcDate() ) ) {}
00426 
00427   void setValue( const UtcDate& value )
00428     { setString( UtcDateConvertor::convert( value ) ); }
00429   UtcDate getValue() const throw ( IncorrectDataFormat )
00430     { try
00431       { return UtcDateConvertor::convert( getString() ); }
00432       catch( FieldConvertError& )
00433       { throw IncorrectDataFormat( getField(), getString() ); } }
00434   operator UtcDate() const
00435     { return getValue(); }
00436 
00437   bool operator<( const UtcDateField& rhs ) const
00438     { return getValue() < rhs.getValue(); }
00439   bool operator==( const UtcDateField& rhs ) const
00440     { return getValue() == rhs.getValue(); }
00441   bool operator!=( const UtcDateField& rhs ) const
00442     { return getValue() != rhs.getValue(); }
00443 };
00444 
00446 class UtcTimeOnlyField : public FieldBase
00447 {
00448 public:
00449   explicit UtcTimeOnlyField( int field, const UtcTimeOnly& data, bool showMilliseconds = false )
00450 : FieldBase( field, UtcTimeOnlyConvertor::convert( data, showMilliseconds ) ) {}
00451   UtcTimeOnlyField( int field, bool showMilliseconds = false )
00452 : FieldBase( field, UtcTimeOnlyConvertor::convert( UtcTimeOnly(), showMilliseconds ) ) {}
00453 
00454   void setValue( const UtcTimeOnly& value )
00455     { setString( UtcTimeOnlyConvertor::convert( value ) ); }
00456   UtcTimeOnly getValue() const throw ( IncorrectDataFormat )
00457     { try
00458       { return UtcTimeOnlyConvertor::convert( getString() ); }
00459       catch( FieldConvertError& )
00460       { throw IncorrectDataFormat( getField(), getString() ); } }
00461   operator UtcTimeOnly() const
00462     { return getValue(); }
00463 
00464   bool operator<( const UtcTimeOnlyField& rhs ) const
00465     { return getValue() < rhs.getValue(); }
00466   bool operator==( const UtcTimeOnlyField& rhs ) const
00467     { return getValue() == rhs.getValue(); }
00468   bool operator!=( const UtcTimeOnlyField& rhs ) const
00469     { return getValue() != rhs.getValue(); }
00470 };
00471 
00473 class CheckSumField : public FieldBase
00474 {
00475 public:
00476   explicit CheckSumField( int field, int data )
00477 : FieldBase( field, CheckSumConvertor::convert( data ) ) {}
00478   CheckSumField( int field )
00479 : FieldBase( field, "" ) {}
00480 
00481   void setValue( int value )
00482     { setString( CheckSumConvertor::convert( value ) ); }
00483   int getValue() const throw ( IncorrectDataFormat )
00484     { try
00485       { return CheckSumConvertor::convert( getString() ); }
00486       catch( FieldConvertError& )
00487       { throw IncorrectDataFormat( getField(), getString() ); } }
00488   operator const int() const
00489     { return getValue(); }
00490 };
00491 
00492 typedef DoubleField PriceField;
00493 typedef DoubleField AmtField;
00494 typedef DoubleField QtyField;
00495 typedef StringField CurrencyField;
00496 typedef StringField MultipleValueStringField;
00497 typedef StringField MultipleStringValueField;
00498 typedef StringField MultipleCharValueField;
00499 typedef StringField ExchangeField;
00500 typedef StringField LocalMktDateField;
00501 typedef StringField DataField;
00502 typedef DoubleField FloatField;
00503 typedef DoubleField PriceOffsetField;
00504 typedef StringField MonthField;
00505 typedef StringField MonthYearField;
00506 typedef StringField DayOfMonthField;
00507 typedef UtcDateField UtcDateOnlyField;
00508 typedef IntField LengthField;
00509 typedef IntField NumInGroupField;
00510 typedef IntField SeqNumField;
00511 typedef DoubleField PercentageField;
00512 typedef StringField CountryField;
00513 typedef StringField TzTimeOnlyField;
00514 typedef StringField TzTimeStampField;
00515 }
00516 
00517 #define DEFINE_FIELD_CLASS_NUM( NAME, TOK, TYPE, NUM ) \
00518 class NAME : public TOK##Field { public: \
00519 NAME() : TOK##Field(NUM) {} \
00520 NAME(const TYPE& value) : TOK##Field(NUM, value) {} \
00521 }
00522 
00523 #define DEFINE_FIELD_CLASS( NAME, TOK, TYPE ) \
00524 DEFINE_FIELD_CLASS_NUM(NAME, TOK, TYPE, FIELD::NAME)
00525 
00526 #define DEFINE_DEPRECATED_FIELD_CLASS( NAME, TOK, TYPE ) \
00527 DEFINE_FIELD_CLASS_NUM(NAME, TOK, TYPE, DEPRECATED_FIELD::NAME)
00528 
00529 #define DEFINE_FIELD_TIMECLASS_NUM( NAME, TOK, TYPE, NUM ) \
00530 class NAME : public TOK##Field { public: \
00531 NAME() : TOK##Field(NUM, false) {} \
00532 NAME(bool showMilliseconds) : TOK##Field(NUM, showMilliseconds) {} \
00533 NAME(const TYPE& value) : TOK##Field(NUM, value) {} \
00534 NAME(const TYPE& value, bool showMilliseconds) : TOK##Field(NUM, value, showMilliseconds) {} \
00535 }
00536 
00537 #define DEFINE_FIELD_TIMECLASS( NAME, TOK, TYPE ) \
00538 DEFINE_FIELD_TIMECLASS_NUM(NAME, TOK, TYPE, FIELD::NAME)
00539 
00540 #define DEFINE_DEPRECATED_FIELD_TIMECLASS( NAME, TOK, TYPE ) \
00541 DEFINE_FIELD_TIMECLASS_NUM(NAME, TOK, TYPE, DEPRECATED_FIELD::NAME)
00542 
00543 #define DEFINE_CHECKSUM( NAME ) \
00544   DEFINE_FIELD_CLASS(NAME, CheckSum, FIX::INT)
00545 #define DEFINE_STRING( NAME ) \
00546   DEFINE_FIELD_CLASS(NAME, String, FIX::STRING)
00547 #define DEFINE_CHAR( NAME ) \
00548   DEFINE_FIELD_CLASS(NAME, Char, FIX::CHAR)
00549 #define DEFINE_PRICE( NAME ) \
00550   DEFINE_FIELD_CLASS(NAME, Price, FIX::PRICE)
00551 #define DEFINE_INT( NAME ) \
00552   DEFINE_FIELD_CLASS(NAME, Int, FIX::INT)
00553 #define DEFINE_AMT( NAME ) \
00554   DEFINE_FIELD_CLASS(NAME, Amt, FIX::AMT)
00555 #define DEFINE_QTY( NAME ) \
00556   DEFINE_FIELD_CLASS(NAME, Qty, FIX::QTY)
00557 #define DEFINE_CURRENCY( NAME ) \
00558   DEFINE_FIELD_CLASS(NAME, Currency, FIX::CURRENCY)
00559 #define DEFINE_MULTIPLEVALUESTRING( NAME ) \
00560   DEFINE_FIELD_CLASS(NAME, MultipleValueString, FIX::MULTIPLEVALUESTRING)
00561 #define DEFINE_MULTIPLESTRINGVALUE( NAME ) \
00562   DEFINE_FIELD_CLASS(NAME, MultipleStringValue, FIX::MULTIPLESTRINGVALUE)
00563 #define DEFINE_MULTIPLECHARVALUE( NAME ) \
00564   DEFINE_FIELD_CLASS(NAME, MultipleCharValue, FIX::MULTIPLECHARVALUE)
00565 #define DEFINE_EXCHANGE( NAME ) \
00566   DEFINE_FIELD_CLASS(NAME, Exchange, FIX::EXCHANGE)
00567 #define DEFINE_UTCTIMESTAMP( NAME ) \
00568   DEFINE_FIELD_TIMECLASS(NAME, UtcTimeStamp, FIX::UTCTIMESTAMP)
00569 #define DEFINE_BOOLEAN( NAME ) \
00570   DEFINE_FIELD_CLASS(NAME, Bool, FIX::BOOLEAN)
00571 #define DEFINE_LOCALMKTDATE( NAME ) \
00572   DEFINE_FIELD_CLASS(NAME, String, FIX::LOCALMKTDATE)
00573 #define DEFINE_DATA( NAME ) \
00574   DEFINE_FIELD_CLASS(NAME, Data, FIX::DATA)
00575 #define DEFINE_FLOAT( NAME ) \
00576   DEFINE_FIELD_CLASS(NAME, Float, FIX::FLOAT)
00577 #define DEFINE_PRICEOFFSET( NAME ) \
00578   DEFINE_FIELD_CLASS(NAME, PriceOffset, FIX::PRICEOFFSET)
00579 #define DEFINE_MONTHYEAR( NAME ) \
00580   DEFINE_FIELD_CLASS(NAME, MonthYear, FIX::MONTHYEAR)
00581 #define DEFINE_DAYOFMONTH( NAME ) \
00582   DEFINE_FIELD_CLASS(NAME, DayOfMonth, FIX::DAYOFMONTH)
00583 #define DEFINE_UTCDATE( NAME ) \
00584   DEFINE_FIELD_CLASS(NAME, UtcDate, FIX::UTCDATE)
00585 #define DEFINE_UTCDATEONLY( NAME ) \
00586   DEFINE_FIELD_CLASS(NAME, UtcDateOnly, FIX::UTCDATEONLY)
00587 #define DEFINE_UTCTIMEONLY( NAME ) \
00588   DEFINE_FIELD_CLASS(NAME, UtcTimeOnly, FIX::UTCTIMEONLY)
00589 #define DEFINE_NUMINGROUP( NAME ) \
00590   DEFINE_FIELD_CLASS(NAME, NumInGroup, FIX::NUMINGROUP)
00591 #define DEFINE_SEQNUM( NAME ) \
00592   DEFINE_FIELD_CLASS(NAME, SeqNum, FIX::SEQNUM)
00593 #define DEFINE_LENGTH( NAME ) \
00594   DEFINE_FIELD_CLASS(NAME, Length, FIX::LENGTH)
00595 #define DEFINE_PERCENTAGE( NAME ) \
00596   DEFINE_FIELD_CLASS(NAME, Percentage, FIX::PERCENTAGE)
00597 #define DEFINE_COUNTRY( NAME ) \
00598   DEFINE_FIELD_CLASS(NAME, Country, FIX::COUNTRY)
00599 #define DEFINE_TZTIMEONLY( NAME ) \
00600   DEFINE_FIELD_CLASS(NAME, String, FIX::TZTIMEONLY)
00601 #define DEFINE_TZTIMESTAMP( NAME ) \
00602   DEFINE_FIELD_CLASS(NAME, String, FIX::TZTIMESTAMP)
00603 #define DEFINE_XMLDATA( NAME ) \
00604   DEFINE_FIELD_CLASS(NAME, String, FIX::XMLDATA)
00605 #define DEFINE_LANGUAGE( NAME ) \
00606   DEFINE_FIELD_CLASS(NAME, String, FIX::LANGUAGE)
00607 
00608 #define USER_DEFINE_STRING( NAME, NUM ) \
00609   DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::STRING, NUM)
00610 #define USER_DEFINE_CHAR( NAME, NUM ) \
00611   DEFINE_FIELD_CLASS_NUM(NAME, Char, FIX::CHAR, NUM)
00612 #define USER_DEFINE_PRICE( NAME, NUM ) \
00613   DEFINE_FIELD_CLASS_NUM(NAME, Price, FIX::PRICE, NUM)
00614 #define USER_DEFINE_INT( NAME, NUM ) \
00615   DEFINE_FIELD_CLASS_NUM(NAME, Int, FIX::INT, NUM)
00616 #define USER_DEFINE_AMT( NAME, NUM ) \
00617   DEFINE_FIELD_CLASS_NUM(NAME, Amt, FIX::AMT, NUM)
00618 #define USER_DEFINE_QTY( NAME, NUM ) \
00619   DEFINE_FIELD_CLASS_NUM(NAME, Qty, FIX::QTY, NUM)
00620 #define USER_DEFINE_CURRENCY( NAME, NUM ) \
00621   DEFINE_FIELD_CLASS_NUM(NAME, Currency, FIX::CURRENCY, NUM)
00622 #define USER_DEFINE_MULTIPLEVALUESTRING( NAME, NUM ) \
00623   DEFINE_FIELD_CLASS_NUM(NAME, MultipleValueString, FIX::MULTIPLEVALUESTRING, NUM)
00624 #define USER_DEFINE_MULTIPLESTRINGVALUE( NAME, NUM ) \
00625   DEFINE_FIELD_CLASS_NUM(NAME, MultipleStringValue, FIX::MULTIPLESTRINGVALUE, NUM)
00626 #define USER_DEFINE_MULTIPLECHARVALUE( NAME, NUM ) \
00627   DEFINE_FIELD_CLASS_NUM(NAME, MultipleCharValue, FIX::MULTIPLECHARVALUE, NUM)
00628 #define USER_DEFINE_EXCHANGE( NAME, NUM ) \
00629   DEFINE_FIELD_CLASS_NUM(NAME, Exchange, FIX::EXCHANGE, NUM)
00630 #define USER_DEFINE_UTCTIMESTAMP( NAME, NUM ) \
00631   DEFINE_FIELD_TIMECLASS_NUM(NAME, UtcTimeStamp, FIX::UTCTIMESTAMP, NUM)
00632 #define USER_DEFINE_BOOLEAN( NAME, NUM ) \
00633   DEFINE_FIELD_CLASS_NUM(NAME, Bool, FIX::BOOLEAN, NUM)
00634 #define USER_DEFINE_LOCALMKTDATE( NAME, NUM ) \
00635   DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::STRING, NUM)
00636 #define USER_DEFINE_DATA( NAME, NUM ) \
00637   DEFINE_FIELD_CLASS_NUM(NAME, Data, FIX::DATA, NUM)
00638 #define USER_DEFINE_FLOAT( NAME, NUM ) \
00639   DEFINE_FIELD_CLASS_NUM(NAME, Float, FIX::FLOAT, NUM)
00640 #define USER_DEFINE_PRICEOFFSET( NAME, NUM ) \
00641   DEFINE_FIELD_CLASS_NUM(NAME, PriceOffset, FIX::PRICEOFFSET, NUM)
00642 #define USER_DEFINE_MONTHYEAR( NAME, NUM ) \
00643   DEFINE_FIELD_CLASS_NUM(NAME, MonthYear, FIX::MONTHYEAR, NUM)
00644 #define USER_DEFINE_DAYOFMONTH( NAME, NUM ) \
00645   DEFINE_FIELD_CLASS_NUM(NAME, DayOfMonth, FIX::DAYOFMONTH, NUM)
00646 #define USER_DEFINE_UTCDATE( NAME, NUM ) \
00647   DEFINE_FIELD_CLASS_NUM(NAME, UtcDate, FIX::UTCDATE, NUM)
00648 #define USER_DEFINE_UTCDATEONLY( NAME, NUM ) \
00649   DEFINE_FIELD_CLASS_NUM(NAME, UtcDateOnly, FIX::UTCDATEONLY, NUM)
00650 #define USER_DEFINE_UTCTIMEONLY( NAME, NUM ) \
00651   DEFINE_FIELD_CLASS_NUM(NAME, UtcTimeOnly, FIX::UTCTIMEONLY, NUM)
00652 #define USER_DEFINE_NUMINGROUP( NAME, NUM ) \
00653   DEFINE_FIELD_CLASS_NUM(NAME, NumInGroup, FIX::NUMINGROUP, NUM)
00654 #define USER_DEFINE_SEQNUM( NAME, NUM ) \
00655   DEFINE_FIELD_CLASS_NUM(NAME, SeqNum, FIX::SEQNUM, NUM)
00656 #define USER_DEFINE_LENGTH( NAME, NUM ) \
00657   DEFINE_FIELD_CLASS_NUM(NAME, Length, FIX::LENGTH, NUM)
00658 #define USER_DEFINE_PERCENTAGE( NAME, NUM ) \
00659   DEFINE_FIELD_CLASS_NUM(NAME, Percentage, FIX::PERCENTAGE, NUM)
00660 #define USER_DEFINE_COUNTRY( NAME, NUM ) \
00661   DEFINE_FIELD_CLASS_NUM(NAME, Country, FIX::COUNTRY, NUM)
00662 #define USER_DEFINE_TZTIMEONLY( NAME, NUM ) \
00663   DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::TZTIMEONLY, NUM)
00664 #define USER_DEFINE_TZTIMESTAMP( NAME, NUM ) \
00665   DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::TZTIMESTAMP, NUM)
00666 #define USER_DEFINE_XMLDATA( NAME, NUM ) \
00667   DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::XMLDATA, NUM)
00668 #define USER_DEFINE_LANGUAGE( NAME, NUM ) \
00669   DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::LANGUAGE, NUM)
00670 
00671 #endif
00672 

Generated on Mon Sep 15 2014 01:23:54 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001