QuickFIX: /home/omiller/Development/autobuild/quickfix/src/C++/Log.cpp Source File

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

# Log.cpp

Go to the documentation of this file.

    00001 /****************************************************************************
    00002 ** Copyright (c) quickfixengine.org  All rights reserved.
    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 #include "CallStack.h"
    00026
    00027 #include "Log.h"
    00028
    00029 namespace FIX
    00030 {
    00031 Mutex ScreenLog::s_mutex;
    00032
    00033 Log* ScreenLogFactory::create()
    00034 { QF_STACK_PUSH(ScreenLogFactory::create)
    00035
    00036   bool incoming, outgoing, event;
    00037   init( m_settings.get(), incoming, outgoing, event );
    00038   return new ScreenLog( incoming, outgoing, event );
    00039
    00040   QF_STACK_POP
    00041 }
    00042
    00043 Log* ScreenLogFactory::create( const SessionID& sessionID )
    00044 { QF_STACK_PUSH(ScreenLogFactory::create)
    00045
    00046   Dictionary settings;
    00047   if( m_settings.has(sessionID) )
    00048           settings = m_settings.get( sessionID );
    00049
    00050   bool incoming, outgoing, event;
    00051   init( settings, incoming, outgoing, event );
    00052   return new ScreenLog( sessionID, incoming, outgoing, event );
    00053
    00054   QF_STACK_POP
    00055 }
    00056
    00057 void ScreenLogFactory::init( const Dictionary& settings, bool& incoming, bool& outgoing, bool& event )
    00058 { QF_STACK_PUSH(ScreenLogFactory::init)
    00059
    00060   if( m_useSettings )
    00061   {
    00062     incoming = true;
    00063     outgoing = true;
    00064     event = true;
    00065
    00066     if( settings.has(SCREEN_LOG_SHOW_INCOMING) )
    00067       incoming = settings.getBool(SCREEN_LOG_SHOW_INCOMING);
    00068     if( settings.has(SCREEN_LOG_SHOW_OUTGOING) )
    00069       outgoing = settings.getBool(SCREEN_LOG_SHOW_OUTGOING);
    00070     if( settings.has(SCREEN_LOG_SHOW_EVENTS) )
    00071       event = settings.getBool(SCREEN_LOG_SHOW_EVENTS);
    00072   }
    00073   else
    00074   {
    00075         incoming = m_incoming;
    00076         outgoing = m_outgoing;
    00077         event = m_event;
    00078   }
    00079
    00080   QF_STACK_POP
    00081 }
    00082
    00083 void ScreenLogFactory::destroy( Log* pLog )
    00084 { QF_STACK_PUSH(ScreenLogFactory::destroy)
    00085   delete pLog;
    00086   QF_STACK_POP
    00087 }
    00088 } //namespace FIX