Log.cpp
Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Copyright (c) 2001-2014
00003 **
00004 ** This file is part of the QuickFIX FIX Engine
00005 **
00006 ** This file may be distributed under the terms of the quickfixengine.org
00007 ** license as defined by quickfixengine.org and appearing in the file
00008 ** LICENSE included in the packaging of this file.
00009 **
00010 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00011 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00012 **
00013 ** See http://www.quickfixengine.org/LICENSE for licensing information.
00014 **
00015 ** Contact ask@quickfixengine.org if any conditions of this licensing are
00016 ** not clear to you.
00017 **
00018 ****************************************************************************/
00019 
00020 #ifdef _MSC_VER
00021 #include "stdafx.h"
00022 #else
00023 #include "config.h"
00024 #endif
00025 
00026 #include "Log.h"
00027 
00028 namespace FIX
00029 {
00030 Mutex ScreenLog::s_mutex;
00031 
00032 Log* ScreenLogFactory::create()
00033 {
00034   bool incoming, outgoing, event;
00035   init( m_settings.get(), incoming, outgoing, event );
00036   return new ScreenLog( incoming, outgoing, event );
00037 }
00038 
00039 Log* ScreenLogFactory::create( const SessionID& sessionID )
00040 {
00041   Dictionary settings;
00042   if( m_settings.has(sessionID) ) 
00043     settings = m_settings.get( sessionID );
00044 
00045   bool incoming, outgoing, event;
00046   init( settings, incoming, outgoing, event );
00047   return new ScreenLog( sessionID, incoming, outgoing, event );
00048 }
00049 
00050 void ScreenLogFactory::init( const Dictionary& settings, bool& incoming, bool& outgoing, bool& event )
00051 {  
00052   if( m_useSettings )
00053   {
00054     incoming = true;
00055     outgoing = true;
00056     event = true;
00057 
00058     if( settings.has(SCREEN_LOG_SHOW_INCOMING) )
00059       incoming = settings.getBool(SCREEN_LOG_SHOW_INCOMING);
00060     if( settings.has(SCREEN_LOG_SHOW_OUTGOING) )
00061       outgoing = settings.getBool(SCREEN_LOG_SHOW_OUTGOING);
00062     if( settings.has(SCREEN_LOG_SHOW_EVENTS) )
00063       event = settings.getBool(SCREEN_LOG_SHOW_EVENTS);
00064   }
00065   else
00066   {
00067     incoming = m_incoming;
00068     outgoing = m_outgoing;
00069     event = m_event;
00070   }
00071 }
00072 
00073 void ScreenLogFactory::destroy( Log* pLog )
00074 {
00075   delete pLog;
00076 }
00077 } //namespace FIX

Generated on Mon Sep 15 2014 01:23:54 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001