[Quickfix-developers] UtcTimeStamp
Brought to you by:
orenmnero
|
From: Alexey Z. <ale...@in...> - 2005-08-31 21:12:16
|
Hello,
I know that your are going to change the UtcTimeStamp class, but till
it's in the release
I want to warn people not to compare these objects (VC++):
For example:
...
FIX::SendingTime time;
header.getField(time);
FIX::UtcTimeStamp m_time1;
FIX::UtcTimeStamp m_time2;
header1.getField(time);
m_time1 = time.getValue();
header2.getField(time);
m_time2 = time.getValue();
if(m_time1 > m_time2) ->
doesn't work because UtcTimeStampConvertor::convert is called with
default parameter bool calculateDays = false:
const UtcTimeStamp getValue() const throw ( IncorrectDataFormat )
{ try
{ return UtcTimeStampConvertor::convert( getString() ); }
catch( FieldConvertError& )
{ throw IncorrectDataFormat( getField() ); } }
but when you compare the times it uses tm_wday... - uninitialized values.
inline bool operator==( const UtcTimeStamp& lhs, const UtcTimeStamp& rhs )
{
return
lhs.m_ms == rhs.m_ms
&& lhs.tm_sec == rhs.tm_sec
&& lhs.tm_min == rhs.tm_min
&& lhs.tm_hour == rhs.tm_hour
&& lhs.tm_mday == rhs.tm_mday
&& lhs.tm_mon == rhs.tm_mon
&& lhs.tm_year == rhs.tm_year
&& lhs.tm_wday == rhs.tm_wday
&& lhs.tm_yday == rhs.tm_yday;
}
--
Regards,
Alexey Zubko
Infinium Capital Corporation
(416) 360-7000 ext. 305
|