SessionSettings.h
Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 /****************************************************************************
00004 ** Copyright (c) 2001-2014
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_SESSIONSETTINGS_H
00023 #define FIX_SESSIONSETTINGS_H
00024 
00025 #ifdef _MSC_VER
00026 #pragma warning( disable : 4503 4355 4786 4290 )
00027 #endif
00028 
00029 #include "Dictionary.h"
00030 #include "SessionID.h"
00031 #include "Exceptions.h"
00032 #include <map>
00033 #include <set>
00034 
00035 namespace FIX
00036 {
00037 const char BEGINSTRING[] = "BeginString";
00038 const char SENDERCOMPID[] = "SenderCompID";
00039 const char TARGETCOMPID[] = "TargetCompID";
00040 const char SESSION_QUALIFIER[] = "SessionQualifier";
00041 const char DEFAULT_APPLVERID[] = "DefaultApplVerID";
00042 const char CONNECTION_TYPE[] = "ConnectionType";
00043 const char USE_DATA_DICTIONARY[] = "UseDataDictionary";
00044 const char SEND_RESETSEQNUMFLAG[] = "SendResetSeqNumFlag";
00045 const char SEND_REDUNDANT_RESENDREQUESTS[] = "SendRedundantResendRequests";
00046 const char DATA_DICTIONARY[] = "DataDictionary";
00047 const char TRANSPORT_DATA_DICTIONARY[] = "TransportDataDictionary";
00048 const char APP_DATA_DICTIONARY[] = "AppDataDictionary";
00049 const char USE_LOCAL_TIME[] = "UseLocalTime";
00050 const char START_TIME[] = "StartTime";
00051 const char END_TIME[] = "EndTime";
00052 const char START_DAY[] = "StartDay";
00053 const char END_DAY[] = "EndDay";
00054 const char LOGON_TIME[] = "LogonTime";
00055 const char LOGOUT_TIME[] = "LogoutTime";
00056 const char LOGON_DAY[] = "LogonDay";
00057 const char LOGOUT_DAY[] = "LogoutDay";
00058 const char CHECK_COMPID[] = "CheckCompID";
00059 const char CHECK_LATENCY[] = "CheckLatency";
00060 const char MAX_LATENCY[] = "MaxLatency";
00061 const char HEARTBTINT[] = "HeartBtInt";
00062 const char SOCKET_ACCEPT_PORT[] = "SocketAcceptPort";
00063 const char SOCKET_REUSE_ADDRESS[] = "SocketReuseAddress";
00064 const char SOCKET_CONNECT_HOST[] = "SocketConnectHost";
00065 const char SOCKET_CONNECT_PORT[] = "SocketConnectPort";
00066 const char SOCKET_NODELAY[] = "SocketNodelay";
00067 const char SOCKET_SEND_BUFFER_SIZE[] = "SendBufferSize";
00068 const char SOCKET_RECEIVE_BUFFER_SIZE[] = "ReceiveBufferSize";
00069 const char RECONNECT_INTERVAL[] = "ReconnectInterval";
00070 const char VALIDATE_LENGTH_AND_CHECKSUM[] = "ValidateLengthAndChecksum";
00071 const char VALIDATE_FIELDS_OUT_OF_ORDER[] = "ValidateFieldsOutOfOrder";
00072 const char VALIDATE_FIELDS_HAVE_VALUES[] = "ValidateFieldsHaveValues";
00073 const char VALIDATE_USER_DEFINED_FIELDS[] = "ValidateUserDefinedFields";
00074 const char LOGON_TIMEOUT[] = "LogonTimeout";
00075 const char LOGOUT_TIMEOUT[] = "LogoutTimeout";
00076 const char FILE_STORE_PATH[] = "FileStorePath";
00077 const char MYSQL_STORE_USECONNECTIONPOOL[] = "MySQLStoreUseConnectionPool";
00078 const char MYSQL_STORE_DATABASE[] = "MySQLStoreDatabase";
00079 const char MYSQL_STORE_USER[] = "MySQLStoreUser";
00080 const char MYSQL_STORE_PASSWORD[] = "MySQLStorePassword";
00081 const char MYSQL_STORE_HOST[] = "MySQLStoreHost";
00082 const char MYSQL_STORE_PORT[] = "MySQLStorePort";
00083 const char POSTGRESQL_STORE_USECONNECTIONPOOL[] = "PostgreSQLStoreUseConnectionPool";
00084 const char POSTGRESQL_STORE_DATABASE[] = "PostgreSQLStoreDatabase";
00085 const char POSTGRESQL_STORE_USER[] = "PostgreSQLStoreUser";
00086 const char POSTGRESQL_STORE_PASSWORD[] = "PostgreSQLStorePassword";
00087 const char POSTGRESQL_STORE_HOST[] = "PostgreSQLStoreHost";
00088 const char POSTGRESQL_STORE_PORT[] = "PostgreSQLStorePort";
00089 const char ODBC_STORE_USER[] = "OdbcStoreUser";
00090 const char ODBC_STORE_PASSWORD[] = "OdbcStorePassword";
00091 const char ODBC_STORE_CONNECTION_STRING[] = "OdbcStoreConnectionString";
00092 const char FILE_LOG_PATH[] = "FileLogPath";
00093 const char FILE_LOG_BACKUP_PATH[] = "FileLogBackupPath";
00094 const char SCREEN_LOG_SHOW_INCOMING[] = "ScreenLogShowIncoming";
00095 const char SCREEN_LOG_SHOW_OUTGOING[] = "ScreenLogShowOutgoing";
00096 const char SCREEN_LOG_SHOW_EVENTS[] = "ScreenLogShowEvents";
00097 const char MYSQL_LOG_USECONNECTIONPOOL[] = "MySQLLogUseConnectionPool";
00098 const char MYSQL_LOG_DATABASE[] = "MySQLLogDatabase";
00099 const char MYSQL_LOG_USER[] = "MySQLLogUser";
00100 const char MYSQL_LOG_PASSWORD[] = "MySQLLogPassword";
00101 const char MYSQL_LOG_HOST[] = "MySQLLogHost";
00102 const char MYSQL_LOG_PORT[] = "MySQLLogPort";
00103 const char MYSQL_LOG_INCOMING_TABLE[] = "MySQLLogIncomingTable";
00104 const char MYSQL_LOG_OUTGOING_TABLE[] = "MySQLLogOutgoingTable";
00105 const char MYSQL_LOG_EVENT_TABLE[] = "MySQLLogEventTable";
00106 const char POSTGRESQL_LOG_USECONNECTIONPOOL[] = "PostgreSQLLogUseConnectionPool";
00107 const char POSTGRESQL_LOG_DATABASE[] = "PostgreSQLLogDatabase";
00108 const char POSTGRESQL_LOG_USER[] = "PostgreSQLLogUser";
00109 const char POSTGRESQL_LOG_PASSWORD[] = "PostgreSQLLogPassword";
00110 const char POSTGRESQL_LOG_HOST[] = "PostgreSQLLogHost";
00111 const char POSTGRESQL_LOG_PORT[] = "PostgreSQLLogPort";
00112 const char POSTGRESQL_LOG_INCOMING_TABLE[] = "PostgreSQLLogIncomingTable";
00113 const char POSTGRESQL_LOG_OUTGOING_TABLE[] = "PostgreSQLLogOutgoingTable";
00114 const char POSTGRESQL_LOG_EVENT_TABLE[] = "PostgreSQLLogEventTable";
00115 const char ODBC_LOG_USER[] = "OdbcLogUser";
00116 const char ODBC_LOG_PASSWORD[] = "OdbcLogPassword";
00117 const char ODBC_LOG_CONNECTION_STRING[] = "OdbcLogConnectionString";
00118 const char ODBC_LOG_INCOMING_TABLE[] = "OdbcLogIncomingTable";
00119 const char ODBC_LOG_OUTGOING_TABLE[] = "OdbcLogOutgoingTable";
00120 const char ODBC_LOG_EVENT_TABLE[] = "OdbcLogEventTable";
00121 const char RESET_ON_LOGON[] = "ResetOnLogon";
00122 const char RESET_ON_LOGOUT[] = "ResetOnLogout";
00123 const char RESET_ON_DISCONNECT[] = "ResetOnDisconnect";
00124 const char REFRESH_ON_LOGON[] = "RefreshOnLogon";
00125 const char MILLISECONDS_IN_TIMESTAMP[] = "MillisecondsInTimeStamp";
00126 const char HTTP_ACCEPT_PORT[] = "HttpAcceptPort";
00127 const char PERSIST_MESSAGES[] = "PersistMessages";
00128 
00130 class SessionSettings
00131 {
00132 public:
00133   SessionSettings() {}
00134   SessionSettings( std::istream& stream ) throw( ConfigError );
00135   SessionSettings( const std::string& file ) throw( ConfigError );
00136 
00138   const bool has( const SessionID& ) const;
00139 
00141   const Dictionary& get( const SessionID& ) const throw( ConfigError );
00143   void set( const SessionID&, Dictionary ) throw( ConfigError );
00144 
00146   const Dictionary& get() const { return m_defaults; }
00148   void set( const Dictionary& defaults ) throw( ConfigError );
00149 
00151   int size() const { return m_settings.size(); }
00152 
00153   typedef std::map < SessionID, Dictionary > Dictionaries;
00154   std::set < SessionID > getSessions() const;
00155 
00156 private:
00157   void validate( const Dictionary& ) const throw( ConfigError );
00158 
00159   Dictionaries m_settings;
00160   Dictionary m_defaults;
00161 
00162   friend std::ostream& operator<<( std::ostream&, const SessionSettings& );
00163 };
00166 std::istream& operator>>( std::istream&, SessionSettings& )
00167 throw( ConfigError );
00168 std::ostream& operator<<( std::ostream&, const SessionSettings& );
00169 }
00170 
00171 #endif //FIX_SESSIONSETTINGS_H

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