Field.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. /* -*- C++ -*- */
  2. /****************************************************************************
  3. ** Copyright (c) 2001-2014
  4. **
  5. ** This file is part of the QuickFIX FIX Engine
  6. **
  7. ** This file may be distributed under the terms of the quickfixengine.org
  8. ** license as defined by quickfixengine.org and appearing in the file
  9. ** LICENSE included in the packaging of this file.
  10. **
  11. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  12. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  13. **
  14. ** See http://www.quickfixengine.org/LICENSE for licensing information.
  15. **
  16. ** Contact ask@quickfixengine.org if any conditions of this licensing are
  17. ** not clear to you.
  18. **
  19. ****************************************************************************/
  20. #ifndef FIX_FIELD
  21. #define FIX_FIELD
  22. #ifdef _MSC_VER
  23. #pragma warning( disable : 4786 )
  24. #endif
  25. #include <sstream>
  26. #include <numeric>
  27. #include "FieldNumbers.h"
  28. #include "FieldConvertors.h"
  29. #include "FieldTypes.h"
  30. #include "Utility.h"
  31. namespace FIX
  32. {
  33. /**
  34. * Base representation of all Field classes.
  35. *
  36. * This base class is the lowest common denominator of all fields. It
  37. * keeps all fields in its most generic string representation with its
  38. * integer tag.
  39. */
  40. class FieldBase
  41. {
  42. /// Class used to store field metrics like total length and checksum
  43. class field_metrics
  44. {
  45. public:
  46. field_metrics( const int length, const int checksum )
  47. : m_length( length )
  48. , m_checksum( checksum )
  49. {}
  50. int getLength() const
  51. { return m_length; }
  52. int getCheckSum() const
  53. { return m_checksum; }
  54. bool isValid() const
  55. { return m_length > 0; }
  56. private:
  57. int m_length;
  58. int m_checksum;
  59. };
  60. friend class Message;
  61. /// Constructor which also calculates field metrics
  62. FieldBase( int field,
  63. std::string::const_iterator valueStart,
  64. std::string::const_iterator valueEnd,
  65. std::string::const_iterator tagStart,
  66. std::string::const_iterator tagEnd )
  67. : m_field( field )
  68. , m_string( valueStart, valueEnd )
  69. , m_metrics( calculateMetrics( tagStart, tagEnd ) )
  70. {}
  71. public:
  72. FieldBase( int field, const std::string& string )
  73. : m_field( field ), m_string(string), m_metrics( no_metrics() )
  74. {}
  75. virtual ~FieldBase() {}
  76. void setField( int field )
  77. {
  78. m_field = field;
  79. m_metrics = no_metrics();
  80. m_data.clear();
  81. }
  82. void setString( const std::string& string )
  83. {
  84. m_string = string;
  85. m_metrics = no_metrics();
  86. m_data.clear();
  87. }
  88. /// Get the fields integer tag.
  89. int getField() const
  90. { return m_field; }
  91. /// Get the string representation of the fields value.
  92. const std::string& getString() const
  93. { return m_string; }
  94. /// Get the string representation of the Field (i.e.) 55=MSFT[SOH]
  95. const std::string& getFixString() const
  96. {
  97. if( m_data.empty() )
  98. encodeTo( m_data );
  99. return m_data;
  100. }
  101. /// Get the length of the fields string representation
  102. int getLength() const
  103. {
  104. calculate();
  105. return m_metrics.getLength();
  106. }
  107. /// Get the total value the fields characters added together
  108. int getTotal() const
  109. {
  110. calculate();
  111. return m_metrics.getCheckSum();
  112. }
  113. /// Compares fields based on their tag numbers
  114. bool operator < ( const FieldBase& field ) const
  115. { return m_field < field.m_field; }
  116. private:
  117. void calculate() const
  118. {
  119. if( m_metrics.isValid() ) return;
  120. m_metrics = calculateMetrics( getFixString() );
  121. }
  122. /// Serializes string representation of the Field to input string
  123. void encodeTo( std::string& result ) const
  124. {
  125. int tagLength = FIX::number_of_symbols_in( m_field ) + 1;
  126. int totalLength = tagLength + m_string.length() + 1;
  127. result.resize( totalLength );
  128. char * buf = (char*)result.c_str();
  129. FIX::integer_to_string( buf, tagLength, m_field );
  130. buf[tagLength - 1] = '=';
  131. memcpy( buf + tagLength, m_string.data(), m_string.length() );
  132. buf[totalLength - 1] = '\001';
  133. }
  134. static field_metrics no_metrics()
  135. {
  136. return field_metrics( 0, 0 );
  137. }
  138. /// Calculate metrics for any input string
  139. static field_metrics calculateMetrics(
  140. std::string::const_iterator const start,
  141. std::string::const_iterator const end )
  142. {
  143. int checksum = 0;
  144. for ( std::string::const_iterator str = start; str != end; ++str )
  145. checksum += (unsigned char)( *str );
  146. return field_metrics( std::distance( start, end ), checksum );
  147. }
  148. static field_metrics calculateMetrics( const std::string& field )
  149. {
  150. return calculateMetrics( field.begin(), field.end() );
  151. }
  152. int m_field;
  153. std::string m_string;
  154. mutable std::string m_data;
  155. mutable field_metrics m_metrics;
  156. };
  157. /*! @} */
  158. inline std::ostream& operator <<
  159. ( std::ostream& stream, const FieldBase& field )
  160. {
  161. stream << field.getString();
  162. return stream;
  163. }
  164. /**
  165. * MSC doesn't support partial template specialization so we have this.
  166. * this is here to provide equality checking against native char arrays.
  167. */
  168. class StringField : public FieldBase
  169. {
  170. public:
  171. explicit StringField( int field, const std::string& data )
  172. : FieldBase( field, data ) {}
  173. StringField( int field )
  174. : FieldBase( field, "" ) {}
  175. void setValue( const std::string& value )
  176. { setString( value ); }
  177. const std::string& getValue() const
  178. { return getString(); }
  179. operator const std::string&() const
  180. { return getString(); }
  181. bool operator<( const StringField& rhs ) const
  182. { return getString() < rhs.getString(); }
  183. bool operator>( const StringField& rhs ) const
  184. { return getString() > rhs.getString(); }
  185. bool operator==( const StringField& rhs ) const
  186. { return getString() == rhs.getString(); }
  187. bool operator!=( const StringField& rhs ) const
  188. { return getString() != rhs.getString(); }
  189. bool operator<=( const StringField& rhs ) const
  190. { return getString() <= rhs.getString(); }
  191. bool operator>=( const StringField& rhs ) const
  192. { return getString() >= rhs.getString(); }
  193. friend bool operator<( const StringField&, const char* );
  194. friend bool operator<( const char*, const StringField& );
  195. friend bool operator>( const StringField&, const char* );
  196. friend bool operator>( const char*, const StringField& );
  197. friend bool operator==( const StringField&, const char* );
  198. friend bool operator==( const char*, const StringField& );
  199. friend bool operator!=( const StringField&, const char* );
  200. friend bool operator!=( const char*, const StringField& );
  201. friend bool operator<=( const StringField&, const char* );
  202. friend bool operator<=( const char*, const StringField& );
  203. friend bool operator>=( const StringField&, const char* );
  204. friend bool operator>=( const char*, const StringField& );
  205. friend bool operator<( const StringField&, const std::string& );
  206. friend bool operator<( const std::string&, const StringField& );
  207. friend bool operator>( const StringField&, const std::string& );
  208. friend bool operator>( const std::string&, const StringField& );
  209. friend bool operator==( const StringField&, const std::string& );
  210. friend bool operator==( const std::string&, const StringField& );
  211. friend bool operator!=( const StringField&, const std::string& );
  212. friend bool operator!=( const std::string&, const StringField& );
  213. friend bool operator<=( const StringField&, const std::string& );
  214. friend bool operator<=( const std::string&, const StringField& );
  215. friend bool operator>=( const StringField&, const std::string& );
  216. friend bool operator>=( const std::string&, const StringField& );
  217. };
  218. inline bool operator<( const StringField& lhs, const char* rhs )
  219. { return lhs.getValue() < rhs; }
  220. inline bool operator<( const char* lhs, const StringField& rhs )
  221. { return lhs < rhs.getValue(); }
  222. inline bool operator>( const StringField& lhs, const char* rhs )
  223. { return lhs.getValue() > rhs; }
  224. inline bool operator>( const char* lhs, const StringField& rhs )
  225. { return lhs > rhs.getValue(); }
  226. inline bool operator==( const StringField& lhs, const char* rhs )
  227. { return lhs.getValue() == rhs; }
  228. inline bool operator==( const char* lhs, const StringField& rhs )
  229. { return lhs == rhs.getValue(); }
  230. inline bool operator!=( const StringField& lhs, const char* rhs )
  231. { return lhs.getValue() != rhs; }
  232. inline bool operator!=( const char* lhs, const StringField& rhs )
  233. { return lhs != rhs.getValue(); }
  234. inline bool operator<=( const StringField& lhs, const char* rhs )
  235. { return lhs.getValue() <= rhs; }
  236. inline bool operator<=( const char* lhs, const StringField& rhs )
  237. { return lhs <= rhs.getValue(); }
  238. inline bool operator>=( const StringField& lhs, const char* rhs )
  239. { return lhs.getValue() >= rhs; }
  240. inline bool operator>=( const char* lhs, const StringField& rhs )
  241. { return lhs >= rhs.getValue(); }
  242. inline bool operator<( const StringField& lhs, const std::string& rhs )
  243. { return lhs.getValue() < rhs; }
  244. inline bool operator<( const std::string& lhs, const StringField& rhs )
  245. { return lhs < rhs.getValue(); }
  246. inline bool operator>( const StringField& lhs, const std::string& rhs )
  247. { return lhs.getValue() > rhs; }
  248. inline bool operator>( const std::string& lhs, const StringField& rhs )
  249. { return lhs > rhs.getValue(); }
  250. inline bool operator==( const StringField& lhs, const std::string& rhs )
  251. { return lhs.getValue() == rhs; }
  252. inline bool operator==( const std::string& lhs, const StringField& rhs )
  253. { return lhs == rhs.getValue(); }
  254. inline bool operator!=( const StringField& lhs, const std::string& rhs )
  255. { return lhs.getValue() != rhs; }
  256. inline bool operator!=( const std::string& lhs, const StringField& rhs )
  257. { return lhs != rhs.getValue(); }
  258. inline bool operator<=( const StringField& lhs, const std::string& rhs )
  259. { return lhs.getValue() <= rhs; }
  260. inline bool operator<=( const std::string& lhs, const StringField& rhs )
  261. { return lhs <= rhs.getValue(); }
  262. inline bool operator>=( const StringField& lhs, const std::string& rhs )
  263. { return lhs.getValue() >= rhs; }
  264. inline bool operator>=( const std::string& lhs, const StringField& rhs )
  265. { return lhs >= rhs.getValue(); }
  266. /// Field that contains a character value
  267. class CharField : public FieldBase
  268. {
  269. public:
  270. explicit CharField( int field, char data )
  271. : FieldBase( field, CharConvertor::convert( data ) ) {}
  272. CharField( int field )
  273. : FieldBase( field, "" ) {}
  274. void setValue( char value )
  275. { setString( CharConvertor::convert( value ) ); }
  276. char getValue() const throw ( IncorrectDataFormat )
  277. { try
  278. { return CharConvertor::convert( getString() ); }
  279. catch( FieldConvertError& )
  280. { throw IncorrectDataFormat( getField(), getString() ); } }
  281. operator char() const
  282. { return getValue(); }
  283. };
  284. /// Field that contains a double value
  285. class DoubleField : public FieldBase
  286. {
  287. public:
  288. explicit DoubleField( int field, double data, int padding = 0 )
  289. : FieldBase( field, DoubleConvertor::convert( data, padding ) ) {}
  290. DoubleField( int field )
  291. : FieldBase( field, "" ) {}
  292. void setValue( double value, int padding = 0 )
  293. { setString( DoubleConvertor::convert( value, padding ) ); }
  294. double getValue() const throw ( IncorrectDataFormat )
  295. { try
  296. { return DoubleConvertor::convert( getString() ); }
  297. catch( FieldConvertError& )
  298. { throw IncorrectDataFormat( getField(), getString() ); } }
  299. operator double() const
  300. { return getValue(); }
  301. };
  302. /// Field that contains an integer value
  303. class IntField : public FieldBase
  304. {
  305. public:
  306. explicit IntField( int field, int data )
  307. : FieldBase( field, IntConvertor::convert( data ) ) {}
  308. IntField( int field )
  309. : FieldBase( field, "" ) {}
  310. void setValue( int value )
  311. { setString( IntConvertor::convert( value ) ); }
  312. int getValue() const throw ( IncorrectDataFormat )
  313. { try
  314. { return IntConvertor::convert( getString() ); }
  315. catch( FieldConvertError& )
  316. { throw IncorrectDataFormat( getField(), getString() ); } }
  317. operator const int() const
  318. { return getValue(); }
  319. };
  320. /// Field that contains a boolean value
  321. class BoolField : public FieldBase
  322. {
  323. public:
  324. explicit BoolField( int field, bool data )
  325. : FieldBase( field, BoolConvertor::convert( data ) ) {}
  326. BoolField( int field )
  327. : FieldBase( field, "" ) {}
  328. void setValue( bool value )
  329. { setString( BoolConvertor::convert( value ) ); }
  330. bool getValue() const throw ( IncorrectDataFormat )
  331. { try
  332. { return BoolConvertor::convert( getString() ); }
  333. catch( FieldConvertError& )
  334. { throw IncorrectDataFormat( getField(), getString() ); } }
  335. operator bool() const
  336. { return getValue(); }
  337. };
  338. /// Field that contains a UTC time stamp value
  339. class UtcTimeStampField : public FieldBase
  340. {
  341. public:
  342. explicit UtcTimeStampField( int field, const UtcTimeStamp& data, bool showMilliseconds = false )
  343. : FieldBase( field, UtcTimeStampConvertor::convert( data, showMilliseconds ) ) {}
  344. UtcTimeStampField( int field, bool showMilliseconds = false )
  345. : FieldBase( field, UtcTimeStampConvertor::convert( UtcTimeStamp(), showMilliseconds ) ) {}
  346. void setValue( const UtcTimeStamp& value )
  347. { setString( UtcTimeStampConvertor::convert( value ) ); }
  348. UtcTimeStamp getValue() const throw ( IncorrectDataFormat )
  349. { try
  350. { return UtcTimeStampConvertor::convert( getString() ); }
  351. catch( FieldConvertError& )
  352. { throw IncorrectDataFormat( getField(), getString() ); } }
  353. operator UtcTimeStamp() const
  354. { return getValue(); }
  355. bool operator<( const UtcTimeStampField& rhs ) const
  356. { return getValue() < rhs.getValue(); }
  357. bool operator==( const UtcTimeStampField& rhs ) const
  358. { return getValue() == rhs.getValue(); }
  359. bool operator!=( const UtcTimeStampField& rhs ) const
  360. { return getValue() != rhs.getValue(); }
  361. };
  362. /// Field that contains a UTC date value
  363. class UtcDateField : public FieldBase
  364. {
  365. public:
  366. explicit UtcDateField( int field, const UtcDate& data )
  367. : FieldBase( field, UtcDateConvertor::convert( data ) ) {}
  368. UtcDateField( int field )
  369. : FieldBase( field, UtcDateConvertor::convert( UtcDate() ) ) {}
  370. void setValue( const UtcDate& value )
  371. { setString( UtcDateConvertor::convert( value ) ); }
  372. UtcDate getValue() const throw ( IncorrectDataFormat )
  373. { try
  374. { return UtcDateConvertor::convert( getString() ); }
  375. catch( FieldConvertError& )
  376. { throw IncorrectDataFormat( getField(), getString() ); } }
  377. operator UtcDate() const
  378. { return getValue(); }
  379. bool operator<( const UtcDateField& rhs ) const
  380. { return getValue() < rhs.getValue(); }
  381. bool operator==( const UtcDateField& rhs ) const
  382. { return getValue() == rhs.getValue(); }
  383. bool operator!=( const UtcDateField& rhs ) const
  384. { return getValue() != rhs.getValue(); }
  385. };
  386. /// Field that contains a UTC time value
  387. class UtcTimeOnlyField : public FieldBase
  388. {
  389. public:
  390. explicit UtcTimeOnlyField( int field, const UtcTimeOnly& data, bool showMilliseconds = false )
  391. : FieldBase( field, UtcTimeOnlyConvertor::convert( data, showMilliseconds ) ) {}
  392. UtcTimeOnlyField( int field, bool showMilliseconds = false )
  393. : FieldBase( field, UtcTimeOnlyConvertor::convert( UtcTimeOnly(), showMilliseconds ) ) {}
  394. void setValue( const UtcTimeOnly& value )
  395. { setString( UtcTimeOnlyConvertor::convert( value ) ); }
  396. UtcTimeOnly getValue() const throw ( IncorrectDataFormat )
  397. { try
  398. { return UtcTimeOnlyConvertor::convert( getString() ); }
  399. catch( FieldConvertError& )
  400. { throw IncorrectDataFormat( getField(), getString() ); } }
  401. operator UtcTimeOnly() const
  402. { return getValue(); }
  403. bool operator<( const UtcTimeOnlyField& rhs ) const
  404. { return getValue() < rhs.getValue(); }
  405. bool operator==( const UtcTimeOnlyField& rhs ) const
  406. { return getValue() == rhs.getValue(); }
  407. bool operator!=( const UtcTimeOnlyField& rhs ) const
  408. { return getValue() != rhs.getValue(); }
  409. };
  410. /// Field that contains a checksum value
  411. class CheckSumField : public FieldBase
  412. {
  413. public:
  414. explicit CheckSumField( int field, int data )
  415. : FieldBase( field, CheckSumConvertor::convert( data ) ) {}
  416. CheckSumField( int field )
  417. : FieldBase( field, "" ) {}
  418. void setValue( int value )
  419. { setString( CheckSumConvertor::convert( value ) ); }
  420. int getValue() const throw ( IncorrectDataFormat )
  421. { try
  422. { return CheckSumConvertor::convert( getString() ); }
  423. catch( FieldConvertError& )
  424. { throw IncorrectDataFormat( getField(), getString() ); } }
  425. operator const int() const
  426. { return getValue(); }
  427. };
  428. typedef DoubleField PriceField;
  429. typedef DoubleField AmtField;
  430. typedef DoubleField QtyField;
  431. typedef StringField CurrencyField;
  432. typedef StringField MultipleValueStringField;
  433. typedef StringField MultipleStringValueField;
  434. typedef StringField MultipleCharValueField;
  435. typedef StringField ExchangeField;
  436. typedef StringField LocalMktDateField;
  437. typedef StringField DataField;
  438. typedef DoubleField FloatField;
  439. typedef DoubleField PriceOffsetField;
  440. typedef StringField MonthField;
  441. typedef StringField MonthYearField;
  442. typedef StringField DayOfMonthField;
  443. typedef UtcDateField UtcDateOnlyField;
  444. typedef IntField LengthField;
  445. typedef IntField NumInGroupField;
  446. typedef IntField SeqNumField;
  447. typedef DoubleField PercentageField;
  448. typedef StringField CountryField;
  449. typedef StringField TzTimeOnlyField;
  450. typedef StringField TzTimeStampField;
  451. }
  452. #define DEFINE_FIELD_CLASS_NUM( NAME, TOK, TYPE, NUM ) \
  453. class NAME : public TOK##Field { public: \
  454. NAME() : TOK##Field(NUM) {} \
  455. NAME(const TYPE& value) : TOK##Field(NUM, value) {} \
  456. }
  457. #define DEFINE_FIELD_CLASS( NAME, TOK, TYPE ) \
  458. DEFINE_FIELD_CLASS_NUM(NAME, TOK, TYPE, FIELD::NAME)
  459. #define DEFINE_DEPRECATED_FIELD_CLASS( NAME, TOK, TYPE ) \
  460. DEFINE_FIELD_CLASS_NUM(NAME, TOK, TYPE, DEPRECATED_FIELD::NAME)
  461. #define DEFINE_FIELD_TIMECLASS_NUM( NAME, TOK, TYPE, NUM ) \
  462. class NAME : public TOK##Field { public: \
  463. NAME() : TOK##Field(NUM, false) {} \
  464. NAME(bool showMilliseconds) : TOK##Field(NUM, showMilliseconds) {} \
  465. NAME(const TYPE& value) : TOK##Field(NUM, value) {} \
  466. NAME(const TYPE& value, bool showMilliseconds) : TOK##Field(NUM, value, showMilliseconds) {} \
  467. }
  468. #define DEFINE_FIELD_TIMECLASS( NAME, TOK, TYPE ) \
  469. DEFINE_FIELD_TIMECLASS_NUM(NAME, TOK, TYPE, FIELD::NAME)
  470. #define DEFINE_DEPRECATED_FIELD_TIMECLASS( NAME, TOK, TYPE ) \
  471. DEFINE_FIELD_TIMECLASS_NUM(NAME, TOK, TYPE, DEPRECATED_FIELD::NAME)
  472. #define DEFINE_CHECKSUM( NAME ) \
  473. DEFINE_FIELD_CLASS(NAME, CheckSum, FIX::INT)
  474. #define DEFINE_STRING( NAME ) \
  475. DEFINE_FIELD_CLASS(NAME, String, FIX::STRING)
  476. #define DEFINE_CHAR( NAME ) \
  477. DEFINE_FIELD_CLASS(NAME, Char, FIX::CHAR)
  478. #define DEFINE_PRICE( NAME ) \
  479. DEFINE_FIELD_CLASS(NAME, Price, FIX::PRICE)
  480. #define DEFINE_INT( NAME ) \
  481. DEFINE_FIELD_CLASS(NAME, Int, FIX::INT)
  482. #define DEFINE_AMT( NAME ) \
  483. DEFINE_FIELD_CLASS(NAME, Amt, FIX::AMT)
  484. #define DEFINE_QTY( NAME ) \
  485. DEFINE_FIELD_CLASS(NAME, Qty, FIX::QTY)
  486. #define DEFINE_CURRENCY( NAME ) \
  487. DEFINE_FIELD_CLASS(NAME, Currency, FIX::CURRENCY)
  488. #define DEFINE_MULTIPLEVALUESTRING( NAME ) \
  489. DEFINE_FIELD_CLASS(NAME, MultipleValueString, FIX::MULTIPLEVALUESTRING)
  490. #define DEFINE_MULTIPLESTRINGVALUE( NAME ) \
  491. DEFINE_FIELD_CLASS(NAME, MultipleStringValue, FIX::MULTIPLESTRINGVALUE)
  492. #define DEFINE_MULTIPLECHARVALUE( NAME ) \
  493. DEFINE_FIELD_CLASS(NAME, MultipleCharValue, FIX::MULTIPLECHARVALUE)
  494. #define DEFINE_EXCHANGE( NAME ) \
  495. DEFINE_FIELD_CLASS(NAME, Exchange, FIX::EXCHANGE)
  496. #define DEFINE_UTCTIMESTAMP( NAME ) \
  497. DEFINE_FIELD_TIMECLASS(NAME, UtcTimeStamp, FIX::UTCTIMESTAMP)
  498. #define DEFINE_BOOLEAN( NAME ) \
  499. DEFINE_FIELD_CLASS(NAME, Bool, FIX::BOOLEAN)
  500. #define DEFINE_LOCALMKTDATE( NAME ) \
  501. DEFINE_FIELD_CLASS(NAME, String, FIX::LOCALMKTDATE)
  502. #define DEFINE_DATA( NAME ) \
  503. DEFINE_FIELD_CLASS(NAME, Data, FIX::DATA)
  504. #define DEFINE_FLOAT( NAME ) \
  505. DEFINE_FIELD_CLASS(NAME, Float, FIX::FLOAT)
  506. #define DEFINE_PRICEOFFSET( NAME ) \
  507. DEFINE_FIELD_CLASS(NAME, PriceOffset, FIX::PRICEOFFSET)
  508. #define DEFINE_MONTHYEAR( NAME ) \
  509. DEFINE_FIELD_CLASS(NAME, MonthYear, FIX::MONTHYEAR)
  510. #define DEFINE_DAYOFMONTH( NAME ) \
  511. DEFINE_FIELD_CLASS(NAME, DayOfMonth, FIX::DAYOFMONTH)
  512. #define DEFINE_UTCDATE( NAME ) \
  513. DEFINE_FIELD_CLASS(NAME, UtcDate, FIX::UTCDATE)
  514. #define DEFINE_UTCDATEONLY( NAME ) \
  515. DEFINE_FIELD_CLASS(NAME, UtcDateOnly, FIX::UTCDATEONLY)
  516. #define DEFINE_UTCTIMEONLY( NAME ) \
  517. DEFINE_FIELD_CLASS(NAME, UtcTimeOnly, FIX::UTCTIMEONLY)
  518. #define DEFINE_NUMINGROUP( NAME ) \
  519. DEFINE_FIELD_CLASS(NAME, NumInGroup, FIX::NUMINGROUP)
  520. #define DEFINE_SEQNUM( NAME ) \
  521. DEFINE_FIELD_CLASS(NAME, SeqNum, FIX::SEQNUM)
  522. #define DEFINE_LENGTH( NAME ) \
  523. DEFINE_FIELD_CLASS(NAME, Length, FIX::LENGTH)
  524. #define DEFINE_PERCENTAGE( NAME ) \
  525. DEFINE_FIELD_CLASS(NAME, Percentage, FIX::PERCENTAGE)
  526. #define DEFINE_COUNTRY( NAME ) \
  527. DEFINE_FIELD_CLASS(NAME, Country, FIX::COUNTRY)
  528. #define DEFINE_TZTIMEONLY( NAME ) \
  529. DEFINE_FIELD_CLASS(NAME, String, FIX::TZTIMEONLY)
  530. #define DEFINE_TZTIMESTAMP( NAME ) \
  531. DEFINE_FIELD_CLASS(NAME, String, FIX::TZTIMESTAMP)
  532. #define DEFINE_XMLDATA( NAME ) \
  533. DEFINE_FIELD_CLASS(NAME, String, FIX::XMLDATA)
  534. #define DEFINE_LANGUAGE( NAME ) \
  535. DEFINE_FIELD_CLASS(NAME, String, FIX::LANGUAGE)
  536. #define USER_DEFINE_STRING( NAME, NUM ) \
  537. DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::STRING, NUM)
  538. #define USER_DEFINE_CHAR( NAME, NUM ) \
  539. DEFINE_FIELD_CLASS_NUM(NAME, Char, FIX::CHAR, NUM)
  540. #define USER_DEFINE_PRICE( NAME, NUM ) \
  541. DEFINE_FIELD_CLASS_NUM(NAME, Price, FIX::PRICE, NUM)
  542. #define USER_DEFINE_INT( NAME, NUM ) \
  543. DEFINE_FIELD_CLASS_NUM(NAME, Int, FIX::INT, NUM)
  544. #define USER_DEFINE_AMT( NAME, NUM ) \
  545. DEFINE_FIELD_CLASS_NUM(NAME, Amt, FIX::AMT, NUM)
  546. #define USER_DEFINE_QTY( NAME, NUM ) \
  547. DEFINE_FIELD_CLASS_NUM(NAME, Qty, FIX::QTY, NUM)
  548. #define USER_DEFINE_CURRENCY( NAME, NUM ) \
  549. DEFINE_FIELD_CLASS_NUM(NAME, Currency, FIX::CURRENCY, NUM)
  550. #define USER_DEFINE_MULTIPLEVALUESTRING( NAME, NUM ) \
  551. DEFINE_FIELD_CLASS_NUM(NAME, MultipleValueString, FIX::MULTIPLEVALUESTRING, NUM)
  552. #define USER_DEFINE_MULTIPLESTRINGVALUE( NAME, NUM ) \
  553. DEFINE_FIELD_CLASS_NUM(NAME, MultipleStringValue, FIX::MULTIPLESTRINGVALUE, NUM)
  554. #define USER_DEFINE_MULTIPLECHARVALUE( NAME, NUM ) \
  555. DEFINE_FIELD_CLASS_NUM(NAME, MultipleCharValue, FIX::MULTIPLECHARVALUE, NUM)
  556. #define USER_DEFINE_EXCHANGE( NAME, NUM ) \
  557. DEFINE_FIELD_CLASS_NUM(NAME, Exchange, FIX::EXCHANGE, NUM)
  558. #define USER_DEFINE_UTCTIMESTAMP( NAME, NUM ) \
  559. DEFINE_FIELD_TIMECLASS_NUM(NAME, UtcTimeStamp, FIX::UTCTIMESTAMP, NUM)
  560. #define USER_DEFINE_BOOLEAN( NAME, NUM ) \
  561. DEFINE_FIELD_CLASS_NUM(NAME, Bool, FIX::BOOLEAN, NUM)
  562. #define USER_DEFINE_LOCALMKTDATE( NAME, NUM ) \
  563. DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::STRING, NUM)
  564. #define USER_DEFINE_DATA( NAME, NUM ) \
  565. DEFINE_FIELD_CLASS_NUM(NAME, Data, FIX::DATA, NUM)
  566. #define USER_DEFINE_FLOAT( NAME, NUM ) \
  567. DEFINE_FIELD_CLASS_NUM(NAME, Float, FIX::FLOAT, NUM)
  568. #define USER_DEFINE_PRICEOFFSET( NAME, NUM ) \
  569. DEFINE_FIELD_CLASS_NUM(NAME, PriceOffset, FIX::PRICEOFFSET, NUM)
  570. #define USER_DEFINE_MONTHYEAR( NAME, NUM ) \
  571. DEFINE_FIELD_CLASS_NUM(NAME, MonthYear, FIX::MONTHYEAR, NUM)
  572. #define USER_DEFINE_DAYOFMONTH( NAME, NUM ) \
  573. DEFINE_FIELD_CLASS_NUM(NAME, DayOfMonth, FIX::DAYOFMONTH, NUM)
  574. #define USER_DEFINE_UTCDATE( NAME, NUM ) \
  575. DEFINE_FIELD_CLASS_NUM(NAME, UtcDate, FIX::UTCDATE, NUM)
  576. #define USER_DEFINE_UTCDATEONLY( NAME, NUM ) \
  577. DEFINE_FIELD_CLASS_NUM(NAME, UtcDateOnly, FIX::UTCDATEONLY, NUM)
  578. #define USER_DEFINE_UTCTIMEONLY( NAME, NUM ) \
  579. DEFINE_FIELD_CLASS_NUM(NAME, UtcTimeOnly, FIX::UTCTIMEONLY, NUM)
  580. #define USER_DEFINE_NUMINGROUP( NAME, NUM ) \
  581. DEFINE_FIELD_CLASS_NUM(NAME, NumInGroup, FIX::NUMINGROUP, NUM)
  582. #define USER_DEFINE_SEQNUM( NAME, NUM ) \
  583. DEFINE_FIELD_CLASS_NUM(NAME, SeqNum, FIX::SEQNUM, NUM)
  584. #define USER_DEFINE_LENGTH( NAME, NUM ) \
  585. DEFINE_FIELD_CLASS_NUM(NAME, Length, FIX::LENGTH, NUM)
  586. #define USER_DEFINE_PERCENTAGE( NAME, NUM ) \
  587. DEFINE_FIELD_CLASS_NUM(NAME, Percentage, FIX::PERCENTAGE, NUM)
  588. #define USER_DEFINE_COUNTRY( NAME, NUM ) \
  589. DEFINE_FIELD_CLASS_NUM(NAME, Country, FIX::COUNTRY, NUM)
  590. #define USER_DEFINE_TZTIMEONLY( NAME, NUM ) \
  591. DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::TZTIMEONLY, NUM)
  592. #define USER_DEFINE_TZTIMESTAMP( NAME, NUM ) \
  593. DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::TZTIMESTAMP, NUM)
  594. #define USER_DEFINE_XMLDATA( NAME, NUM ) \
  595. DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::XMLDATA, NUM)
  596. #define USER_DEFINE_LANGUAGE( NAME, NUM ) \
  597. DEFINE_FIELD_CLASS_NUM(NAME, String, FIX::LANGUAGE, NUM)
  598. #endif