OnixS C++ FIX Engine 2.79.1.0
C:/Users/Pasha/_Dev/fixforge-cpp/fix/cppEngine/include/OnixS/FIX/ISessionStorage.h
00001 /*
00002 * Copyright 2005-2011 Onix Solutions Limited [OnixS]. All rights reserved. 
00003 * 
00004 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law 
00005 * and international copyright treaties. 
00006 * 
00007 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
00008 * Services Agreement (the Agreement) and Customer end user license agreements granting 
00009 * a non-assignable, non-transferable and non-exclusive license to use the software 
00010 * for it's own data processing purposes under the terms defined in the Agreement.
00011 * 
00012 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part 
00013 * of this source code or associated reference material to any other location for further reproduction
00014 * or redistribution, and any amendments to this copyright notice, are expressly prohibited. 
00015 *
00016 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with 
00017 * the terms of the Agreement is a violation of copyright law. 
00018 */
00019 
00020 #ifndef __ONIXS_CppFixEngine_SessionStorage_h_
00021 #define __ONIXS_CppFixEngine_SessionStorage_h_
00022 
00023 #include <string>
00024 #include <vector>
00025 
00026 #include "OnixS/FIX/ABI.h"
00027 #include "OnixS/FIX/Definitions.h"
00028 
00029 namespace OnixS{
00030 namespace FIX { 
00031 
00033 class ONIXS_FIXENGINE_API ISessionStorage{
00034 public:
00036     virtual ~ISessionStorage(){};
00037 
00039     virtual void clear() = 0;
00040 
00042     virtual void close(bool keepSequenceNumbers, bool doBackup) = 0;
00043 
00045     struct ONIXS_FIXENGINE_API RawMessagePointer
00046     {
00047         RawMessagePointer();
00048         
00049         RawMessagePointer(const byte* buffer, size_t length);
00050 
00052         const byte* buffer_;
00053 
00054         size_t length_;     
00055     };
00056 
00058     class ISessionStorageListener
00059     {
00060     public:
00062         virtual ~ISessionStorageListener(){};
00063 
00064         virtual void onReplayedMessage(const RawMessagePointer& pointer) = 0;               
00065     };
00066 
00068     virtual void getOutbound(int beginSequenceNumber, int endSequenceNumber, ISessionStorageListener* listener) = 0;
00069     
00071     virtual int inSeqNum() = 0;
00072 
00074     virtual void inSeqNum(int messageSequenceNumber) = 0;  
00075 
00077     virtual void storeInbound(int messageSequenceNumber, const RawMessagePointer& pointer) = 0;
00078 
00080     virtual void storeOutbound(int messageSequenceNumber, const RawMessagePointer& pointer)= 0; 
00081 
00085     virtual void setSessionTerminationFlag(bool terminated) = 0;
00086         
00088     virtual int outSeqNum() = 0;
00089 
00091     virtual void outSeqNum(int messageSequenceNumber) = 0;  
00092     
00093 };
00094 }};
00095 #endif