B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
Engine::FileStorageMgrT< FileT > Class Template Reference

Manages FileMsgStorages. More...

#include <FileStorageMgr.h>

+ Inheritance diagram for Engine::FileStorageMgrT< FileT >:
+ Collaboration diagram for Engine::FileStorageMgrT< FileT >:

Public Member Functions

virtual MsgStoragecreate (const std::string &sender, const std::string &target, FIXVersion ver, System::u64 sessionGlobalID, System::u64 sessionInternalState, int outgoingStorageSize, StorageMgr::PersistentSessionInfo *info, const std::string &location="", const std::string &baseFilePath="") B2B_OVERRIDE
 Creates new MsgStorage object at subFolder. More...
 
virtual MsgStoragecreate (PersistentSessionInfo *info, int outgoingStorageSize) B2B_OVERRIDE
 Creates new MsgStorage object. More...
 
virtual bool existStorage (const std::string &sender, const std::string &target, bool *reuse) B2B_OVERRIDE
 Loads information about sessions that were terminated non-gracefully. More...
 
virtual bool load (const std::string &baseFilePath, PersistentSessionInfo *info)
 Loads information about the session that was terminated non-gracefully. More...
 
virtual bool load (const std::string &sender, const std::string &target, PersistentSessionInfo *info) B2B_OVERRIDE
 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) B2B_OVERRIDE
 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) B2B_OVERRIDE
 Loads information about the session that was terminated non-gracefully. More...
 
virtual MessageStorageType type () const B2B_OVERRIDE
 Return storage type. More...
 

Static Public Member Functions

static bool existStorageF (const std::string &sender, const std::string &target, bool *reuse)
 
static std::string getFileName (const std::string &sender, const std::string &target)
 Returns file's name (without extension). More...
 
static bool loadF (const std::string &sender, const std::string &target, FIXVersion version, PersistentSessionInfo *info)
 
static bool loadF (const std::string &baseFilePath, PersistentSessionInfo *info)
 
static bool loadF (const std::string &sender, const std::string &target, FIXVersion version, Session::ActiveConnection type, PersistentSessionInfo *info)
 
- Static Public Member Functions inherited from Engine::StorageMgr
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

void createStreams (const std::string &sender, const std::string &target, std::string &baseName, FIXVersion ver, System::u64 sessionGlobalID, System::u64 sessionInternalState, FileT &outFile, FileT &outIndexFile, FileT &inFile, FileT &inIndexFile, Utils::FilePropertiesT< System::FileEx > **ppConfigInfo, const std::string &location)
 
virtual bool createStreams (const std::string &sender, const std::string &target, const std::string &baseName, FIXVersion ver, System::u64 sessionGlobalID, System::u64 sessionInternalState, FileT &outFile, FileT &outIndexFile, FileT &inFile, FileT &inIndexFile, Utils::FilePropertiesT< System::FileEx > **ppConfigInfo)
 
 FileStorageMgrT ()
 
virtual void openStreams (const std::string &sender, const std::string &target, const std::string &baseName, FileT &outFile, FileT &outIndexFile, FileT &inFile, FileT &inIndexFile)
 
 ~FileStorageMgrT ()
 
- Protected Member Functions inherited from Engine::StorageMgr
 StorageMgr ()
 
virtual ~StorageMgr ()
 

Static Protected Member Functions

static void initConfigInfo (Utils::FilePropertiesT< System::FileEx > *pConfigInfo, const std::string &sender, const std::string &target, FIXVersion aVer, System::u64 globalID, System::u64 sessionInternalState)
 
static bool loadSessionStateData (const std::string &sender, const std::string &target, const std::string &baseName, details::SessionStateData *info)
 
static std::auto_ptr
< Utils::FilePropertiesT
< System::FileEx > > 
openConfigInfo (const std::string &sender, const std::string &target, const std::string &baseName, const std::string &mode)
 

Friends

class StandbyNode
 
class StorageMgr
 

Additional Inherited Members

- Public Types inherited from Engine::StorageMgr
typedef std::list
< PersistentSessionInfo
IncompleteSessionsInfo
 Information about the persistent sessions that were non-gracefully terminated. More...
 

Detailed Description

template<typename FileT>
class Engine::FileStorageMgrT< FileT >

Manages FileMsgStorages.

Constructor & Destructor Documentation

template<typename FileT>
Engine::FileStorageMgrT< FileT >::FileStorageMgrT ( )
protected
template<typename FileT>
Engine::FileStorageMgrT< FileT >::~FileStorageMgrT ( )
protected

Member Function Documentation

template<typename FileT>
virtual MsgStorage* Engine::FileStorageMgrT< FileT >::create ( const std::string &  sender,
const std::string &  target,
FIXVersion  version,
System::u64  sessionGlobalID,
System::u64  sessionInternalState,
int  outgoingStorageSize,
StorageMgr::PersistentSessionInfo info,
const std::string &  location = "",
const std::string &  baseFilePath = "" 
)
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

Implements Engine::StorageMgr.

template<typename FileT>
virtual MsgStorage* Engine::FileStorageMgrT< FileT >::create ( PersistentSessionInfo info,
int  outgoingStorageSize 
)
virtual

Creates new MsgStorage object.

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

Implements Engine::StorageMgr.

template<typename FileT>
void Engine::FileStorageMgrT< FileT >::createStreams ( const std::string &  sender,
const std::string &  target,
std::string &  baseName,
FIXVersion  ver,
System::u64  sessionGlobalID,
System::u64  sessionInternalState,
FileT &  outFile,
FileT &  outIndexFile,
FileT &  inFile,
FileT &  inIndexFile,
Utils::FilePropertiesT< System::FileEx > **  ppConfigInfo,
const std::string &  location 
)
protected
template<typename FileT>
virtual bool Engine::FileStorageMgrT< FileT >::createStreams ( const std::string &  sender,
const std::string &  target,
const std::string &  baseName,
FIXVersion  ver,
System::u64  sessionGlobalID,
System::u64  sessionInternalState,
FileT &  outFile,
FileT &  outIndexFile,
FileT &  inFile,
FileT &  inIndexFile,
Utils::FilePropertiesT< System::FileEx > **  ppConfigInfo 
)
protectedvirtual

Reimplemented in Engine::MCachedFileStorageMgr.

template<typename FileT>
virtual bool Engine::FileStorageMgrT< FileT >::existStorage ( const std::string &  sender,
const std::string &  target,
bool *  reuse 
)
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.

Implements Engine::StorageMgr.

template<typename FileT>
static bool Engine::FileStorageMgrT< FileT >::existStorageF ( const std::string &  sender,
const std::string &  target,
bool *  reuse 
)
static
template<typename FileT>
static std::string Engine::FileStorageMgrT< FileT >::getFileName ( const std::string &  sender,
const std::string &  target 
)
inlinestatic

Returns file's name (without extension).

template<typename FileT>
static void Engine::FileStorageMgrT< FileT >::initConfigInfo ( Utils::FilePropertiesT< System::FileEx > *  pConfigInfo,
const std::string &  sender,
const std::string &  target,
FIXVersion  aVer,
System::u64  globalID,
System::u64  sessionInternalState 
)
staticprotected
template<typename FileT>
virtual bool Engine::FileStorageMgrT< FileT >::load ( const std::string &  baseFilePath,
PersistentSessionInfo info 
)
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.

Implements Engine::StorageMgr.

template<typename FileT>
virtual bool Engine::FileStorageMgrT< FileT >::load ( const std::string &  sender,
const std::string &  target,
PersistentSessionInfo info 
)
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.

Implements Engine::StorageMgr.

template<typename FileT>
virtual bool Engine::FileStorageMgrT< FileT >::load ( const std::string &  sender,
const std::string &  target,
FIXVersion  version,
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
info- Information about the persistent session
Returns
'true' if the information was found, otherwise - false.

Implements Engine::StorageMgr.

template<typename FileT>
virtual bool Engine::FileStorageMgrT< FileT >::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 from Engine::StorageMgr.

template<typename FileT>
static bool Engine::FileStorageMgrT< FileT >::loadF ( const std::string &  sender,
const std::string &  target,
FIXVersion  version,
PersistentSessionInfo info 
)
static
template<typename FileT>
static bool Engine::FileStorageMgrT< FileT >::loadF ( const std::string &  baseFilePath,
PersistentSessionInfo info 
)
static
template<typename FileT>
static bool Engine::FileStorageMgrT< FileT >::loadF ( const std::string &  sender,
const std::string &  target,
FIXVersion  version,
Session::ActiveConnection  type,
PersistentSessionInfo info 
)
static
template<typename FileT>
static bool Engine::FileStorageMgrT< FileT >::loadSessionStateData ( const std::string &  sender,
const std::string &  target,
const std::string &  baseName,
details::SessionStateData *  info 
)
staticprotected
template<typename FileT>
static std::auto_ptr<Utils::FilePropertiesT<System::FileEx> > Engine::FileStorageMgrT< FileT >::openConfigInfo ( const std::string &  sender,
const std::string &  target,
const std::string &  baseName,
const std::string &  mode 
)
staticprotected
template<typename FileT>
virtual void Engine::FileStorageMgrT< FileT >::openStreams ( const std::string &  sender,
const std::string &  target,
const std::string &  baseName,
FileT &  outFile,
FileT &  outIndexFile,
FileT &  inFile,
FileT &  inIndexFile 
)
protectedvirtual

Reimplemented in Engine::MCachedFileStorageMgr.

template<typename FileT>
virtual MessageStorageType Engine::FileStorageMgrT< FileT >::type ( ) const
virtual

Return storage type.

Implements Engine::StorageMgr.

Friends And Related Function Documentation

template<typename FileT>
friend class StandbyNode
friend
template<typename FileT>
friend class StorageMgr
friend