B2BITS FIX Antenna HFT  1.0.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Engine::StorageMgr Class Referenceabstract

Manages MsgStorages. More...

#include <B2BITS_StorageMgr.h>

+ Inheritance diagram for Engine::StorageMgr:

Classes

struct  PersistentSessionInfo
 Information about the persistent session. More...
 

Public Types

typedef std::list
< PersistentSessionInfo
IncompleteSessionsInfo
 Information about the persistent sessions that were non-gracefully terminated. More...
 

Public Member Functions

virtual MsgStoragecreate (const std::string &sender, const std::string &target, FIXVersion version, System::u64 sessionGlobalID, int outgoingStorageSize, StorageMgr::PersistentSessionInfo *info, const std::string &location="", const std::string &baseFilePath="")=0
 Creates new MsgStorage object at subFolder. More...
 
virtual MsgStoragecreate (PersistentSessionInfo *info, int outgoingStorageSize)=0
 Creates new MsgStorage object. More...
 
virtual bool existStorage (const std::string &sender, const std::string &target, bool *reuse)=0
 Loads information about sessions that were terminated non-gracefully. More...
 
virtual bool load (const std::string &sender, const std::string &target, PersistentSessionInfo *info)=0
 Loads information about the session that was terminated non-gracefully. More...
 
virtual bool load (const std::string &sender, const std::string &target, FIXVersion version, PersistentSessionInfo *info)=0
 Loads information about the session that was terminated non-gracefully. More...
 
virtual bool load (const std::string &baseFilePath, PersistentSessionInfo *info)=0
 Loads information about the session that was terminated non-gracefully. More...
 
virtual bool load (const std::string &sender, const std::string &target, FIXVersion version, Session::ActiveConnection type, PersistentSessionInfo *info)
 Loads information about the session that was terminated non-gracefully. More...
 
virtual MessageStorageType type () const =0
 Return storage type. More...
 

Static Public Member Functions

static void destroy ()
 Destroys the instance. More...
 
static void init ()
 Inits the singleton. More...
 
static StorageMgrsingleton (const MessageStorageType type)
 Returns the pointer to the instance of StorageMgr. More...
 

Protected Member Functions

 StorageMgr ()
 
virtual ~StorageMgr ()
 

Detailed Description

Manages MsgStorages.

Member Typedef Documentation

Information about the persistent sessions that were non-gracefully terminated.

Constructor & Destructor Documentation

Engine::StorageMgr::StorageMgr ( )
protected
virtual Engine::StorageMgr::~StorageMgr ( )
protectedvirtual

Member Function Documentation

virtual MsgStorage* Engine::StorageMgr::create ( const std::string &  sender,
const std::string &  target,
FIXVersion  version,
System::u64  sessionGlobalID,
int  outgoingStorageSize,
StorageMgr::PersistentSessionInfo info,
const std::string &  location = "",
const std::string &  baseFilePath = "" 
)
pure virtual

Creates new MsgStorage object at subFolder.

Parameters
sender- session sender
target- session target
version- session's version
outgoingStorageSize- Specifies size of the transient message storage
location- path to the folder where files have to be created. When empty - files will be created in log folder.
baseFilePathPath to the storage without etension. if empty, path will be calculated based on sender, target and engine log directory parameters.
Returns
new MsgStorage object

Implemented in Engine::FileStorageMgrT< FileT >, and Engine::FileStorageMgrT< System::MCachedFile >.

virtual MsgStorage* Engine::StorageMgr::create ( PersistentSessionInfo info,
int  outgoingStorageSize 
)
pure virtual

Creates new MsgStorage object.

Parameters
info- information about the persistent session
outgoingStorageSize- Specifies size of the transient message storage
Returns
new MsgStorage object

Implemented in Engine::FileStorageMgrT< FileT >, and Engine::FileStorageMgrT< System::MCachedFile >.

static void Engine::StorageMgr::destroy ( )
static

Destroys the instance.

virtual bool Engine::StorageMgr::existStorage ( const std::string &  sender,
const std::string &  target,
bool *  reuse 
)
pure virtual

Loads information about sessions that were terminated non-gracefully.

Returns
the number of found sessions. Search for the session's <Sender, Target> storage and read it.
Parameters
sender- session's sender name
target- session's target name
Returns
'true' if the information was found, otherwise - false.

Implemented in Engine::FileStorageMgrT< FileT >, and Engine::FileStorageMgrT< System::MCachedFile >.

static void Engine::StorageMgr::init ( )
static

Inits the singleton.

virtual bool Engine::StorageMgr::load ( const std::string &  sender,
const std::string &  target,
PersistentSessionInfo info 
)
pure virtual

Loads information about the session that was terminated non-gracefully.

Parameters
sender- session's sender name
target- session's target name
info- Information about the persistent session
Returns
'true' if the information was found, otherwise - false.

Implemented in Engine::FileStorageMgrT< FileT >, and Engine::FileStorageMgrT< System::MCachedFile >.

virtual bool Engine::StorageMgr::load ( const std::string &  sender,
const std::string &  target,
FIXVersion  version,
PersistentSessionInfo info 
)
pure virtual

Loads information about the session that was terminated non-gracefully.

Parameters
sender- session's sender name
target- session's target name
version- fix protocol version
info- Information about the persistent session
Returns
'true' if the information was found, otherwise - false.

Implemented in Engine::FileStorageMgrT< FileT >, and Engine::FileStorageMgrT< System::MCachedFile >.

virtual bool Engine::StorageMgr::load ( const std::string &  baseFilePath,
PersistentSessionInfo info 
)
pure virtual

Loads information about the session that was terminated non-gracefully.

Parameters
baseFilePathPath to the storage without etension
info- information about the persistent session
Returns
'true' if the information was found, otherwise - false.

Implemented in Engine::FileStorageMgrT< FileT >, and Engine::FileStorageMgrT< System::MCachedFile >.

virtual bool Engine::StorageMgr::load ( const std::string &  sender,
const std::string &  target,
FIXVersion  version,
Session::ActiveConnection  type,
PersistentSessionInfo info 
)
virtual

Loads information about the session that was terminated non-gracefully.

Parameters
sender- session's sender name
target- session's target name
version- fix protocol version
type- active connection type
info- Information about the persistent session
Returns
'true' if the information was found, otherwise - false.

Reimplemented in Engine::FileStorageMgrT< FileT >, and Engine::FileStorageMgrT< System::MCachedFile >.

static StorageMgr* Engine::StorageMgr::singleton ( const MessageStorageType  type)
static

Returns the pointer to the instance of StorageMgr.

virtual MessageStorageType Engine::StorageMgr::type ( ) const
pure virtual