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

/home/orenmnero/autobuild/quickfix/src/C++/Dictionary.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_DICTIONARY_H
00023 #define FIX_DICTIONARY_H
00024 
00025 #ifdef _MSC_VER
00026 #pragma warning( disable : 4503 4355 4786 4290 )
00027 #endif
00028 
00029 #include <map>
00030 #include <string>
00031 #include "Exceptions.h"
00032 
00033 namespace FIX
00034 {
00036 class Dictionary
00037 {
00038 public:
00039   Dictionary( const std::string& name ) : m_name( name ) {}
00040   Dictionary() {}
00041   virtual ~Dictionary() {}
00042 
00044   std::string getName() const { return m_name; }
00046   int size() const { return m_data.size(); }
00047 
00049   std::string getString( const std::string&, bool capitalize = false ) const
00050   throw( ConfigError, FieldConvertError );
00052   long getLong( const std::string& ) const
00053   throw( ConfigError, FieldConvertError );
00055   double getDouble( const std::string& ) const
00056   throw( ConfigError, FieldConvertError );
00058   bool getBool( const std::string& ) const
00059   throw( ConfigError, FieldConvertError );
00061   int getDay( const std::string& ) const
00062   throw( ConfigError, FieldConvertError );
00063 
00065   void setString( const std::string&, const std::string& );
00067   void setLong( const std::string&, const long& );
00069   void setDouble( const std::string&, const double& );
00071   void setBool( const std::string&, const bool& );
00073   void setDay( const std::string&, const int& );
00074 
00076   bool has( const std::string& ) const;
00078   void merge( const Dictionary& );
00079 
00080 private:
00081   typedef std::map < std::string, std::string > Data;
00082   Data m_data;
00083   std::string m_name;
00084 };
00086 }
00087 
00088 #endif //FIX_DICTIONARY_H

Generated on Mon Jul 24 19:36:27 2006 for QuickFIX by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2001