Session.h
Go to the documentation of this file.
/* -*- C++ -*- */
/****************************************************************************
** Copyright (c) 2001-2014
**
** This file is part of the QuickFIX FIX Engine
**
** This file may be distributed under the terms of the quickfixengine.org
** license as defined by quickfixengine.org and appearing in the file
** LICENSE included in the packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.quickfixengine.org/LICENSE for licensing information.
**
** Contact ask@quickfixengine.org if any conditions of this licensing are
** not clear to you.
**
****************************************************************************/
#ifndef FIX_SESSION_H
#define FIX_SESSION_H
#ifdef _MSC_VER
#pragma warning( disable : 4503 4355 4786 4290 )
#endif
#include "SessionState.h"
#include "TimeRange.h"
#include "SessionID.h"
#include "Responder.h"
#include "Fields.h"
#include "DataDictionaryProvider.h"
#include "Application.h"
#include "Mutex.h"
#include "Log.h"
#include <utility>
#include <map>
#include <queue>
namespace FIX
{
class Session
{
public:
Session( Application&, MessageStoreFactory&,
const SessionID&,
const DataDictionaryProvider&,
const TimeRange&,
int heartBtInt, LogFactory* pLogFactory );
virtual ~Session();
void logon()
{ m_state.enabled( true ); m_state.logoutReason( "" ); }
void logout( const std::string& reason = "" )
{ m_state.enabled( false ); m_state.logoutReason( reason ); }
bool isEnabled()
{ return m_state.enabled(); }
bool sentLogon() { return m_state.sentLogon(); }
bool sentLogout() { return m_state.sentLogout(); }
bool receivedLogon() { return m_state.receivedLogon(); }
bool isLoggedOn() { return receivedLogon() && sentLogon(); }
void reset() throw( IOException )
{ generateLogout(); disconnect(); m_state.reset(); }
void refresh() throw( IOException )
{ m_state.refresh(); }
void setNextSenderMsgSeqNum( int num ) throw( IOException )
{ m_state.setNextSenderMsgSeqNum( num ); }
void setNextTargetMsgSeqNum( int num ) throw( IOException )
{ m_state.setNextTargetMsgSeqNum( num ); }
const SessionID& getSessionID() const
{ return m_sessionID; }
void setDataDictionaryProvider( const DataDictionaryProvider& dataDictionaryProvider )
{ m_dataDictionaryProvider = dataDictionaryProvider; }
const DataDictionaryProvider& getDataDictionaryProvider() const
{ return m_dataDictionaryProvider; }
static bool sendToTarget( Message& message,
const std::string& qualifier = "" )
throw( SessionNotFound );
static bool sendToTarget( Message& message, const SessionID& sessionID )
throw( SessionNotFound );
static bool sendToTarget( Message&,
const SenderCompID& senderCompID,
const TargetCompID& targetCompID,
const std::string& qualifier = "" )
throw( SessionNotFound );
static bool sendToTarget( Message& message,
const std::string& senderCompID,
const std::string& targetCompID,
const std::string& qualifier = "" )
throw( SessionNotFound );
static std::set<SessionID> getSessions();
static bool doesSessionExist( const SessionID& );
static Session* lookupSession( const SessionID& );
static Session* lookupSession( const std::string&, bool reverse = false );
static bool isSessionRegistered( const SessionID& );
static Session* registerSession( const SessionID& );
static void unregisterSession( const SessionID& );
static size_t numSessions();
bool isSessionTime(const UtcTimeStamp& time)
{ return m_sessionTime.isInRange(time); }
bool isLogonTime(const UtcTimeStamp& time)
{ return m_logonTime.isInRange(time); }
bool isInitiator()
{ return m_state.initiate(); }
bool isAcceptor()
{ return !m_state.initiate(); }
const TimeRange& getLogonTime()
{ return m_logonTime; }
void setLogonTime( const TimeRange& value )
{ m_logonTime = value; }
const std::string& getSenderDefaultApplVerID()
{ return m_senderDefaultApplVerID; }
void setSenderDefaultApplVerID( const std::string& senderDefaultApplVerID )
{ m_senderDefaultApplVerID = senderDefaultApplVerID; }
const std::string& getTargetDefaultApplVerID()
{ return m_targetDefaultApplVerID; }
void setTargetDefaultApplVerID( const std::string& targetDefaultApplVerID )
{ m_targetDefaultApplVerID = targetDefaultApplVerID; }
bool getSendRedundantResendRequests()
{ return m_sendRedundantResendRequests; }
void setSendRedundantResendRequests ( bool value )
{ m_sendRedundantResendRequests = value; }
bool getCheckCompId()
{ return m_checkCompId; }
void setCheckCompId ( bool value )
{ m_checkCompId = value; }
bool getCheckLatency()
{ return m_checkLatency; }
void setCheckLatency ( bool value )
{ m_checkLatency = value; }
int getMaxLatency()
{ return m_maxLatency; }
void setMaxLatency ( int value )
{ m_maxLatency = value; }
int getLogonTimeout()
{ return m_state.logonTimeout(); }
void setLogonTimeout ( int value )
{ m_state.logonTimeout( value ); }
int getLogoutTimeout()
{ return m_state.logoutTimeout(); }
void setLogoutTimeout ( int value )
{ m_state.logoutTimeout( value ); }
bool getResetOnLogon()
{ return m_resetOnLogon; }
void setResetOnLogon ( bool value )
{ m_resetOnLogon = value; }
bool getResetOnLogout()
{ return m_resetOnLogout; }
void setResetOnLogout ( bool value )
{ m_resetOnLogout = value; }
bool getResetOnDisconnect()
{ return m_resetOnDisconnect; }
void setResetOnDisconnect( bool value )
{ m_resetOnDisconnect = value; }
bool getRefreshOnLogon()
{ return m_refreshOnLogon; }
void setRefreshOnLogon( bool value )
{ m_refreshOnLogon = value; }
bool getMillisecondsInTimeStamp()
{ return m_millisecondsInTimeStamp; }
void setMillisecondsInTimeStamp ( bool value )
{ m_millisecondsInTimeStamp = value; }
bool getPersistMessages()
{ return m_persistMessages; }
void setPersistMessages ( bool value )
{ m_persistMessages = value; }
bool getValidateLengthAndChecksum()
{ return m_validateLengthAndChecksum; }
void setValidateLengthAndChecksum ( bool value )
{ m_validateLengthAndChecksum = value; }
void setResponder( Responder* pR )
{
if( !checkSessionTime(UtcTimeStamp()) )
reset();
m_pResponder = pR;
}
bool send( Message& );
void next();
void next( const UtcTimeStamp& timeStamp );
void next( const std::string&, const UtcTimeStamp& timeStamp, bool queued = false );
void next( const Message&, const UtcTimeStamp& timeStamp, bool queued = false );
void disconnect();
int getExpectedSenderNum() { return m_state.getNextSenderMsgSeqNum(); }
int getExpectedTargetNum() { return m_state.getNextTargetMsgSeqNum(); }
Log* getLog() { return &m_state; }
const MessageStore* getStore() { return &m_state; }
const HeartBtInt& getHeartBtInt() const { return m_state.heartBtInt(); }
private:
typedef std::map < SessionID, Session* > Sessions;
typedef std::set < SessionID > SessionIDs;
static bool addSession( Session& );
static void removeSession( Session& );
bool send( const std::string& );
bool sendRaw( Message&, int msgSeqNum = 0 );
bool resend( Message& message );
void persist( const Message&, const std::string& ) throw ( IOException );
void insertSendingTime( Header& );
void insertOrigSendingTime( Header&,
const UtcTimeStamp& when = UtcTimeStamp () );
void fill( Header& );
bool isGoodTime( const SendingTime& sendingTime )
{
if ( !m_checkLatency ) return true;
UtcTimeStamp now;
return labs( now - sendingTime ) <= m_maxLatency;
}
bool checkSessionTime( const UtcTimeStamp& timeStamp )
{
UtcTimeStamp creationTime = m_state.getCreationTime();
return m_sessionTime.isInSameRange( timeStamp, creationTime );
}
bool isTargetTooHigh( const MsgSeqNum& msgSeqNum )
{ return msgSeqNum > ( m_state.getNextTargetMsgSeqNum() ); }
bool isTargetTooLow( const MsgSeqNum& msgSeqNum )
{ return msgSeqNum < ( m_state.getNextTargetMsgSeqNum() ); }
bool isCorrectCompID( const SenderCompID& senderCompID,
const TargetCompID& targetCompID )
{
if( !m_checkCompId ) return true;
return
m_sessionID.getSenderCompID().getValue() == targetCompID.getValue()
&& m_sessionID.getTargetCompID().getValue() == senderCompID.getValue();
}
bool shouldSendReset();
bool validLogonState( const MsgType& msgType );
void fromCallback( const MsgType& msgType, const Message& msg,
const SessionID& sessionID );
void doBadTime( const Message& msg );
void doBadCompID( const Message& msg );
bool doPossDup( const Message& msg );
bool doTargetTooLow( const Message& msg );
void doTargetTooHigh( const Message& msg );
void nextQueued( const UtcTimeStamp& timeStamp );
bool nextQueued( int num, const UtcTimeStamp& timeStamp );
void nextLogon( const Message&, const UtcTimeStamp& timeStamp );
void nextHeartbeat( const Message&, const UtcTimeStamp& timeStamp );
void nextTestRequest( const Message&, const UtcTimeStamp& timeStamp );
void nextLogout( const Message&, const UtcTimeStamp& timeStamp );
void nextReject( const Message&, const UtcTimeStamp& timeStamp );
void nextSequenceReset( const Message&, const UtcTimeStamp& timeStamp );
void nextResendRequest( const Message&, const UtcTimeStamp& timeStamp );
void generateLogon();
void generateLogon( const Message& );
void generateResendRequest( const BeginString&, const MsgSeqNum& );
void generateSequenceReset( int, int );
void generateHeartbeat();
void generateHeartbeat( const Message& );
void generateTestRequest( const std::string& );
void generateReject( const Message&, int err, int field = 0 );
void generateReject( const Message&, const std::string& );
void generateBusinessReject( const Message&, int err, int field = 0 );
void generateLogout( const std::string& text = "" );
void populateRejectReason( Message&, int field, const std::string& );
void populateRejectReason( Message&, const std::string& );
bool verify( const Message& msg,
bool checkTooHigh = true, bool checkTooLow = true );
bool set( int s, const Message& m );
bool get( int s, Message& m ) const;
Application& m_application;
SessionID m_sessionID;
TimeRange m_sessionTime;
TimeRange m_logonTime;
std::string m_senderDefaultApplVerID;
std::string m_targetDefaultApplVerID;
bool m_sendRedundantResendRequests;
bool m_checkCompId;
bool m_checkLatency;
int m_maxLatency;
bool m_resetOnLogon;
bool m_resetOnLogout;
bool m_resetOnDisconnect;
bool m_refreshOnLogon;
bool m_millisecondsInTimeStamp;
bool m_persistMessages;
bool m_validateLengthAndChecksum;
SessionState m_state;
DataDictionaryProvider m_dataDictionaryProvider;
MessageStoreFactory& m_messageStoreFactory;
LogFactory* m_pLogFactory;
Responder* m_pResponder;
Mutex m_mutex;
static Sessions s_sessions;
static SessionIDs s_sessionIDs;
static Sessions s_registered;
static Mutex s_mutex;
};
}
#endif //FIX_SESSION_H
FIX::Session::getCheckLatency
bool getCheckLatency()
Definition: Session.h:142
FIX::Session::getExpectedTargetNum
int getExpectedTargetNum()
Definition: Session.h:212
FIX::SessionState::logonTimeout
int logonTimeout() const
Definition: SessionState.h:71
FIX::Session::isEnabled
bool isEnabled()
Definition: Session.h:59
FIX::Session::getCheckCompId
bool getCheckCompId()
Definition: Session.h:137
FIX::Session::lookupSession
static Session * lookupSession(const SessionID &)
Definition: Session.cpp:1403
FIX::Session::~Session
virtual ~Session()
Definition: Session.cpp:83
FIX::SessionState::getNextTargetMsgSeqNum
int getNextTargetMsgSeqNum() const
Definition: SessionState.h:179
FIX::Session::populateRejectReason
void populateRejectReason(Message &, int field, const std::string &)
Definition: Session.cpp:916
FIX::Session::isGoodTime
bool isGoodTime(const SendingTime &sendingTime)
Definition: Session.h:236
FIX::Session::send
bool send(Message &)
Definition: Session.cpp:452
FIX::Session::getRefreshOnLogon
bool getRefreshOnLogon()
Definition: Session.h:177
FIX::Session::setRefreshOnLogon
void setRefreshOnLogon(bool value)
Definition: Session.h:179
FIX::Session::setDataDictionaryProvider
void setDataDictionaryProvider(const DataDictionaryProvider &dataDictionaryProvider)
Definition: Session.h:77
FIX::Session::verify
bool verify(const Message &msg, bool checkTooHigh=true, bool checkTooLow=true)
Definition: Session.cpp:941
FIX::TimeRange
Keeps track of when session is active.
Definition: TimeRange.h:34
FIX::FIELD::HeartBtInt
const int HeartBtInt
Definition: FixFieldNumbers.h:240
FIX::Session::getExpectedSenderNum
int getExpectedSenderNum()
Definition: Session.h:211
FIX::SessionState::enabled
bool enabled() const
Definition: SessionState.h:50
FIX::Session::m_dataDictionaryProvider
DataDictionaryProvider m_dataDictionaryProvider
Definition: Session.h:323
FIX::Session::getValidateLengthAndChecksum
bool getValidateLengthAndChecksum()
Definition: Session.h:192
FIX::Session::generateHeartbeat
void generateHeartbeat()
Definition: Session.cpp:685
FIX::Session::getDataDictionaryProvider
const DataDictionaryProvider & getDataDictionaryProvider() const
Definition: Session.h:79
FIX::Session::unregisterSession
static void unregisterSession(const SessionID &)
Definition: Session.cpp:1454
FIX::Session::isInitiator
bool isInitiator()
Definition: Session.h:112
FIX::Session::getHeartBtInt
const HeartBtInt & getHeartBtInt() const
Definition: Session.h:217
FIX::Session
Maintains the state and implements the logic of a FIX session.
Definition: Session.h:45
FIX::Session::doBadTime
void doBadTime(const Message &msg)
Definition: Session.cpp:1053
FIX::Session::nextReject
void nextReject(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:312
FIX::Session::m_messageStoreFactory
MessageStoreFactory & m_messageStoreFactory
Definition: Session.h:324
FIX::Session::sentLogon
bool sentLogon()
Definition: Session.h:62
Responder.h
FIX::Session::addSession
static bool addSession(Session &)
Definition: Session.cpp:1466
FIX::Responder
Interface implements sending on and disconnecting a transport.
Definition: Responder.h:34
FIX::SessionNotFound
Session cannot be found for specified action.
Definition: Exceptions.h:231
FIX::Session::next
void next()
Definition: Session.cpp:125
FIX::Session::numSessions
static size_t numSessions()
Definition: Session.cpp:1460
FIX::SessionState::setNextTargetMsgSeqNum
void setNextTargetMsgSeqNum(int n)
Definition: SessionState.h:183
FIX::DataDictionaryProvider
Queries for DataDictionary based on appropriate version of FIX.
Definition: DataDictionaryProvider.h:42
FIX::Session::setLogonTime
void setLogonTime(const TimeRange &value)
Definition: Session.h:119
FIX::SessionState::getCreationTime
UtcTimeStamp getCreationTime() const
Definition: SessionState.h:189
reverse
void reverse(I begin, I end)
Definition: pugixml.cpp:6009
FIX::Session::receivedLogon
bool receivedLogon()
Definition: Session.h:64
FIX::Session::sendRaw
bool sendRaw(Message &, int msgSeqNum=0)
Definition: Session.cpp:459
FIX::Session::m_checkLatency
bool m_checkLatency
Definition: Session.h:312
FIX::Session::m_sessionID
SessionID m_sessionID
Definition: Session.h:304
FIX::Session::nextTestRequest
void nextTestRequest(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:287
FIX::Session::reset
void reset()
Definition: Session.h:66
FIX::Session::setMillisecondsInTimeStamp
void setMillisecondsInTimeStamp(bool value)
Definition: Session.h:184
FIX::Session::validLogonState
bool validLogonState(const MsgType &msgType)
Definition: Session.cpp:1024
SessionID.h
FIX::Session::setNextSenderMsgSeqNum
void setNextSenderMsgSeqNum(int num)
Definition: Session.h:70
FIX::Session::nextResendRequest
void nextResendRequest(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:344
FIX::Session::getPersistMessages
bool getPersistMessages()
Definition: Session.h:187
FIX::Session::generateResendRequest
void generateResendRequest(const BeginString &, const MsgSeqNum &)
Definition: Session.cpp:643
FIX::Session::getSendRedundantResendRequests
bool getSendRedundantResendRequests()
Definition: Session.h:132
FIX::SessionID::getTargetCompID
const TargetCompID & getTargetCompID() const
Definition: SessionID.h:57
FIX::Session::setResetOnLogon
void setResetOnLogon(bool value)
Definition: Session.h:164
FIX::Session::refresh
void refresh()
Definition: Session.h:68
FIX::SessionState::initiate
bool initiate() const
Definition: SessionState.h:68
FIX::TimeRange::isInRange
static bool isInRange(const UtcTimeOnly &start, const UtcTimeOnly &end, const DateTime &time)
Definition: TimeRange.h:43
FIX::Session::setCheckCompId
void setCheckCompId(bool value)
Definition: Session.h:139
FIX::Session::isSessionRegistered
static bool isSessionRegistered(const SessionID &)
Definition: Session.cpp:1438
FIX::Session::m_checkCompId
bool m_checkCompId
Definition: Session.h:311
FIX::Session::getMillisecondsInTimeStamp
bool getMillisecondsInTimeStamp()
Definition: Session.h:182
FIX::Session::setSenderDefaultApplVerID
void setSenderDefaultApplVerID(const std::string &senderDefaultApplVerID)
Definition: Session.h:124
FIX::SessionState::logoutTimeout
int logoutTimeout() const
Definition: SessionState.h:74
FIX::Session::isLogonTime
bool isLogonTime(const UtcTimeStamp &time)
Definition: Session.h:110
Log.h
FIX::Session::getMaxLatency
int getMaxLatency()
Definition: Session.h:147
FIX::Log
This interface must be implemented to log messages and events.
Definition: Log.h:81
FIX::Session::isTargetTooLow
bool isTargetTooLow(const MsgSeqNum &msgSeqNum)
Definition: Session.h:249
FIX::FIELD::SendingTime
const int SendingTime
Definition: FixFieldNumbers.h:1447
FIX::Header
Definition: Message.h:47
FIX::Session::s_sessions
static Sessions s_sessions
Definition: Session.h:329
FIX
Definition: Acceptor.cpp:34
FIX::Session::getResetOnLogon
bool getResetOnLogon()
Definition: Session.h:162
FIX::Session::registerSession
static Session * registerSession(const SessionID &)
Definition: Session.cpp:1444
FIX::Session::doTargetTooHigh
void doTargetTooHigh(const Message &msg)
Definition: Session.cpp:1113
FIX::Session::getLog
Log * getLog()
Definition: Session.h:214
FIX::Session::generateLogon
void generateLogon()
Definition: Session.cpp:602
FIX::Session::setLogoutTimeout
void setLogoutTimeout(int value)
Definition: Session.h:159
FIX::Session::Session
Session(Application &, MessageStoreFactory &, const SessionID &, const DataDictionaryProvider &, const TimeRange &, int heartBtInt, LogFactory *pLogFactory)
Definition: Session.cpp:41
FIX::Session::generateSequenceReset
void generateSequenceReset(int, int)
Definition: Session.cpp:666
FIX::Application
This interface must be implemented to define what your FIX application does.
Definition: Application.h:43
FIX::Session::setPersistMessages
void setPersistMessages(bool value)
Definition: Session.h:189
FIX::Session::getSessions
static std::set< SessionID > getSessions()
Definition: Session.cpp:1392
FIX::Session::sendToTarget
static bool sendToTarget(Message &message, const std::string &qualifier="")
Definition: Session.cpp:1351
FIX::Session::m_maxLatency
int m_maxLatency
Definition: Session.h:313
FIX::Session::m_application
Application & m_application
Definition: Session.h:303
FIX::Session::getResetOnLogout
bool getResetOnLogout()
Definition: Session.h:167
FIX::Session::m_resetOnLogon
bool m_resetOnLogon
Definition: Session.h:314
FIX::Session::m_senderDefaultApplVerID
std::string m_senderDefaultApplVerID
Definition: Session.h:308
FIX::Session::m_pLogFactory
LogFactory * m_pLogFactory
Definition: Session.h:325
FIX::Session::disconnect
void disconnect()
Definition: Session.cpp:542
FIX::Session::persist
void persist(const Message &, const std::string &)
Definition: Session.cpp:592
FIX::Session::s_sessionIDs
static SessionIDs s_sessionIDs
Definition: Session.h:330
DataDictionaryProvider.h
FIX::Session::isTargetTooHigh
bool isTargetTooHigh(const MsgSeqNum &msgSeqNum)
Definition: Session.h:247
FIX::Session::getLogonTimeout
int getLogonTimeout()
Definition: Session.h:152
FIX::FIELD::TargetCompID
const int TargetCompID
Definition: FixFieldNumbers.h:217
FIX::Session::m_millisecondsInTimeStamp
bool m_millisecondsInTimeStamp
Definition: Session.h:318
FIX::Session::s_mutex
static Mutex s_mutex
Definition: Session.h:332
FIX::Session::m_logonTime
TimeRange m_logonTime
Definition: Session.h:306
FIX::Session::generateReject
void generateReject(const Message &, int err, int field=0)
Definition: Session.cpp:720
FIX::Session::setMaxLatency
void setMaxLatency(int value)
Definition: Session.h:149
FIX::Session::m_state
SessionState m_state
Definition: Session.h:322
FIX::Session::m_targetDefaultApplVerID
std::string m_targetDefaultApplVerID
Definition: Session.h:309
FIX::SessionState::reset
void reset()
Definition: SessionState.h:191
FIX::LogFactory
This interface must be implemented to create a Log.
Definition: Log.h:42
FIX::SessionState::receivedLogon
bool receivedLogon() const
Definition: SessionState.h:53
FIX::Message
Base class for all FIX messages.
Definition: Message.h:67
FIX::Session::getLogoutTimeout
int getLogoutTimeout()
Definition: Session.h:157
FIX::Session::sentLogout
bool sentLogout()
Definition: Session.h:63
FIX::Session::m_validateLengthAndChecksum
bool m_validateLengthAndChecksum
Definition: Session.h:320
FIX::MessageStore
This interface must be implemented to store and retrieve messages and sequence numbers.
Definition: MessageStore.h:66
FIX::Session::getSessionID
const SessionID & getSessionID() const
Definition: Session.h:75
FIX::Session::checkSessionTime
bool checkSessionTime(const UtcTimeStamp &timeStamp)
Definition: Session.h:242
FIX::Session::insertSendingTime
void insertSendingTime(Header &)
Definition: Session.cpp:91
FIX::SessionState::logoutReason
std::string logoutReason() const
Definition: SessionState.h:150
FIX::Session::fromCallback
void fromCallback(const MsgType &msgType, const Message &msg, const SessionID &sessionID)
Definition: Session.cpp:1044
FIX::Session::shouldSendReset
bool shouldSendReset()
Definition: Session.cpp:1013
FIX::Session::nextHeartbeat
void nextHeartbeat(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:280
FIX::MessageStoreFactory
This interface must be implemented to create a MessageStore.
Definition: MessageStore.h:41
FIX::Mutex
Portable implementation of a mutex.
Definition: Mutex.h:30
FIX::Session::setResetOnLogout
void setResetOnLogout(bool value)
Definition: Session.h:169
FIX::Session::setSendRedundantResendRequests
void setSendRedundantResendRequests(bool value)
Definition: Session.h:134
FIX::SessionState::sentLogon
bool sentLogon() const
Definition: SessionState.h:59
FIX::Session::isCorrectCompID
bool isCorrectCompID(const SenderCompID &senderCompID, const TargetCompID &targetCompID)
Definition: Session.h:251
FIX::FIELD::SenderCompID
const int SenderCompID
Definition: FixFieldNumbers.h:124
FIX::Session::getTargetDefaultApplVerID
const std::string & getTargetDefaultApplVerID()
Definition: Session.h:127
Mutex.h
FIX::Session::generateTestRequest
void generateTestRequest(const std::string &)
Definition: Session.cpp:709
FIX::Session::nextLogon
void nextLogon(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:202
FIX::Session::getSenderDefaultApplVerID
const std::string & getSenderDefaultApplVerID()
Definition: Session.h:122
FIX::Session::removeSession
static void removeSession(Session &)
Definition: Session.cpp:1480
FIX::Session::doBadCompID
void doBadCompID(const Message &msg)
Definition: Session.cpp:1059
FIX::Session::generateLogout
void generateLogout(const std::string &text="")
Definition: Session.cpp:905
FIX::Session::getStore
const MessageStore * getStore()
Definition: Session.h:215
FIX::Session::generateBusinessReject
void generateBusinessReject(const Message &, int err, int field=0)
Definition: Session.cpp:842
FIX::Session::logout
void logout(const std::string &reason="")
Definition: Session.h:57
FIX::Session::setLogonTimeout
void setLogonTimeout(int value)
Definition: Session.h:154
FIX::Session::m_mutex
Mutex m_mutex
Definition: Session.h:327
FIX::Session::getLogonTime
const TimeRange & getLogonTime()
Definition: Session.h:117
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:674
FIX::Session::fill
void fill(Header &)
Definition: Session.cpp:114
FIX::Session::setResponder
void setResponder(Responder *pR)
Definition: Session.h:197
FIX::UtcTimeStamp
Date and Time represented in UTC.
Definition: FieldTypes.h:399
FIX::SessionState
Maintains all of state for the Session class.
Definition: SessionState.h:37
FIX::SessionState::refresh
void refresh()
Definition: SessionState.h:193
FIX::Session::m_resetOnDisconnect
bool m_resetOnDisconnect
Definition: Session.h:316
FIX::Session::m_sessionTime
TimeRange m_sessionTime
Definition: Session.h:305
FIX::Session::getResetOnDisconnect
bool getResetOnDisconnect()
Definition: Session.h:172
FIX::Session::doTargetTooLow
bool doTargetTooLow(const Message &msg)
Definition: Session.cpp:1093
FIX::Session::setValidateLengthAndChecksum
void setValidateLengthAndChecksum(bool value)
Definition: Session.h:194
FIX::Session::setCheckLatency
void setCheckLatency(bool value)
Definition: Session.h:144
FIX::FIELD::BeginString
const int BeginString
Definition: FixFieldNumbers.h:499
FIX::Session::m_persistMessages
bool m_persistMessages
Definition: Session.h:319
FIX::Session::SessionIDs
std::set< SessionID > SessionIDs
Definition: Session.h:221
FIX::Session::setResetOnDisconnect
void setResetOnDisconnect(bool value)
Definition: Session.h:174
FIX::FIELD::MsgSeqNum
const int MsgSeqNum
Definition: FixFieldNumbers.h:1333
FIX::Session::setNextTargetMsgSeqNum
void setNextTargetMsgSeqNum(int num)
Definition: Session.h:72
FIX::SessionID
Unique session id consists of BeginString, SenderCompID and TargetCompID.
Definition: SessionID.h:30
FIX::Session::m_sendRedundantResendRequests
bool m_sendRedundantResendRequests
Definition: Session.h:310
FIX::Session::m_pResponder
Responder * m_pResponder
Definition: Session.h:326
FIX::Session::insertOrigSendingTime
void insertOrigSendingTime(Header &, const UtcTimeStamp &when=UtcTimeStamp())
Definition: Session.cpp:103
FIX::Session::m_resetOnLogout
bool m_resetOnLogout
Definition: Session.h:315
FIX::Session::resend
bool resend(Message &message)
Definition: Session.cpp:572
FIX::Session::isSessionTime
bool isSessionTime(const UtcTimeStamp &time)
Definition: Session.h:108
FIX::Session::nextQueued
void nextQueued(const UtcTimeStamp &timeStamp)
Definition: Session.cpp:1145
FIX::SessionState::getNextSenderMsgSeqNum
int getNextSenderMsgSeqNum() const
Definition: SessionState.h:177
FIX::SessionID::getSenderCompID
const SenderCompID & getSenderCompID() const
Definition: SessionID.h:55
FIX::Session::m_refreshOnLogon
bool m_refreshOnLogon
Definition: Session.h:317
FIX::SessionState::setNextSenderMsgSeqNum
void setNextSenderMsgSeqNum(int n)
Definition: SessionState.h:181
FIX::Session::s_registered
static Sessions s_registered
Definition: Session.h:331
FIX::Session::nextLogout
void nextLogout(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:295
FIX::SessionState::sentLogout
bool sentLogout() const
Definition: SessionState.h:56
FIX::TimeRange::isInSameRange
static bool isInSameRange(const UtcTimeOnly &start, const UtcTimeOnly &end, const DateTime &time1, const DateTime &time2)
Definition: TimeRange.h:76
FIX::Session::setTargetDefaultApplVerID
void setTargetDefaultApplVerID(const std::string &targetDefaultApplVerID)
Definition: Session.h:129
FIX::IOException
IO Error.
Definition: Exceptions.h:238
FIX::FIELD::MsgType
const int MsgType
Definition: FixFieldNumbers.h:363
FIX::SessionState::heartBtInt
void heartBtInt(const HeartBtInt &value)
Definition: SessionState.h:94
Fields.h
SessionState.h
FIX::Session::nextSequenceReset
void nextSequenceReset(const Message &, const UtcTimeStamp &timeStamp)
Definition: Session.cpp:319
FIX::Session::logon
void logon()
Definition: Session.h:55
FIX::Session::isAcceptor
bool isAcceptor()
Definition: Session.h:114
FIX::Session::doPossDup
bool doPossDup(const Message &msg)
Definition: Session.cpp:1065
TimeRange.h
FIX::Session::Sessions
std::map< SessionID, Session *> Sessions
Definition: Session.h:220
FIX::Session::doesSessionExist
static bool doesSessionExist(const SessionID &)
Definition: Session.cpp:1397
Application.h
FIX::Session::isLoggedOn
bool isLoggedOn()
Definition: Session.h:65