RE: [Quickfix-developers] Millisecond resolution in UTCTimeStamp
Brought to you by:
orenmnero
From: Miller, O. <OM...@ri...> - 2003-11-05 21:27:05
|
I'd also like to add a configuration setting that can turn on and off = sending messages with milliseconds. There may be some fix engines = people want to talk to (QF 1.0 to 1.6 for instance!) that will not be = able to handle them. -----Original Message----- From: Daniel May [mailto:Dan...@ma...] Sent: Wed 11/5/2003 9:29 AM To: qui...@li... Cc: Miller, Oren; Joerg Thoennes Subject: [Quickfix-developers] Millisecond resolution in UTCTimeStamp I have checked in the code changes that allow millisecond time stamp resolution per the FIX 4.2 and later specification. QF will check message headers and include the milliseconds if the BeginString >=3D FIX.4.2 . There were several files that needed to be modified, I have listed them below along with a few caveats concerning the implementation. FieldTypes.h and FieldType.cpp These files contain the bulk of the code changes. I added a private member to the class FIX::UtcTimeStamp to hold milliseconds, m_ms. I added a set/get for access. When you create a FIX::UtcTimeStamp, the default has always been to set it to the current time/date, this remains the same, and the millisecond field is populated. I chose to use ftime() to replace time() since it returns the time_t structure the original FIX::UtcTimeStamp was derived from. PLEASE NOTE: Under MS Windows (NT,2K,XP), ftime() has at best a resolution of 10ms on a single processor machine, and 15ms on a multiple processor machine. FieldConvertors.h When using UtcTimeStampConvertor to convert to a std::string, there is an optional bool parameter (default false) which will force the conversion to include .sss in the string. When converting from a std::string to a UtcTimeStamp, I will always parse the milliseconds if they are present in the format HH:MM:SS.sss, with some basic validation. The same holds true for UtcTimeOnlyConvertor. Session.cpp When setting the SendingTime() field, I check for a BegingString >=3D BeginString_FIX42, and include milliseconds. fieldconvertorstestcase.cpp sessiontestcase.cpp utctimeonlytestcase.cpp utctimestamptestcase.cpp Several of the test cases had to be modified to properly initialize the milliseconds in UtcTimeStamp. I also added a test case to verify the conversion routines. =09 =20 Daniel May da...@so... |