Public Member Functions | Private Types | Private Attributes | List of all members
FIX::MemoryStore Class Reference

Memory based implementation of MessageStore. More...

#include <MessageStore.h>

Inheritance diagram for FIX::MemoryStore:
Inheritance graph
[legend]
Collaboration diagram for FIX::MemoryStore:
Collaboration graph
[legend]

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

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

Definition at line 130 of file MessageStore.h.

Constructor & Destructor Documentation

FIX::MemoryStore::MemoryStore ( )
inline

Definition at line 99 of file MessageStore.h.

Member Function Documentation

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 }
Messages m_messages
Definition: MessageStore.h:132
UtcTimeStamp FIX::MemoryStore::getCreationTime ( ) const
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 119 of file MessageStore.h.

Referenced by FIX::FileStore::getCreationTime(), and FIX::FileStore::setSession().

120  { return m_creationTime; }
UtcTimeStamp m_creationTime
Definition: MessageStore.h:135
int FIX::MemoryStore::getNextSenderMsgSeqNum ( ) const
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 104 of file MessageStore.h.

Referenced by FIX::FileStore::getNextSenderMsgSeqNum().

105  { return m_nextSenderMsgSeqNum; }
int FIX::MemoryStore::getNextTargetMsgSeqNum ( ) const
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 106 of file MessageStore.h.

Referenced by FIX::FileStore::getNextTargetMsgSeqNum().

107  { return m_nextTargetMsgSeqNum; }
void FIX::MemoryStore::incrNextSenderMsgSeqNum ( )
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 112 of file MessageStore.h.

Referenced by FIX::FileStore::incrNextSenderMsgSeqNum().

113  { ++m_nextSenderMsgSeqNum; }
void FIX::MemoryStore::incrNextTargetMsgSeqNum ( )
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 114 of file MessageStore.h.

Referenced by FIX::FileStore::incrNextTargetMsgSeqNum().

115  { ++m_nextTargetMsgSeqNum; }
void FIX::MemoryStore::refresh ( )
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 127 of file MessageStore.h.

127 {}
void FIX::MemoryStore::reset ( )
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 122 of file MessageStore.h.

Referenced by FIX::FileStore::refresh(), and FIX::FileStore::reset().

123  {
126  }
Messages m_messages
Definition: MessageStore.h:132
UtcTimeStamp m_creationTime
Definition: MessageStore.h:135
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 }
Messages m_messages
Definition: MessageStore.h:132
void FIX::MemoryStore::setCreationTime ( const UtcTimeStamp creationTime)
throw (IOException
)
inline

Definition at line 117 of file MessageStore.h.

Referenced by FIX::FileStore::populateCache().

118  { m_creationTime = creationTime; }
UtcTimeStamp m_creationTime
Definition: MessageStore.h:135
void FIX::MemoryStore::setNextSenderMsgSeqNum ( int  value)
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 108 of file MessageStore.h.

Referenced by FIX::FileStore::populateCache().

109  { m_nextSenderMsgSeqNum = value; }
void FIX::MemoryStore::setNextTargetMsgSeqNum ( int  value)
throw (IOException
)
inlinevirtual

Implements FIX::MessageStore.

Definition at line 110 of file MessageStore.h.

Referenced by FIX::FileStore::populateCache().

111  { m_nextTargetMsgSeqNum = value; }

Member Data Documentation

UtcTimeStamp FIX::MemoryStore::m_creationTime
private

Definition at line 135 of file MessageStore.h.

Messages FIX::MemoryStore::m_messages
private

Definition at line 132 of file MessageStore.h.

int FIX::MemoryStore::m_nextSenderMsgSeqNum
private

Definition at line 133 of file MessageStore.h.

int FIX::MemoryStore::m_nextTargetMsgSeqNum
private

Definition at line 134 of file MessageStore.h.


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

Generated on Sat Mar 29 2014 15:13:34 for QuickFIX by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2001