DataDictionaryProvider.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 "DataDictionaryProvider.h"
00027 #include "Fields.h"
00028 #include "DataDictionary.h"
00029 
00030 namespace FIX
00031 {
00032 DataDictionaryProvider::DataDictionaryProvider( const DataDictionaryProvider& copy )
00033 {
00034   *this = copy;
00035 }
00036 
00037 const DataDictionary& DataDictionaryProvider::getSessionDataDictionary
00038 (const BeginString& beginString) const throw( DataDictionaryNotFound )
00039 {
00040   std::map<std::string, const DataDictionary*>::const_iterator find =
00041     m_transportDictionaries.find(beginString);
00042   if( find != m_transportDictionaries.end() )
00043     return *find->second;
00044   
00045   return emptyDataDictionary;
00046 }
00047 
00048 const DataDictionary& DataDictionaryProvider::getApplicationDataDictionary
00049 (const ApplVerID& applVerID) const throw( DataDictionaryNotFound )
00050 {
00051   std::map<std::string, const DataDictionary*>::const_iterator find =
00052     m_applicationDictionaries.find(applVerID);
00053   if( find != m_applicationDictionaries.end() )
00054     return *find->second;
00055 
00056   return emptyDataDictionary;
00057 }
00058 
00059 void DataDictionaryProvider::addTransportDataDictionary
00060 (const BeginString& beginString, const DataDictionary * pDD)
00061 {
00062   m_transportDictionaries[beginString.getValue()] = pDD;
00063 }
00064 
00065 void DataDictionaryProvider::addApplicationDataDictionary
00066 (const ApplVerID& applVerID, const DataDictionary * pDD)
00067 {
00068   m_applicationDictionaries[applVerID.getValue()] = pDD;
00069 }
00070 }
00071 

Generated on Mon Jun 23 2014 23:49:37 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001