00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 friend class Message;
00048 public:
00049 FieldBase( int field, const std::string& string, bool doCalculate = true )
00050 : m_field( field ), m_string(string), m_length( 0 ), m_total( 0 ),
00051 m_calculated( false )
00052 {}
00053
00054 void setField( int field )
00055 {
00056 m_field = field;
00057 m_calculated = false;
00058 }
00059
00060 void setString( const std::string& string )
00061 {
00062 m_string = string;
00063 m_calculated = false;
00064 }
00065
00067 int getField() const
00068 { return m_field; }
00069
00071 const std::string& getString() const
00072 { return m_string; }
00073
00075 const std::string& getValue() const
00076 {
00077 calculate();
00078 return m_data;
00079 }
00080
00082 int getLength() const
00083 {
00084 calculate();
00085 return m_length;
00086 }
00087
00089 int getTotal() const
00090 {
00091 calculate();
00092 return m_total;
00093 }
00094
00096 bool operator < ( const FieldBase& field ) const
00097 { return m_field < field.m_field; }
00098
00099 private:
00100 void calculate() const
00101 {
00102 if( m_calculated ) return;
00103
00104 char buf[64];
00105
00106 if( 13 + m_string.length() < sizeof(buf) )
00107 {
00108 int tagLength = STRING_SPRINTF( buf, "%d=", m_field );
00109 m_length = tagLength + m_string.length() + 1;
00110 memcpy( buf + tagLength, m_string.data(), m_string.length() );
00111 buf[m_length - 1] = '\001';
00112 m_data.assign( buf, m_length );
00113 }
00114 else
00115 {
00116 m_data = IntConvertor::convert(m_field) + "=" + m_string + "\001";
00117 m_length = m_data.length();
00118 }
00119
00120 const unsigned char* iter =
00121 reinterpret_cast<const unsigned char*>( m_data.c_str() );
00122 m_total = std::accumulate( iter, iter + m_length, 0 );
00123
00124 m_calculated = true;
00125 }
00126
00127 int m_field;
00128 std::string m_string;
00129 mutable std::string m_data;
00130 mutable int m_length;
00131 mutable int m_total;
00132 mutable bool m_calculated;
00133 };
00136 inline std::ostream& operator <<
00137 ( std::ostream& stream, const FieldBase& field )
00138 {
00139 stream << field.getString();
00140 return stream;
00141 }
00142
00147 class StringField : public FieldBase
00148 {
00149 public:
00150 explicit StringField( int field, const std::string& data )
00151 : FieldBase( field, data ) {}
00152 StringField( int field )
00153 : FieldBase( field, "" ) {}
00154
00155 void setValue( const std::string& value )
00156 { setString( value ); }
00157 const std::string getValue() const
00158 { return getString(); }
00159 operator const std::string() const
00160 { return getString(); }
00161
00162 bool operator<( const StringField& rhs ) const
00163 { return getString() < rhs.getString(); }
00164 bool operator>( const StringField& rhs ) const
00165 { return getString() > rhs.getString(); }
00166 bool operator==( const StringField& rhs ) const
00167 { return getString() == rhs.getString(); }
00168 bool operator!=( const StringField& rhs ) const
00169 { return getString() != rhs.getString(); }
00170 bool operator<=( const StringField& rhs ) const
00171 { return getString() <= rhs.getString(); }
00172 bool operator>=( const StringField& rhs ) const
00173 { return getString() >= rhs.getString(); }
00174 friend bool operator<( const StringField&, const char* );
00175 friend bool operator<( const char*, const StringField& );
00176 friend bool operator>( const StringField&, const char* );
00177 friend bool operator>( const char*, const StringField& );
00178 friend bool operator==( const StringField&, const char* );
00179 friend bool operator==( const char*, const StringField& );
00180 friend bool operator!=( const StringField&, const char* );
00181 friend bool operator!=( const char*, const StringField& );
00182 friend bool operator<=( const StringField&, const char* );
00183 friend bool operator<=( const char*, const StringField& );
00184 friend bool operator>=( const StringField&, const char* );
00185 friend bool operator>=( const char*, const StringField& );
00186
00187 friend bool operator<( const StringField&, const std::string& );
00188 friend bool operator<( const std::string&, const StringField& );
00189 friend bool operator>( const StringField&, const std::string& );
00190 friend bool operator>( const std::string&, const StringField& );
00191 friend bool operator==( const StringField&, const std::string& );
00192 friend bool operator==( const std::string&, const StringField& );
00193 friend bool operator!=( const StringField&, const std::string& );
00194 friend bool operator!=( const std::string&, const StringField& );
00195 friend bool operator<=( const StringField&, const std::string& );
00196 friend bool operator<=( const std::string&, const StringField& );
00197 friend bool operator>=( const StringField&, const std::string& );
00198 friend bool operator>=( const std::string&, const StringField& );
00199 };
00200
00201 inline bool operator<( const StringField& lhs, const char* rhs )
00202 { return lhs.getValue() < rhs; }
00203 inline bool operator<( const char* lhs, const StringField& rhs )
00204 { return lhs < rhs.getValue(); }
00205 inline bool operator>( const StringField& lhs, const char* rhs )
00206 { return lhs.getValue() > rhs; }
00207 inline bool operator>( const char* lhs, const StringField& rhs )
00208 { return lhs > rhs.getValue(); }
00209 inline bool operator==( const StringField& lhs, const char* rhs )
00210 { return lhs.getValue() == rhs; }
00211 inline bool operator==( const char* lhs, const StringField& rhs )
00212 { return lhs == rhs.getValue(); }
00213 inline bool operator!=( const StringField& lhs, const char* rhs )
00214 { return lhs.getValue() != rhs; }
00215 inline bool operator!=( const char* lhs, const StringField& rhs )
00216 { return lhs != rhs.getValue(); }
00217 inline bool operator<=( const StringField& lhs, const char* rhs )
00218 { return lhs.getValue() <= rhs; }
00219 inline bool operator<=( const char* lhs, const StringField& rhs )
00220 { return lhs <= rhs.getValue(); }
00221 inline bool operator>=( const StringField& lhs, const char* rhs )
00222 { return lhs.getValue() >= rhs; }
00223 inline bool operator>=( const char* lhs, const StringField& rhs )
00224 { return lhs >= rhs.getValue(); }
00225
00226 inline bool operator<( const StringField& lhs, const std::string& rhs )
00227 { return lhs.getValue() < rhs; }
00228 inline bool operator<( const std::string& lhs, const StringField& rhs )
00229 { return lhs < rhs.getValue(); }
00230 inline bool operator>( const StringField& lhs, const std::string& rhs )
00231 { return lhs.getValue() > rhs; }
00232 inline bool operator>( const std::string& lhs, const StringField& rhs )
00233 { return lhs > rhs.getValue(); }
00234 inline bool operator==( const StringField& lhs, const std::string& rhs )
00235 { return lhs.getValue() == rhs; }
00236 inline bool operator==( const std::string& lhs, const StringField& rhs )
00237 { return lhs == rhs.getValue(); }
00238 inline bool operator!=( const StringField& lhs, const std::string& rhs )
00239 { return lhs.getValue() != rhs; }
00240 inline bool operator!=( const std::string& lhs, const StringField& rhs )
00241 { return lhs != rhs.getValue(); }
00242 inline bool operator<=( const StringField& lhs, const std::string& rhs )
00243 { return lhs.getValue() <= rhs; }
00244 inline bool operator<=( const std::string& lhs, const StringField& rhs )
00245 { return lhs <= rhs.getValue(); }
00246 inline bool operator>=( const StringField& lhs, const std::string& rhs )
00247 { return lhs.getValue() >= rhs; }
00248 inline bool operator>=( const std::string& lhs, const StringField& rhs )
00249 { return lhs >= rhs.getValue(); }
00250
00252 class CharField : public FieldBase
00253 {
00254 public:
00255 explicit CharField( int field, char data )
00256 : FieldBase( field, CharConvertor::convert( data ) ) {}
00257 CharField( int field )
00258 : FieldBase( field, "" ) {}
00259
00260 void setValue( char value )
00261 { setString( CharConvertor::convert( value ) ); }
00262 const char getValue() const throw ( IncorrectDataFormat )
00263 { try
00264 { return CharConvertor::convert( getString() ); }
00265 catch( FieldConvertError& )
00266 { throw IncorrectDataFormat( getField() ); } }
00267 operator const char() const
00268 { return getValue(); }
00269 };
00270
00272 class DoubleField : public FieldBase
00273 {
00274 public:
00275 explicit DoubleField( int field, double data, int padding = 0 )
00276 : FieldBase( field, DoubleConvertor::convert( data, padding ) ) {}
00277 DoubleField( int field )
00278 : FieldBase( field, "" ) {}
00279
00280 void setValue( double value, int padding = 0 )
00281 { setString( DoubleConvertor::convert( value, padding ) ); }
00282 const double getValue() const throw ( IncorrectDataFormat )
00283 { try
00284 { return DoubleConvertor::convert( getString() ); }
00285 catch( FieldConvertError& )
00286 { throw IncorrectDataFormat( getField() ); } }
00287 operator const double() const
00288 { return getValue(); }
00289 };
00290
00292 class IntField : public FieldBase
00293 {
00294 public:
00295 explicit IntField( int field, int data )
00296 : FieldBase( field, IntConvertor::convert( data ) ) {}
00297 IntField( int field )
00298 : FieldBase( field, "" ) {}
00299
00300 void setValue( int value )
00301 { setString( IntConvertor::convert( value ) ); }
00302 const int getValue() const throw ( IncorrectDataFormat )
00303 { try
00304 { return IntConvertor::convert( getString() ); }
00305 catch( FieldConvertError& )
00306 { throw IncorrectDataFormat( getField() ); } }
00307 operator const int() const
00308 { return getValue(); }
00309 };
00310
00312 class BoolField : public FieldBase
00313 {
00314 public:
00315 explicit BoolField( int field, bool data )
00316 : FieldBase( field, BoolConvertor::convert( data ) ) {}
00317 BoolField( int field )
00318 : FieldBase( field, "" ) {}
00319
00320 void setValue( bool value )
00321 { setString( BoolConvertor::convert( value ) ); }
00322 const bool getValue() const throw ( IncorrectDataFormat )
00323 { try
00324 { return BoolConvertor::convert( getString() ); }
00325 catch( FieldConvertError& )
00326 { throw IncorrectDataFormat( getField() ); } }
00327 operator const bool() const
00328 { return getValue(); }
00329 };
00330
00332 class UtcTimeStampField : public FieldBase
00333 {
00334 public:
00335 explicit UtcTimeStampField( int field, const UtcTimeStamp& data, bool showMilliseconds = false )
00336 : FieldBase( field, UtcTimeStampConvertor::convert( data, showMilliseconds ) ) {}
00337 UtcTimeStampField( int field, bool showMilliseconds = false )
00338 : FieldBase( field, UtcTimeStampConvertor::convert( UtcTimeStamp(), showMilliseconds ) ) {}
00339
00340 void setValue( UtcTimeStamp& value )
00341 { setString( UtcTimeStampConvertor::convert( value ) ); }
00342 UtcTimeStamp getValue() const throw ( IncorrectDataFormat )
00343 { try
00344 { return UtcTimeStampConvertor::convert( getString() ); }
00345 catch( FieldConvertError& )
00346 { throw IncorrectDataFormat( getField() ); } }
00347 operator UtcTimeStamp() const
00348 { return getValue(); }
00349
00350 bool operator<( const UtcTimeStampField& rhs ) const
00351 { return getValue() < rhs.getValue(); }
00352 bool operator==( const UtcTimeStampField& rhs ) const
00353 { return getValue() == rhs.getValue(); }
00354 bool operator!=( const UtcTimeStampField& rhs ) const
00355 { return getValue() != rhs.getValue(); }
00356 };
00357
00359 class UtcDateField : public FieldBase
00360 {
00361 public:
00362 explicit UtcDateField( int field, const UtcDate& data )
00363 : FieldBase( field, UtcDateConvertor::convert( data ) ) {}
00364 UtcDateField( int field )
00365 : FieldBase( field, UtcDateConvertor::convert( UtcDate() ) ) {}
00366
00367 void setValue( UtcDate& value )
00368 { setString( UtcDateConvertor::convert( value ) ); }
00369 UtcDate getValue() const throw ( IncorrectDataFormat )
00370 { try
00371 { return UtcDateConvertor::convert( getString() ); }
00372 catch( FieldConvertError& )
00373 { throw IncorrectDataFormat( getField() ); } }
00374 operator UtcDate() const
00375 { return getValue(); }
00376
00377 bool operator<( const UtcDateField& rhs ) const
00378 { return getValue() < rhs.getValue(); }
00379 bool operator==( const UtcDateField& rhs ) const
00380 { return getValue() == rhs.getValue(); }
00381 bool operator!=( const UtcDateField& rhs ) const
00382 { return getValue() != rhs.getValue(); }
00383 };
00384
00386 class UtcTimeOnlyField : public FieldBase
00387 {
00388 public:
00389 explicit UtcTimeOnlyField( int field, const UtcTimeOnly& data, bool showMilliseconds = false )
00390 : FieldBase( field, UtcTimeOnlyConvertor::convert( data, showMilliseconds ) ) {}
00391 UtcTimeOnlyField( int field, bool showMilliseconds = false )
00392 : FieldBase( field, UtcTimeOnlyConvertor::convert( UtcTimeOnly(), showMilliseconds ) ) {}
00393
00394 void setValue( UtcTimeOnly& value )
00395 { setString( UtcTimeOnlyConvertor::convert( value ) ); }
00396 UtcTimeOnly getValue() const throw ( IncorrectDataFormat )
00397 { try
00398 { return UtcTimeOnlyConvertor::convert( getString() ); }
00399 catch( FieldConvertError& )
00400 { throw IncorrectDataFormat( getField() ); } }
00401 operator UtcTimeOnly() const
00402 { return getValue(); }
00403
00404 bool operator<( const UtcTimeOnlyField& rhs ) const
00405 { return getValue() < rhs.getValue(); }
00406 bool operator==( const UtcTimeOnlyField& rhs ) const
00407 { return getValue() == rhs.getValue(); }
00408 bool operator!=( const UtcTimeOnlyField& rhs ) const
00409 { return getValue() != rhs.getValue(); }
00410 };
00411
00413 class CheckSumField : public FieldBase
00414 {
00415 public:
00416 explicit CheckSumField( int field, int data )
00417 : FieldBase( field, CheckSumConvertor::convert( data ) ) {}
00418 CheckSumField( int field )
00419 : FieldBase( field, "" ) {}
00420
00421 void setValue( int value )
00422 { setString( CheckSumConvertor::convert( value ) ); }
00423 const int getValue() const throw ( IncorrectDataFormat )
00424 { try
00425 { return CheckSumConvertor::convert( getString() ); }
00426 catch( FieldConvertError& )
00427 { throw IncorrectDataFormat( getField() ); } }
00428 operator const int() const
00429 { return getValue(); }
00430 };
00431
00432 typedef DoubleField PriceField;
00433 typedef DoubleField AmtField;
00434 typedef DoubleField QtyField;
00435 typedef StringField CurrencyField;
00436 typedef StringField MultipleValueStringField;
00437 typedef StringField ExchangeField;
00438 typedef StringField LocalMktDateField;
00439 typedef StringField DataField;
00440 typedef DoubleField FloatField;
00441 typedef DoubleField PriceOffsetField;
00442 typedef StringField MonthField;
00443 typedef StringField MonthYearField;
00444 typedef StringField DayOfMonthField;
00445 typedef UtcDateField UtcDateOnlyField;
00446 typedef IntField LengthField;
00447 typedef IntField NumInGroupField;
00448 typedef IntField SeqNumField;
00449 typedef DoubleField PercentageField;
00450 typedef StringField CountryField;
00451 }
00452
00453 #define DEFINE_FIELD_CLASS_NUM( NAME, TOK, TYPE, NUM ) \
00454 class NAME : public TOK##Field { public: \
00455 NAME() : TOK##Field(NUM) {} \
00456 NAME(const TYPE& value) : TOK##Field(NUM, value) {} \
00457 }
00458
00459 #define DEFINE_FIELD_CLASS( NAME, TOK, TYPE ) \
00460 DEFINE_FIELD_CLASS_NUM(NAME, TOK, TYPE, FIELD::NAME)
00461
00462 #define DEFINE_DEPRECATED_FIELD_CLASS( NAME, TOK, TYPE ) \
00463 DEFINE_FIELD_CLASS_NUM(NAME, TOK, TYPE, DEPRECATED_FIELD::NAME)
00464
00465 #define DEFINE_FIELD_TIMECLASS_NUM( NAME, TOK, TYPE, NUM ) \
00466 class NAME : public TOK##Field { public: \
00467 NAME() : TOK##Field(NUM, false) {} \
00468 NAME(bool showMilliseconds) : TOK##Field(NUM, showMilliseconds) {} \
00469 NAME(const TYPE& value) : TOK##Field(NUM, value) {} \
00470 NAME(const TYPE& value, bool showMilliseconds) : TOK##Field(NUM, value, showMilliseconds) {} \
00471 }
00472
00473 #define DEFINE_FIELD_TIMECLASS( NAME, TOK, TYPE ) \
00474 DEFINE_FIELD_TIMECLASS_NUM(NAME, TOK, TYPE, FIELD::NAME)
00475
00476 #define DEFINE_DEPRECATED_FIELD_TIMECLASS( NAME, TOK, TYPE ) \
00477 DEFINE_FIELD_TIMECLASS_NUM(NAME, TOK, TYPE, DEPRECATED_FIELD::NAME)
00478
00479 #define DEFINE_CHECKSUM( NAME ) \
00480 DEFINE_FIELD_CLASS(NAME, CheckSum, INT)
00481 #define DEFINE_STRING( NAME ) \
00482 DEFINE_FIELD_CLASS(NAME, String, STRING)
00483 #define DEFINE_CHAR( NAME ) \
00484 DEFINE_FIELD_CLASS(NAME, Char, CHAR)
00485 #define DEFINE_PRICE( NAME ) \
00486 DEFINE_FIELD_CLASS(NAME, Price, PRICE)
00487 #define DEFINE_INT( NAME ) \
00488 DEFINE_FIELD_CLASS(NAME, Int, INT)
00489 #define DEFINE_AMT( NAME ) \
00490 DEFINE_FIELD_CLASS(NAME, Amt, AMT)
00491 #define DEFINE_QTY( NAME ) \
00492 DEFINE_FIELD_CLASS(NAME, Qty, QTY)
00493 #define DEFINE_CURRENCY( NAME ) \
00494 DEFINE_FIELD_CLASS(NAME, Currency, CURRENCY)
00495 #define DEFINE_MULTIPLEVALUESTRING( NAME ) \
00496 DEFINE_FIELD_CLASS(NAME, MultipleValueString, MULTIPLEVALUESTRING)
00497 #define DEFINE_EXCHANGE( NAME ) \
00498 DEFINE_FIELD_CLASS(NAME, Exchange, EXCHANGE)
00499 #define DEFINE_UTCTIMESTAMP( NAME ) \
00500 DEFINE_FIELD_TIMECLASS(NAME, UtcTimeStamp, UTCTIMESTAMP)
00501 #define DEFINE_BOOLEAN( NAME ) \
00502 DEFINE_FIELD_CLASS(NAME, Bool, BOOLEAN)
00503 #define DEFINE_LOCALMKTDATE( NAME ) \
00504 DEFINE_FIELD_CLASS(NAME, String, LOCALMKTDATE)
00505 #define DEFINE_DATA( NAME ) \
00506 DEFINE_FIELD_CLASS(NAME, Data, DATA)
00507 #define DEFINE_FLOAT( NAME ) \
00508 DEFINE_FIELD_CLASS(NAME, Float, FLOAT)
00509 #define DEFINE_PRICEOFFSET( NAME ) \
00510 DEFINE_FIELD_CLASS(NAME, PriceOffset, PRICEOFFSET)
00511 #define DEFINE_MONTHYEAR( NAME ) \
00512 DEFINE_FIELD_CLASS(NAME, MonthYear, MONTHYEAR)
00513 #define DEFINE_DAYOFMONTH( NAME ) \
00514 DEFINE_FIELD_CLASS(NAME, DayOfMonth, DAYOFMONTH)
00515 #define DEFINE_UTCDATE( NAME ) \
00516 DEFINE_FIELD_CLASS(NAME, UtcDate, UTCDATE)
00517 #define DEFINE_UTCDATEONLY( NAME ) \
00518 DEFINE_FIELD_CLASS(NAME, UtcDateOnly, UTCDATEONLY)
00519 #define DEFINE_UTCTIMEONLY( NAME ) \
00520 DEFINE_FIELD_CLASS(NAME, UtcTimeOnly, UTCTIMEONLY)
00521 #define DEFINE_NUMINGROUP( NAME ) \
00522 DEFINE_FIELD_CLASS(NAME, NumInGroup, NUMINGROUP)
00523 #define DEFINE_SEQNUM( NAME ) \
00524 DEFINE_FIELD_CLASS(NAME, SeqNum, SEQNUM)
00525 #define DEFINE_LENGTH( NAME ) \
00526 DEFINE_FIELD_CLASS(NAME, Length, LENGTH)
00527 #define DEFINE_PERCENTAGE( NAME ) \
00528 DEFINE_FIELD_CLASS(NAME, Percentage, PERCENTAGE)
00529 #define DEFINE_COUNTRY( NAME ) \
00530 DEFINE_FIELD_CLASS(NAME, Country, COUNTRY)
00531
00532 #define USER_DEFINE_STRING( NAME, NUM ) \
00533 DEFINE_FIELD_CLASS_NUM(NAME, String, STRING, NUM)
00534 #define USER_DEFINE_CHAR( NAME, NUM ) \
00535 DEFINE_FIELD_CLASS_NUM(NAME, Char, CHAR, NUM)
00536 #define USER_DEFINE_PRICE( NAME, NUM ) \
00537 DEFINE_FIELD_CLASS_NUM(NAME, Price, PRICE, NUM)
00538 #define USER_DEFINE_INT( NAME, NUM ) \
00539 DEFINE_FIELD_CLASS_NUM(NAME, Int, INT, NUM)
00540 #define USER_DEFINE_AMT( NAME, NUM ) \
00541 DEFINE_FIELD_CLASS_NUM(NAME, Amt, AMT, NUM)
00542 #define USER_DEFINE_QTY( NAME, NUM ) \
00543 DEFINE_FIELD_CLASS_NUM(NAME, Qty, QTY, NUM)
00544 #define USER_DEFINE_CURRENCY( NAME, NUM ) \
00545 DEFINE_FIELD_CLASS_NUM(NAME, Currency, CURRENCY, NUM)
00546 #define USER_DEFINE_MULTIPLEVALUESTRING( NAME, NUM ) \
00547 DEFINE_FIELD_CLASS_NUM(NAME, MultipleValueString, MULTIPLEVALUESTRING, NUM)
00548 #define USER_DEFINE_EXCHANGE( NAME, NUM ) \
00549 DEFINE_FIELD_CLASS_NUM(NAME, Exchange, EXCHANGE, NUM)
00550 #define USER_DEFINE_UTCTIMESTAMP( NAME, NUM ) \
00551 DEFINE_FIELD_CLASS_NUM(NAME, UtcTimeStamp, UTCTIMESTAMP, NUM)
00552 #define USER_DEFINE_BOOLEAN( NAME, NUM ) \
00553 DEFINE_FIELD_CLASS_NUM(NAME, Bool, BOOLEAN, NUM)
00554 #define USER_DEFINE_LOCALMKTDATE( NAME, NUM ) \
00555 DEFINE_FIELD_CLASS_NUM(NAME, String, STRING, NUM)
00556 #define USER_DEFINE_DATA( NAME, NUM ) \
00557 DEFINE_FIELD_CLASS_NUM(NAME, Data, DATA, NUM)
00558 #define USER_DEFINE_FLOAT( NAME, NUM ) \
00559 DEFINE_FIELD_CLASS_NUM(NAME, Float, FLOAT, NUM)
00560 #define USER_DEFINE_PRICEOFFSET( NAME, NUM ) \
00561 DEFINE_FIELD_CLASS_NUM(NAME, PriceOffset, PRICEOFFSET, NUM)
00562 #define USER_DEFINE_MONTHYEAR( NAME, NUM ) \
00563 DEFINE_FIELD_CLASS_NUM(NAME, MonthYear, MONTHYEAR, NUM)
00564 #define USER_DEFINE_DAYOFMONTH( NAME, NUM ) \
00565 DEFINE_FIELD_CLASS_NUM(NAME, DayOfMonth, DAYOFMONTH, NUM)
00566 #define USER_DEFINE_UTCDATE( NAME, NUM ) \
00567 DEFINE_FIELD_CLASS_NUM(NAME, UtcDate, UTCDATE, NUM)
00568 #define USER_DEFINE_UTCDATEONLY( NAME, NUM ) \
00569 DEFINE_FIELD_CLASS_NUM(NAME, UtcDateOnly, UTCDATEONLY, NUM)
00570 #define USER_DEFINE_UTCTIMEONLY( NAME, NUM ) \
00571 DEFINE_FIELD_CLASS_NUM(NAME, UtcTimeOnly, UTCTIMEONLY, NUM)
00572 #define USER_DEFINE_NUMINGROUP( NAME, NUM ) \
00573 DEFINE_FIELD_CLASS_NUM(NAME, NumInGroup, NUMINGROUP, NUM)
00574 #define USER_DEFINE_SEQNUM( NAME, NUM ) \
00575 DEFINE_FIELD_CLASS_NUM(NAME, SeqNum, SEQNUM, NUM)
00576 #define USER_DEFINE_LENGTH( NAME, NUM ) \
00577 DEFINE_FIELD_CLASS_NUM(NAME, Length, LENGTH, NUM)
00578 #define USER_DEFINE_PERCENTAGE( NAME, NUM ) \
00579 DEFINE_FIELD_CLASS_NUM(NAME, Percentage, PERCENTAGE, NUM)
00580 #define USER_DEFINE_COUNTRY( NAME, NUM ) \
00581 DEFINE_FIELD_CLASS_NUM(NAME, Country, COUNTRY, NUM)
00582
00583 #endif
00584