B2BITS FIX Antenna HFT
1.0.17
|
FileT message storage. More...
#include <FileMsgStorage.h>
Public Types | |
typedef std::map< typename LogFileT< FileT >::MsgHandle, typename IndexFileT< FileT > ::Data > | RejectedMapT |
typedef std::map< typename LogFileT< FileT >::SeqNum, typename LogFileT< FileT > ::MsgHandle > | ToBeResentCollection |
![]() | |
typedef std::vector < StorableMsg * > | FixMsgs |
typedef std::deque< std::string > | OutgoingMessages |
enum | StorageType { PRIMARY_STORAGE = 0, BACKUP_STORAGE } |
Defines type of the storage. More... | |
Public Member Functions | |
FileMsgStorageT (StorageType type, const std::string &baseName, FileT &outFile, FileT &outIndexFile, FileT &inFile, FileT &inIndexFile, Utils::FilePropertiesT< System::FileEx > *configInfo, bool flushStreams, StorageMgr::PersistentSessionInfo *info) | |
Constructor. More... | |
virtual const std::string * | getBaseFilePath () const |
Reimplemented from MsgStorage. More... | |
virtual bool | getBoolConfigInfo (const std::string &aKey, bool *aValue) const |
Retrieves configuration information. More... | |
bool | getConfigInfo (const std::string &aKey, std::string *val) const |
Reimplemented from MsgStorage. More... | |
int | getInSeqNum () |
virtual bool | getIntConfigInfo (const std::string &aKey, int *aValue) const |
Retrieves configuration information. More... | |
int | getMaxSeqNum () |
Reimplemented from MsgStorage. More... | |
int | getMinSeqNum () |
Reimplemented from MsgStorage. More... | |
virtual RejectMsgStorage * | getRejectStorage () |
Reimplemented from MsgStorage. More... | |
virtual System::u64 | getSessionGlobalID () const |
virtual System::u64 | getSessionInternalState () const |
int | getStoredInSeqNum () const |
Returns current incoming seqNum from config. More... | |
int | getStoredOutSeqNum () const |
Returns current outgoing seqNum from config. More... | |
virtual bool | hasRejectedMessage () |
Reimplemented from RejectMsgStorage. More... | |
virtual bool | isPersistentStorage () const |
Reimplemented from MsgStorage. More... | |
virtual bool | isStorageCorrupted () const |
Checks if the storage is corrupted. More... | |
int | load (FIXVersion preferredVersion=NA) |
Reimplemented from MsgStorage. More... | |
void | loadInMemoryCache (ToBeResentCollection &toBeResent, int beginSeqNum, int endSeqNum, int currentOutSeqNum) |
virtual bool | logLocal (StorableMsg const *pMsg, const RawMsg &aRawMsg) |
Reimplemented from MsgStorage. More... | |
virtual bool | logLocal (StorableMsg const *pMsg, const char *pRawMsg, int size) |
Stores the given outgoing message and then destroys it. More... | |
virtual void | logRemote (StorableMsg const *pMsg, const RawMsg &rawMsg) |
Reimplemented from MsgStorage. More... | |
virtual void | logRemote (StorableMsg const *pMsg, const char *pRawMsg, int size) |
Logs the message from the remote FIX engine. More... | |
void | markAsTerminated (bool correctlyTerminated) |
Reimplemented from MsgStorage. More... | |
virtual bool | markRejected (const RawMsg &msg) |
Reimplemented from RejectMsgStorage. More... | |
CacheHolderBase * | prepareLocalRetriving (int beginSeqNum, int endSeqNum, int currentOutSeqNum) |
Prepare for cache message walk process like a series of retrieveLocal() calls returns an object whose lifetime is bound to the whole series of retrieveLocal() calls when retrieveLocal() calls are complete, the object should be destroyed by the caller. More... | |
bool | retrieveLocal (CacheHolderBase *cacheHolder, ProtocolID protocolID, MsgList *pMsgs, int aBeginSeqNum, int aEndSeqNum=0, FIXVersion preferredVersion=NA) |
Reimplemented from MsgStorage. More... | |
virtual bool | retrieveLocal (int outSeqNum, std::string *msg, int currentOutSeqNum) |
Locates sent message (with seqNum=outSeqNum) and returns it into msg. More... | |
virtual void | retrieveRejectedMessages (Utils::Strings *pMessages) |
Reimplemented from RejectMsgStorage. More... | |
void | retrieveRemote (ProtocolID protocolID, MsgList *pMessages, const MsgTypes &msgTypes, const FixFieldsList &fieldFilter, int beginSeqNum, int endSeqNum=0, FIXVersion fixVersion=NA) |
Fills input list with messages that satisfy selection criteria. More... | |
virtual void | setBoolConfigInfo (const std::string &aKey, bool aValue) |
Sets the configuration information. More... | |
void | setConfigInfo (const std::string &aKey, const std::string &val) |
Reimplemented from MsgStorage. More... | |
virtual void | setIntConfigInfo (const std::string &aKey, int aValue) |
Sets the configuration information. More... | |
virtual void | setMaxRemoteSeqNum (int msgSeqNum) |
Reimplemented from MsgStorage. More... | |
virtual void | setMinSeqNum (int msgSeqNum) |
Reimplemented from MsgStorage. More... | |
virtual void | setRemoteSeqNum (int msgSeqNum) |
Reimplemented from MsgStorage. More... | |
virtual void | setSessionGlobalID (const System::u64 globalID) |
virtual void | setSessionInternalState (const System::u64 internalState) |
virtual void | syncMessageStorage () |
bool | tryMarkRejected (const RawMsg &msg, const ToBeResentCollection &toBeResent) |
virtual bool | unmarkRejected (const RawMsg &msg, const RawMsg &newMsg) |
Reimplemented from RejectMsgStorage. More... | |
virtual | ~FileMsgStorageT () |
![]() | |
virtual void | clear () |
Clears the storage. More... | |
StorageType | currentConnectionType () const |
Returns type of the storage. More... | |
MsgStorage (StorageType type) | |
Constructor. More... | |
virtual bool | retrieveLocal (CacheHolderBase *cacheHolder, ProtocolID protocolID, std::vector< FIXMessage * > *apMsgs, int aBeginSeqNum, int aEndSeqNum=0, FIXVersion preferredVersion=NA)=0 |
Locates sent messages. More... | |
virtual void | retrieveRemote (ProtocolID protocolID, std::vector< FIXMessage * > *pMessages, const MsgTypes &msgTypes, const std::vector< FixField > &fieldFilter, int beginSeqNum, int endSeqNum=0, FIXVersion fixVersion=NA)=0 |
Fills input list with messages that satisfy selection criteria. More... | |
virtual void | setLastSentSeqNum (int value) |
Updates MsgSeqNum of outgoing messages. More... | |
virtual | ~MsgStorage () |
Destructor. More... | |
![]() | |
virtual | ~RejectMsgStorage () |
Static Public Member Functions | |
static bool | rebuildIndexS (const std::string &logPath, const std::string &idxPath, const RestoreOptions &options) |
Store messages in range [aBeginSeqNum, aEndSeqNum] into the pMsgs container. More... | |
Protected Member Functions | |
virtual bool | rebuildIndex (const std::string &logPath, const std::string &idxPath, const RestoreOptions &options) |
![]() | |
void | clearFixMsgs (FixMsgs &aMsgs) |
Clears collection (delete all its elements). More... | |
Friends | |
class | ::TestApplication |
class | TestSeqNo |
Additional Inherited Members | |
![]() | |
static const System::u64 | SessionInternalStateNA = 0 |
![]() | |
StorageType | currentConnectionType_ |
FileT message storage.
typedef std::map<typename LogFileT<FileT>::MsgHandle, typename IndexFileT<FileT>::Data> Engine::FileMsgStorageT< FileT >::RejectedMapT |
typedef std::map<typename LogFileT<FileT>::SeqNum, typename LogFileT<FileT>::MsgHandle> Engine::FileMsgStorageT< FileT >::ToBeResentCollection |
Engine::FileMsgStorageT< FileT >::FileMsgStorageT | ( | StorageType | type, |
const std::string & | baseName, | ||
FileT & | outFile, | ||
FileT & | outIndexFile, | ||
FileT & | inFile, | ||
FileT & | inIndexFile, | ||
Utils::FilePropertiesT< System::FileEx > * | configInfo, | ||
bool | flushStreams, | ||
StorageMgr::PersistentSessionInfo * | info | ||
) |
Constructor.
baseName | Base file name. |
outFile | - file to store outgoing messages. |
outIndexFile | - index file. |
inFile | - file to store incoming messages. |
inIndexFile | - index file. |
flushStreams | - if true then all input/output will be flushed after each operation. |
|
virtual |
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Retrieves configuration information.
aKey | - parameter key |
aValue | - parameter result value |
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from Engine::MsgStorage.
|
virtual |
Retrieves configuration information.
aKey | - parameter key |
aValue | - parameter result value |
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Reimplemented from Engine::MsgStorage.
|
virtual |
Reimplemented from Engine::MsgStorage.
|
virtual |
Reimplemented from Engine::MsgStorage.
int Engine::FileMsgStorageT< FileT >::getStoredInSeqNum | ( | ) | const |
Returns current incoming seqNum from config.
int Engine::FileMsgStorageT< FileT >::getStoredOutSeqNum | ( | ) | const |
Returns current outgoing seqNum from config.
|
virtual |
Reimplemented from RejectMsgStorage.
Implements Engine::RejectMsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Checks if the storage is corrupted.
Implements Engine::MsgStorage.
int Engine::FileMsgStorageT< FileT >::load | ( | FIXVersion | preferredVersion = NA | ) |
Reimplemented from MsgStorage.
Reimplemented from MsgStorage. Reads the messages from the message log.
void Engine::FileMsgStorageT< FileT >::loadInMemoryCache | ( | ToBeResentCollection & | toBeResent, |
int | beginSeqNum, | ||
int | endSeqNum, | ||
int | currentOutSeqNum | ||
) |
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Stores the given outgoing message and then destroys it.
apMsg | - storage message |
nSeqNum | - message number |
pRawMsg | - message buffer pointer |
size | - message buffer size |
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Logs the message from the remote FIX engine.
msgSeqNum | - message number |
pRawMsg | - message buffer pointer |
size | - message buffer size |
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from RejectMsgStorage.
Implements Engine::RejectMsgStorage.
|
virtual |
Prepare for cache message walk process like a series of retrieveLocal() calls returns an object whose lifetime is bound to the whole series of retrieveLocal() calls when retrieveLocal() calls are complete, the object should be destroyed by the caller.
Returned pointer can have NULL value. To control the lifetime, should be used in conjunction with std::auto_ptr<> The implementaion would typically load the messages from an external storage to memory to prepare for a series of retrieveLocal() calls
Implements Engine::MsgStorage.
|
protectedvirtual |
Implements Engine::MsgStorage.
|
static |
Store messages in range [aBeginSeqNum, aEndSeqNum] into the pMsgs container.
bool Engine::FileMsgStorageT< FileT >::retrieveLocal | ( | CacheHolderBase * | cacheHolder, |
ProtocolID | protocolID, | ||
MsgList * | pMsgs, | ||
int | aBeginSeqNum, | ||
int | aEndSeqNum = 0 , |
||
FIXVersion | preferredVersion = NA |
||
) |
Reimplemented from MsgStorage.
|
virtual |
Locates sent message (with seqNum=outSeqNum) and returns it into msg.
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from RejectMsgStorage.
Implements Engine::RejectMsgStorage.
void Engine::FileMsgStorageT< FileT >::retrieveRemote | ( | ProtocolID | protocolID, |
MsgList * | pMessages, | ||
const MsgTypes & | msgTypes, | ||
const FixFieldsList & | fieldFilter, | ||
int | beginSeqNum, | ||
int | endSeqNum = 0 , |
||
FIXVersion | fixVersion = NA |
||
) |
Fills input list with messages that satisfy selection criteria.
|
virtual |
Sets the configuration information.
aKey | - parameter key |
aValue | - parameter value |
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Sets the configuration information.
aKey | - parameter key |
aValue | - parameter value |
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from MsgStorage.
Implements Engine::MsgStorage.
|
virtual |
Reimplemented from Engine::MsgStorage.
|
virtual |
Reimplemented from Engine::MsgStorage.
|
virtual |
Implements Engine::MsgStorage.
bool Engine::FileMsgStorageT< FileT >::tryMarkRejected | ( | const RawMsg & | msg, |
const ToBeResentCollection & | toBeResent | ||
) |
|
virtual |
Reimplemented from RejectMsgStorage.
Implements Engine::RejectMsgStorage.
|
friend |
|
friend |