Index  Source Files  Annotated Class List  Alphabetical Class List  Class Hierarchy  Graphical Class Hierarchy   
 

/home/orenmnero/autobuild/quickfix/src/C++/SessionTime.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 /****************************************************************************
00004 ** Copyright (c) quickfixengine.org  All rights reserved.
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_SESSIONTIME_H
00023 #define FIX_SESSIONTIME_H
00024 
00025 #ifdef _MSC_VER
00026 #pragma warning( disable : 4503 4355 4786 4290 )
00027 #endif
00028 
00029 #include "FieldTypes.h"
00030 
00031 namespace FIX
00032 {
00034 class SessionTime
00035 {
00036 public:
00037   SessionTime( const UtcTimeOnly& startTime, const UtcTimeOnly &endTime,
00038                int startDay = -1, int endDay = -1 );
00039 
00040   static bool isSessionTime( const UtcTimeOnly& start,
00041                              const UtcTimeOnly& end,
00042                              const UtcTimeStamp& time );
00043 
00044   static bool isSessionTime( const UtcTimeOnly& startTime,
00045                              const UtcTimeOnly& endTime,
00046                              int startDay,
00047                              int endDay,
00048                              const UtcTimeStamp& time );
00049 
00050   static bool isSameSession( const UtcTimeOnly& start,
00051                              const UtcTimeOnly& end,
00052                              const UtcTimeStamp& time1,
00053                              const UtcTimeStamp& time2 );
00054 
00055   static bool isSameSession( const UtcTimeOnly& startTime,
00056                              const UtcTimeOnly& endTime,
00057                              int startDay,
00058                              int endDay,
00059                              const UtcTimeStamp& time1,
00060                              const UtcTimeStamp& time2 );
00061 
00062   bool isSessionTime()
00063   {
00064     if( m_startDay < 0 && m_endDay < 0 )
00065       return isSessionTime( m_startTime, m_endTime, UtcTimeStamp() );
00066     else
00067       return isSessionTime
00068         ( m_startTime, m_endTime, m_startDay, m_endDay, UtcTimeStamp() );
00069   }
00070 
00071   bool isSameSession( const UtcTimeStamp& time1, const UtcTimeStamp& time2 )
00072   {
00073     if( m_startDay < 0 && m_endDay < 0 )
00074       return isSameSession( m_startTime, m_endTime, time1, time2 );
00075     else
00076       return isSameSession
00077         ( m_startTime, m_endTime, m_startDay, m_endDay, time1, time2 );
00078   }
00079 
00080 private:
00081   UtcTimeOnly m_startTime;
00082   UtcTimeOnly m_endTime;
00083   int m_startDay;
00084   int m_endDay;
00085 };
00086 }
00087 
00088 #endif

Generated on Mon Jul 24 19:36:30 2006 for QuickFIX by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2001