FIX::MemoryStore Class Reference

Memory based implementation of MessageStore. More...

#include <MessageStore.h>

Inheritance diagram for FIX::MemoryStore:
Collaboration diagram for FIX::MemoryStore:

Public Member Functions

 MemoryStore ()
bool set (int, const std::string &) throw ( IOException )
void get (int, int, std::vector< std::string > &) const throw ( IOException )
int getNextSenderMsgSeqNum () const throw ( IOException )
int getNextTargetMsgSeqNum () const throw ( IOException )
void setNextSenderMsgSeqNum (int value) throw ( IOException )
void setNextTargetMsgSeqNum (int value) throw ( IOException )
void incrNextSenderMsgSeqNum () throw ( IOException )
void incrNextTargetMsgSeqNum () throw ( IOException )
void setCreationTime (const UtcTimeStamp &creationTime) throw ( IOException )
UtcTimeStamp getCreationTime () const throw ( IOException )
void reset () throw ( IOException )
void refresh () throw ( IOException )
Public Member Functions inherited from FIX::MessageStore
virtual ~MessageStore ()

Private Types

typedef std::map< int, std::string > Messages

Private Attributes

Messages m_messages
int m_nextSenderMsgSeqNum
int m_nextTargetMsgSeqNum
UtcTimeStamp m_creationTime

Detailed Description

Memory based implementation of MessageStore.

This will lose all data on process terminition. This class should only be used for test applications, never in production.

Definition at line 96 of file MessageStore.h.

Member Typedef Documentation

◆ Messages

typedef std::map< int, std::string > FIX::MemoryStore::Messages
private

Definition at line 130 of file MessageStore.h.

Constructor & Destructor Documentation

◆ MemoryStore()

FIX::MemoryStore::MemoryStore ( )
inline

Definition at line 99 of file MessageStore.h.

References m_nextSenderMsgSeqNum, and m_nextTargetMsgSeqNum.

Member Function Documentation

◆ get()

void FIX::MemoryStore::get ( int begin,
int end,
std::vector< std::string > & messages ) const
throw (IOException )
virtual

Implements FIX::MessageStore.

Definition at line 47 of file MessageStore.cpp.

50{
51 messages.clear();
52 Messages::const_iterator find = m_messages.find( begin );
53 for ( ; find != m_messages.end() && find->first <= end; ++find )
54 messages.push_back( find->second );
55}

References m_messages.

◆ getCreationTime()

UtcTimeStamp FIX::MemoryStore::getCreationTime ( ) const
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 119 of file MessageStore.h.

120 { return m_creationTime; }
UtcTimeStamp m_creationTime

References m_creationTime.

◆ getNextSenderMsgSeqNum()

int FIX::MemoryStore::getNextSenderMsgSeqNum ( ) const
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 104 of file MessageStore.h.

105 { return m_nextSenderMsgSeqNum; }

References m_nextSenderMsgSeqNum.

◆ getNextTargetMsgSeqNum()

int FIX::MemoryStore::getNextTargetMsgSeqNum ( ) const
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 106 of file MessageStore.h.

107 { return m_nextTargetMsgSeqNum; }

References m_nextTargetMsgSeqNum.

◆ incrNextSenderMsgSeqNum()

void FIX::MemoryStore::incrNextSenderMsgSeqNum ( )
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 112 of file MessageStore.h.

References m_nextSenderMsgSeqNum.

◆ incrNextTargetMsgSeqNum()

void FIX::MemoryStore::incrNextTargetMsgSeqNum ( )
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 114 of file MessageStore.h.

References m_nextTargetMsgSeqNum.

◆ refresh()

void FIX::MemoryStore::refresh ( )
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 127 of file MessageStore.h.

127{}

◆ reset()

void FIX::MemoryStore::reset ( )
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 122 of file MessageStore.h.

123 {
125 m_messages.clear(); m_creationTime.setCurrent();
126 }

References m_creationTime, m_messages, m_nextSenderMsgSeqNum, and m_nextTargetMsgSeqNum.

◆ set()

bool FIX::MemoryStore::set ( int msgSeqNum,
const std::string & msg )
throw (IOException )
virtual

Implements FIX::MessageStore.

Definition at line 40 of file MessageStore.cpp.

42{
43 m_messages[ msgSeqNum ] = msg;
44 return true;
45}

References m_messages.

◆ setCreationTime()

void FIX::MemoryStore::setCreationTime ( const UtcTimeStamp & creationTime)
throw (IOException )
inline

Definition at line 117 of file MessageStore.h.

118 { m_creationTime = creationTime; }

References m_creationTime.

◆ setNextSenderMsgSeqNum()

void FIX::MemoryStore::setNextSenderMsgSeqNum ( int value)
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 108 of file MessageStore.h.

109 { m_nextSenderMsgSeqNum = value; }

References m_nextSenderMsgSeqNum.

◆ setNextTargetMsgSeqNum()

void FIX::MemoryStore::setNextTargetMsgSeqNum ( int value)
throw (IOException )
inlinevirtual

Implements FIX::MessageStore.

Definition at line 110 of file MessageStore.h.

111 { m_nextTargetMsgSeqNum = value; }

References m_nextTargetMsgSeqNum.

Member Data Documentation

◆ m_creationTime

UtcTimeStamp FIX::MemoryStore::m_creationTime
private

Definition at line 135 of file MessageStore.h.

Referenced by getCreationTime(), reset(), and setCreationTime().

◆ m_messages

Messages FIX::MemoryStore::m_messages
private

Definition at line 132 of file MessageStore.h.

Referenced by get(), reset(), and set().

◆ m_nextSenderMsgSeqNum

int FIX::MemoryStore::m_nextSenderMsgSeqNum
private

◆ m_nextTargetMsgSeqNum

int FIX::MemoryStore::m_nextTargetMsgSeqNum
private

The documentation for this class was generated from the following files:

Generated on for QuickFIX by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2001