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 113 of file MessageStore.h.

Member Typedef Documentation

◆ Messages

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

Definition at line 147 of file MessageStore.h.

Constructor & Destructor Documentation

◆ MemoryStore()

FIX::MemoryStore::MemoryStore ( )
inline

Definition at line 116 of file MessageStore.h.

118 { m_creationTime = creationTime; }

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 64 of file MessageStore.cpp.

65 {
66  m_pFactory->destroy( pStore );
67 }
68 
69 bool MessageStoreExceptionWrapper::set( int num, const std::string& msg, bool& threw, IOException& ex )
70 {
71  threw = false;
72  try { return m_pStore->set( num, msg ); }

References FIX::MessageStoreFactory::destroy(), and FIX::MessageStoreFactoryExceptionWrapper::m_pFactory.

◆ getCreationTime()

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

Implements FIX::MessageStore.

Definition at line 136 of file MessageStore.h.

139 {

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

◆ getNextSenderMsgSeqNum()

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

Implements FIX::MessageStore.

Definition at line 121 of file MessageStore.h.

123  {

◆ getNextTargetMsgSeqNum()

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

Implements FIX::MessageStore.

Definition at line 123 of file MessageStore.h.

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

◆ incrNextSenderMsgSeqNum()

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

Implements FIX::MessageStore.

Definition at line 129 of file MessageStore.h.

129  :
130  typedef std::map < int, std::string > Messages;

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

◆ incrNextTargetMsgSeqNum()

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

Implements FIX::MessageStore.

Definition at line 131 of file MessageStore.h.

139 {

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

◆ refresh()

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

Implements FIX::MessageStore.

Definition at line 144 of file MessageStore.h.

144 : m_pFactory( pFactory ) {}

◆ reset()

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

Implements FIX::MessageStore.

Definition at line 139 of file MessageStore.h.

139 {
140 private:
141  MessageStoreFactory* m_pFactory;
142 public:
143  MessageStoreFactoryExceptionWrapper( MessageStoreFactory* pFactory )

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

◆ set()

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

Implements FIX::MessageStore.

Definition at line 57 of file MessageStore.cpp.

58 {
59  threw = false;
60  try { return m_pFactory->create( sessionID ); }
61  catch ( ConfigError & e ) { threw = true; ex = e; return 0; }
62 }

References FIX::MessageStoreFactory::create(), and FIX::MessageStoreFactoryExceptionWrapper::m_pFactory.

◆ setCreationTime()

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

Definition at line 134 of file MessageStore.h.

139 {

◆ setNextSenderMsgSeqNum()

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

Implements FIX::MessageStore.

Definition at line 125 of file MessageStore.h.

127  {}

◆ setNextTargetMsgSeqNum()

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

Implements FIX::MessageStore.

Definition at line 127 of file MessageStore.h.

127  {}
128 

Member Data Documentation

◆ m_creationTime

UtcTimeStamp FIX::MemoryStore::m_creationTime
private

Definition at line 152 of file MessageStore.h.

◆ m_messages

Messages FIX::MemoryStore::m_messages
private

Definition at line 149 of file MessageStore.h.

◆ m_nextSenderMsgSeqNum

int FIX::MemoryStore::m_nextSenderMsgSeqNum
private

Definition at line 150 of file MessageStore.h.

◆ m_nextTargetMsgSeqNum

int FIX::MemoryStore::m_nextTargetMsgSeqNum
private

Definition at line 151 of file MessageStore.h.


The documentation for this class was generated from the following files:
FIX::MemoryStore::Messages
std::map< int, std::string > Messages
Definition: MessageStore.h:147
FIX::MessageStoreExceptionWrapper::set
bool set(int, const std::string &, bool &, IOException &)
Definition: MessageStore.cpp:86
FIX::MemoryStore::m_nextSenderMsgSeqNum
int m_nextSenderMsgSeqNum
Definition: MessageStore.h:150
FIX::MemoryStore::m_creationTime
UtcTimeStamp m_creationTime
Definition: MessageStore.h:152
FIX::MemoryStore::m_nextTargetMsgSeqNum
int m_nextTargetMsgSeqNum
Definition: MessageStore.h:151

Generated on Wed Apr 29 2020 19:41:30 for QuickFIX by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2001