fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::Persister Class Referenceabstract

Base (ABC) Persister class. More...

#include <persist.hpp>

Inheritance diagram for FIX8::Persister:
FIX8::FilePersister FIX8::MemoryPersister

Public Types

enum  { MaxMsgLen = FIX8_MAX_MSG_LENGTH }
 Maximum length of persisted FIX message. More...
 

Public Member Functions

 Persister ()=default
 Ctor. More...
 
virtual ~Persister ()
 Dtor. More...
 
 Persister (const Persister &)=delete
 
Persisteroperator= (const Persister &)=delete
 
virtual bool put (const unsigned seqnum, const f8String &what)=0
 
virtual bool put (const f8String &key, const f8String &what)
 
virtual bool put (const unsigned sender_seqnum, const unsigned target_seqnum)=0
 
virtual bool get (const unsigned seqnum, f8String &to) const =0
 
virtual bool get (const f8String &key, f8String &to) const
 
virtual bool del (const f8String &key)
 
virtual unsigned get (const unsigned from, const unsigned to, Session &session, bool(Session::*callback)(const Session::SequencePair &with, Session::RetransmissionContext &rctx)) const =0
 
virtual unsigned get_last_seqnum (unsigned &to) const =0
 
virtual bool get (unsigned &sender_seqnum, unsigned &target_seqnum) const =0
 
virtual unsigned find_nearest_highest_seqnum (const unsigned requested, const unsigned last) const =0
 
virtual bool purge ()
 
virtual void stop ()
 Stop the persister thread. More...
 

Protected Attributes

bool _opened = false
 

Detailed Description

Base (ABC) Persister class.

Definition at line 55 of file persist.hpp.

Member Enumeration Documentation

anonymous enum

Maximum length of persisted FIX message.

Enumerator
MaxMsgLen 

Definition at line 71 of file persist.hpp.

Constructor & Destructor Documentation

FIX8::Persister::Persister ( )
default

Ctor.

virtual FIX8::Persister::~Persister ( )
inlinevirtual

Dtor.

Definition at line 65 of file persist.hpp.

65 {}
FIX8::Persister::Persister ( const Persister )
delete

Member Function Documentation

virtual bool FIX8::Persister::del ( const f8String key)
inlinevirtual

Delete a generic persisted value by specified key. Depending on specialisation, provide direct access to the persister implementation

Parameters
keykey to delete
Returns
true on success

Definition at line 109 of file persist.hpp.

109 { return false; }
virtual unsigned FIX8::Persister::find_nearest_highest_seqnum ( const unsigned  requested,
const unsigned  last 
) const
pure virtual

Find the nearest highest sequence number from the sequence to last provided.

Parameters
requestedsequence number to start
lasthighest sequence
Returns
the nearest sequence number or 0 if not found

Implemented in FIX8::FilePersister, and FIX8::MemoryPersister.

virtual bool FIX8::Persister::get ( const unsigned  seqnum,
f8String to 
) const
pure virtual

Retrieve a persisted message.

Parameters
seqnumsequence number of message
totarget message string
Returns
true on success

Implemented in FIX8::FilePersister, and FIX8::MemoryPersister.

Referenced by FIX8::Session::handle_resend_request(), and FIX8::Session::recover_seqnums().

virtual bool FIX8::Persister::get ( const f8String key,
f8String to 
) const
inlinevirtual

Retrieve a generic persisted value. Depending on specialisation, provide direct access to the persister implementation

Parameters
keykey to retrieve
totarget value string
Returns
true on success

Definition at line 103 of file persist.hpp.

103 { return false; }
virtual unsigned FIX8::Persister::get ( const unsigned  from,
const unsigned  to,
Session session,
bool(Session::*)(const Session::SequencePair &with, Session::RetransmissionContext &rctx)  callback 
) const
pure virtual

Retrieve a range of persisted messages.

Parameters
fromstart at sequence number
toend sequence number
sessionsession containing callback method
callbackmethod to call with each retrieved message
Returns
number of messages retrieved

Implemented in FIX8::FilePersister, and FIX8::MemoryPersister.

virtual bool FIX8::Persister::get ( unsigned &  sender_seqnum,
unsigned &  target_seqnum 
) const
pure virtual

Retrieve a sequence control record.

Parameters
sender_seqnumsequence number of last sent message
target_seqnumsequence number of last received message
Returns
true on success

Implemented in FIX8::FilePersister, and FIX8::MemoryPersister.

virtual unsigned FIX8::Persister::get_last_seqnum ( unsigned &  to) const
pure virtual

Retrieve sequence number of last peristed message.

Parameters
totarget sequence number
Returns
sequence number of last peristed message on success

Implemented in FIX8::FilePersister, and FIX8::MemoryPersister.

Persister& FIX8::Persister::operator= ( const Persister )
delete
virtual bool FIX8::Persister::purge ( )
inlinevirtual

Remove all records (excluding the sequence number record 0) from the persist database

Returns
true on success

Definition at line 139 of file persist.hpp.

139 { return true; }
virtual bool FIX8::Persister::put ( const unsigned  seqnum,
const f8String what 
)
pure virtual

Persist a message.

Parameters
seqnumsequence number of message
whatmessage string
Returns
true on success

Implemented in FIX8::FilePersister, and FIX8::MemoryPersister.

Referenced by FIX8::Session::send_process(), and FIX8::Session::update_persist_seqnums().

virtual bool FIX8::Persister::put ( const f8String key,
const f8String what 
)
inlinevirtual

Persist a generic value. Depending on specialisation, provide direct access to the persister implementation

Parameters
keykey to store
whatvalue string
Returns
true on success

Definition at line 84 of file persist.hpp.

84 { return false; }
virtual bool FIX8::Persister::put ( const unsigned  sender_seqnum,
const unsigned  target_seqnum 
)
pure virtual

Persist a sequence control record.

Parameters
sender_seqnumsequence number of last sent message
target_seqnumsequence number of last received message
Returns
true on success

Implemented in FIX8::FilePersister, and FIX8::MemoryPersister.

virtual void FIX8::Persister::stop ( )
inlinevirtual

Stop the persister thread.

Definition at line 142 of file persist.hpp.

Referenced by FIX8::Session::stop().

142 {}

Member Data Documentation

bool FIX8::Persister::_opened = false
protected

Definition at line 58 of file persist.hpp.


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