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

# SessionFactory.h

Go to the documentation of this file.

    00001 /* -*- C++ -*- */
    00002
    00003 /****************************************************************************
    00004 ** Copyright (c) quickfixengine.org  All rights reserved.
    00005 **
    00006 ** This file is part of the QuickFIX FIX Engine
    00007 **
    00008 ** This file may be distributed under the terms of the quickfixengine.org
    00009 ** license as defined by quickfixengine.org and appearing in the file
    00010 ** LICENSE included in the packaging of this file.
    00011 **
    00012 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    00013 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    00014 **
    00015 ** See http://www.quickfixengine.org/LICENSE for licensing information.
    00016 **
    00017 ** Contact ask@quickfixengine.org if any conditions of this licensing are
    00018 ** not clear to you.
    00019 **
    00020 ****************************************************************************/
    00021
    00022 #ifndef FIX_SESSIONFACTORY_H
    00023 #define FIX_SESSIONFACTORY_H
    00024
    00025 #ifdef _MSC_VER
    00026 #pragma warning( disable : 4503 4355 4786 4290 )
    00027 #endif
    00028
    00029 #include "Log.h"
    00030 #include "Exceptions.h"
    00031 #include "Dictionary.h"
    00032
    00033 namespace FIX
    00034 {
    00035 class SessionID;
    00036 class Session;
    00037 class Application;
    00038 class MessageStoreFactory;
    00039 class DataDictionaryProvider;
    00040
    00046 class SessionFactory
    00047 {
    00048 public:
    00049   SessionFactory( Application& application,
    00050                   MessageStoreFactory& messageStoreFactory,
    00051                   LogFactory* pLogFactory )
    00052 : m_application( application ),
    00053   m_messageStoreFactory( messageStoreFactory ),
    00054   m_pLogFactory( pLogFactory ) {}
    00055
    00056   ~SessionFactory();
    00057
    00058   Session* create( const SessionID& sessionID,
    00059                    const Dictionary& settings ) throw( ConfigError );
    00060
    00061 private:
    00062   typedef std::map < std::string, DataDictionary* > Dictionaries;
    00063
    00064   DataDictionary createDataDictionary(const SessionID& sessionID,
    00065                                       const Dictionary& settings,
    00066                                       const std::string& settingsKey) throw(ConfigError);
    00067
    00068   void processFixtDataDictionaries(const SessionID& sessionID,
    00069                                    const Dictionary& settings,
    00070                                    DataDictionaryProvider& provider) throw(ConfigError);
    00071
    00072   void processFixDataDictionary(const SessionID& sessionID,
    00073                                 const Dictionary& settings,
    00074                                 DataDictionaryProvider& provider) throw(ConfigError);
    00075
    00076   std::string toApplVerID(const std::string& value);
    00077
    00078   Application& m_application;
    00079   MessageStoreFactory& m_messageStoreFactory;
    00080   LogFactory* m_pLogFactory;
    00081   Dictionaries m_dictionaries;
    00082 };
    00083 }
    00084
    00085 #endif