Index  Source Files  Annotated Class List  Alphabetical Class List  Class Hierarchy  Graphical Class Hierarchy   
 

FIX::FileLogFactory Class Reference

Creates a file based implementation of Log. More...

#include <FileLog.h>

Inheritance diagram for FIX::FileLogFactory:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FileLogFactory (const SessionSettings &settings)
 FileLogFactory (const std::string &path)
Logcreate ()
Logcreate (const SessionID &)
void destroy (Log *log)

Private Attributes

std::string m_path
SessionSettings m_settings
Logm_globalLog
int m_globalLogCount

Detailed Description

Creates a file based implementation of Log.

This stores all log events into flat files

Definition at line 40 of file FileLog.h.


Constructor & Destructor Documentation

FIX::FileLogFactory::FileLogFactory const SessionSettings settings  )  [inline]
 

Definition at line 43 of file FileLog.h.

References m_globalLog, and m_globalLogCount.

00044 : m_settings( settings ), m_globalLog(0), m_globalLogCount(0) {};

FIX::FileLogFactory::FileLogFactory const std::string &  path  )  [inline]
 

Definition at line 45 of file FileLog.h.

References m_globalLog, m_globalLogCount, and m_path.

00046 : m_path( path ), m_globalLog(0), m_globalLogCount(0) {};


Member Function Documentation

Log * FIX::FileLogFactory::create const SessionID  )  [virtual]
 

Implements FIX::LogFactory.

Definition at line 54 of file FileLog.cpp.

References FIX::FILE_LOG_PATH, FIX::SessionSettings::get(), FIX::Dictionary::getString(), m_path, QF_STACK_POP, and QF_STACK_PUSH.

00055 { QF_STACK_PUSH(FileLogFactory::create)
00056 
00057   if ( m_path.size() ) return new FileLog( m_path, s );
00058   std::string path;
00059   Dictionary settings = m_settings.get( s );
00060   path = settings.getString( FILE_LOG_PATH );
00061   return new FileLog( path, s );
00062 
00063   QF_STACK_POP
00064 }

Log * FIX::FileLogFactory::create  )  [virtual]
 

Implements FIX::LogFactory.

Definition at line 31 of file FileLog.cpp.

References FIX::FILE_LOG_PATH, FIX::SessionSettings::get(), FIX::Dictionary::getString(), m_globalLog, m_globalLogCount, m_path, QF_STACK_POP, and QF_STACK_PUSH.

00032 { QF_STACK_PUSH(FileLogFactory::create)
00033 
00034   m_globalLogCount++;
00035   if( m_globalLogCount > 1 ) return m_globalLog;
00036 
00037   try
00038   {
00039     if ( m_path.size() ) return new FileLog( m_path );
00040     std::string path;
00041     Dictionary settings = m_settings.get();
00042     path = settings.getString( FILE_LOG_PATH );
00043     return m_globalLog = new FileLog( path );
00044   }
00045   catch( ConfigError& )
00046   {
00047         m_globalLogCount--;
00048         throw;  
00049   }
00050 
00051   QF_STACK_POP
00052 }

void FIX::FileLogFactory::destroy Log log  )  [virtual]
 

Implements FIX::LogFactory.

Definition at line 66 of file FileLog.cpp.

References m_globalLog, m_globalLogCount, QF_STACK_POP, and QF_STACK_PUSH.

00067 { QF_STACK_PUSH(FileLogFactory::destroy)
00068  
00069   if( pLog == m_globalLog )
00070   {
00071     m_globalLogCount--;
00072     if( m_globalLogCount == 0 )
00073     {
00074           delete pLog;
00075           m_globalLogCount = 0;
00076     }   
00077   }
00078   else
00079   {
00080         delete pLog;
00081   }
00082 
00083   QF_STACK_POP
00084 }


Member Data Documentation

Log* FIX::FileLogFactory::m_globalLog [private]
 

Definition at line 56 of file FileLog.h.

Referenced by create(), destroy(), and FileLogFactory().

int FIX::FileLogFactory::m_globalLogCount [private]
 

Definition at line 57 of file FileLog.h.

Referenced by create(), destroy(), and FileLogFactory().

std::string FIX::FileLogFactory::m_path [private]
 

Definition at line 54 of file FileLog.h.

Referenced by create(), and FileLogFactory().

SessionSettings FIX::FileLogFactory::m_settings [private]
 

Definition at line 55 of file FileLog.h.


The documentation for this class was generated from the following files:
Generated on Mon Jul 24 19:36:43 2006 for QuickFIX by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2001