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

# NullStore.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_NULLSTORE_H
    00023 #define FIX_NULLSTORE_H
    00024
    00025 #ifdef _MSC_VER
    00026 #pragma warning( disable : 4503 4355 4786 4290 )
    00027 #endif
    00028
    00029 #include "MessageStore.h"
    00030 #include "SessionSettings.h"
    00031 #include <string>
    00032
    00033 namespace FIX
    00034 {
    00035 class Session;
    00036
    00043 class NullStoreFactory : public MessageStoreFactory
    00044 {
    00045 public:
    00046   MessageStore* create( const SessionID& );
    00047   void destroy( MessageStore* );
    00048 };
    00058 class NullStore : public MessageStore
    00059 {
    00060 public:
    00061   NullStore() : m_nextSenderMsgSeqNum( 1 ), m_nextTargetMsgSeqNum( 1 ) {}
    00062
    00063   bool set( int, const std::string& ) throw ( IOException );
    00064   void get( int, int, std::vector < std::string > & ) const throw ( IOException );
    00065
    00066   int getNextSenderMsgSeqNum() const throw ( IOException )
    00067   { return m_nextSenderMsgSeqNum; }
    00068   int getNextTargetMsgSeqNum() const throw ( IOException )
    00069   { return m_nextTargetMsgSeqNum; }
    00070   void setNextSenderMsgSeqNum( int value ) throw ( IOException )
    00071   { m_nextSenderMsgSeqNum = value; }
    00072   void setNextTargetMsgSeqNum( int value ) throw ( IOException )
    00073   { m_nextTargetMsgSeqNum = value; }
    00074   void incrNextSenderMsgSeqNum() throw ( IOException )
    00075   { ++m_nextSenderMsgSeqNum; }
    00076   void incrNextTargetMsgSeqNum() throw ( IOException )
    00077   { ++m_nextTargetMsgSeqNum; }
    00078
    00079   void setCreationTime( const UtcTimeStamp& creationTime ) throw ( IOException )
    00080   { m_creationTime = creationTime; }
    00081   UtcTimeStamp getCreationTime() const throw ( IOException )
    00082   { return m_creationTime; }
    00083
    00084   void reset() throw ( IOException )
    00085   {
    00086     m_nextSenderMsgSeqNum = 1; m_nextTargetMsgSeqNum = 1;
    00087     m_creationTime.setCurrent();
    00088   }
    00089   void refresh() throw ( IOException ) {}
    00090
    00091 private:
    00092   int m_nextSenderMsgSeqNum;
    00093   int m_nextTargetMsgSeqNum;
    00094   UtcTimeStamp m_creationTime;
    00095 };
    00096 }
    00097
    00098 #endif // FIX_NULLSTORE_H
    00099