FIX::SessionState Class Reference

Maintains all of state for the Session class. More...

`#include <SessionState.h>`

Inheritance diagram for FIX::SessionState:
[legend]
Collaboration diagram for FIX::SessionState:
[legend]

## Public Types

typedef std::pair< int, int > | ResendRange

## Public Member Functions

| SessionState ()
bool | enabled () const
void | enabled (bool value)
bool | receivedLogon () const
void | receivedLogon (bool value)
bool | sentLogout () const
void | sentLogout (bool value)
bool | sentLogon () const
void | sentLogon (bool value)
bool | receivedReset () const
void | receivedReset (bool value)
bool | sentReset () const
void | sentReset (bool value)
bool | initiate () const
void | initiate (bool value)
int | logonTimeout () const
void | logonTimeout (int value)
int | logoutTimeout () const
void | logoutTimeout (int value)
int | testRequest () const
void | testRequest (int value)
bool | resendRequested () const
ResendRange | resendRange () const
void | resendRange (int begin, int end)
MessageStore * | store ()
void | store (MessageStore *pValue)
Log * | log ()
void | log (Log *pValue)
void | heartBtInt (const HeartBtInt &value)
HeartBtInt & | heartBtInt ()
const HeartBtInt & | heartBtInt () const
void | lastSentTime (const UtcTimeStamp &value)
UtcTimeStamp & | lastSentTime ()
const UtcTimeStamp & | lastSentTime () const
void | lastReceivedTime (const UtcTimeStamp &value)
UtcTimeStamp & | lastReceivedTime ()
const UtcTimeStamp & | lastReceivedTime () const
bool | shouldSendLogon () const
bool | alreadySentLogon () const
bool | logonTimedOut () const
bool | logoutTimedOut () const
bool | withinHeartBeat () const
bool | timedOut () const
bool | needHeartbeat () const
bool | needTestRequest () const
std::string | logoutReason () const
void | logoutReason (const std::string &value)
void | queue (int msgSeqNum, const Message &message)
bool | retrieve (int msgSeqNum, Message &message)
void | clearQueue ()
bool | set (int s, const std::string &m) throw ( IOException )
void | get (int b, int e, std::vector< std::string > &m) const throw ( IOException )
int | getNextSenderMsgSeqNum () const throw ( IOException )
int | getNextTargetMsgSeqNum () const throw ( IOException )
void | setNextSenderMsgSeqNum (int n) throw ( IOException )
void | setNextTargetMsgSeqNum (int n) throw ( IOException )
void | incrNextSenderMsgSeqNum () throw ( IOException )
void | incrNextTargetMsgSeqNum () throw ( IOException )
UtcTimeStamp | getCreationTime () const throw ( IOException )
void | reset () throw ( IOException )
void | refresh () throw ( IOException )
void | clear ()
void | backup ()
void | onIncoming (const std::string &string)
void | onOutgoing (const std::string &string)
void | onEvent (const std::string &string)
Public Member Functions inherited from FIX::MessageStore
virtual | ~MessageStore ()
Public Member Functions inherited from FIX::Log
virtual | ~Log ()

## Private Types

typedef std::map< int, Message > | Messages

## Private Attributes

bool | m_enabled
bool | m_receivedLogon
bool | m_sentLogout
bool | m_sentLogon
bool | m_sentReset
bool | m_receivedReset
bool | m_initiate
int | m_logonTimeout
int | m_logoutTimeout
int | m_testRequest
ResendRange | m_resendRange
HeartBtInt | m_heartBtInt
UtcTimeStamp | m_lastSentTime
UtcTimeStamp | m_lastReceivedTime
std::string | m_logoutReason
Messages | m_queue
MessageStore * | m_pStore
Log * | m_pLog
NullLog | m_nullLog
Mutex | m_mutex

## Detailed Description

Maintains all of state for the Session class.

Definition at line 37 of file SessionState.h.

## Member Typedef Documentation

## Messages

typedef std::map< int, Message > FIX::SessionState::Messages

private

Definition at line 39 of file SessionState.h.

## ResendRange

typedef std::pair<int, int> FIX::SessionState::ResendRange

Definition at line 83 of file SessionState.h.

## Constructor & Destructor Documentation

## SessionState()

FIX::SessionState::SessionState | ( |  | ) |

inline

Definition at line 42 of file SessionState.h.

: m_enabled( true ), m_receivedLogon( false ),
m_sentLogout( false ), m_sentLogon( false ),
m_sentReset( false ), m_receivedReset( false ),
m_initiate( false ), m_logonTimeout( 10 ),
m_logoutTimeout( 2 ), m_testRequest( 0 ),
m_pStore( 0 ), m_pLog( 0 ) {}
FIX::SessionState::m_testRequest
int m_testRequest
Definition: SessionState.h:217
FIX::SessionState::m_pLog
Log * m_pLog
Definition: SessionState.h:225
FIX::SessionState::m_logonTimeout
int m_logonTimeout
Definition: SessionState.h:215
FIX::SessionState::m_receivedReset
bool m_receivedReset
Definition: SessionState.h:213
FIX::SessionState::m_sentLogout
bool m_sentLogout
Definition: SessionState.h:210
FIX::SessionState::m_receivedLogon
bool m_receivedLogon
Definition: SessionState.h:209
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_enabled
bool m_enabled
Definition: SessionState.h:208
FIX::SessionState::m_sentLogon
bool m_sentLogon
Definition: SessionState.h:211
FIX::SessionState::m_sentReset
bool m_sentReset
Definition: SessionState.h:212
FIX::SessionState::m_initiate
bool m_initiate
Definition: SessionState.h:214
FIX::SessionState::m_logoutTimeout
int m_logoutTimeout
Definition: SessionState.h:216

## Member Function Documentation

## alreadySentLogon()

bool FIX::SessionState::alreadySentLogon | ( |  | ) | const

inline

Definition at line 116 of file SessionState.h.

References initiate(), and sentLogon().

Referenced by FIX::Session::next().

{ return initiate() && sentLogon(); }
FIX::SessionState::initiate
bool initiate() const
Definition: SessionState.h:68
FIX::SessionState::sentLogon
bool sentLogon() const
Definition: SessionState.h:59

## backup()

void FIX::SessionState::backup | ( |  | ) |

inline virtual

Implements FIX::Log.

Definition at line 198 of file SessionState.h.

References FIX::Log::backup(), m_mutex, and m_pLog.

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->backup(); }
FIX::SessionState::m_pLog
Log * m_pLog
Definition: SessionState.h:225
FIX::Log::backup
virtual void backup()=0
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## clear()

void FIX::SessionState::clear | ( |  | ) |

inline virtual

Implements FIX::Log.

Definition at line 196 of file SessionState.h.

References FIX::Log::clear(), m_mutex, and m_pLog.

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->clear(); }
FIX::SessionState::m_pLog
Log * m_pLog
Definition: SessionState.h:225
FIX::Log::clear
virtual void clear()=0
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## clearQueue()

void FIX::SessionState::clearQueue | ( |  | ) |

inline

Definition at line 169 of file SessionState.h.

References m_mutex, and m_queue.

Referenced by FIX::Session::disconnect().

{ Locker l( m_mutex ); m_queue.clear(); }
FIX::SessionState::m_queue
Messages m_queue
Definition: SessionState.h:223
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## enabled() [1/2]

bool FIX::SessionState::enabled | ( |  | ) | const

inline

Definition at line 50 of file SessionState.h.

References m_enabled.

Referenced by FIX::Session::isEnabled(), FIX::Session::logon(), and FIX::Session::logout().

{ return m_enabled; }
FIX::SessionState::m_enabled
bool m_enabled
Definition: SessionState.h:208

## enabled() [2/2]

void FIX::SessionState::enabled | ( | bool | value | ) |

inline

Definition at line 51 of file SessionState.h.

References m_enabled.

{ m_enabled = value; }
FIX::SessionState::m_enabled
bool m_enabled
Definition: SessionState.h:208

## get()

void FIX::SessionState::get | ( | int | b,
|  | int | e,
|  | std::vector< std::string > & | m
| ) |  | const
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 174 of file SessionState.h.

References FIX::MessageStore::get(), m_mutex, and m_pStore.

Referenced by FIX::Session::nextResendRequest().

{ Locker l( m_mutex ); m_pStore->get( b, e, m ); }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::MessageStore::get
virtual void get(int, int, std::vector< std::string > &) const =0
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## getCreationTime()

UtcTimeStamp FIX::SessionState::getCreationTime | ( |  | ) | const
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 189 of file SessionState.h.

References FIX::MessageStore::getCreationTime(), m_mutex, and m_pStore.

Referenced by FIX::Session::checkSessionTime().

{ Locker l( m_mutex ); return m_pStore->getCreationTime(); }
FIX::MessageStore::getCreationTime
virtual UtcTimeStamp getCreationTime() const =0
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## getNextSenderMsgSeqNum()

int FIX::SessionState::getNextSenderMsgSeqNum | ( |  | ) | const
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 177 of file SessionState.h.

References FIX::MessageStore::getNextSenderMsgSeqNum(), m_mutex, and m_pStore.

Referenced by FIX::Session::getExpectedSenderNum(), and FIX::Session::nextResendRequest().

{ Locker l( m_mutex ); return m_pStore->getNextSenderMsgSeqNum(); }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::MessageStore::getNextSenderMsgSeqNum
virtual int getNextSenderMsgSeqNum() const =0
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## getNextTargetMsgSeqNum()

int FIX::SessionState::getNextTargetMsgSeqNum | ( |  | ) | const
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 179 of file SessionState.h.

References FIX::MessageStore::getNextTargetMsgSeqNum(), m_mutex, and m_pStore.

Referenced by FIX::Session::getExpectedTargetNum(), FIX::Session::isTargetTooHigh(), and FIX::Session::isTargetTooLow().

{ Locker l( m_mutex ); return m_pStore->getNextTargetMsgSeqNum(); }
FIX::MessageStore::getNextTargetMsgSeqNum
virtual int getNextTargetMsgSeqNum() const =0
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## heartBtInt() [1/3]

void FIX::SessionState::heartBtInt | ( | const HeartBtInt & | value | ) |

inline

Definition at line 94 of file SessionState.h.

References m_heartBtInt.

Referenced by FIX::Session::generateLogon(), FIX::Session::getHeartBtInt(), FIX::Session::next(), FIX::Session::nextLogon(), and FIX::Session::Session().

{ m_heartBtInt = value; }
FIX::SessionState::m_heartBtInt
HeartBtInt m_heartBtInt
Definition: SessionState.h:219

## heartBtInt() [2/3]

HeartBtInt& FIX::SessionState::heartBtInt | ( |  | ) |

inline

Definition at line 96 of file SessionState.h.

References m_heartBtInt.

Referenced by needHeartbeat(), needTestRequest(), timedOut(), and withinHeartBeat().

{ return m_heartBtInt; }
FIX::SessionState::m_heartBtInt
HeartBtInt m_heartBtInt
Definition: SessionState.h:219

## heartBtInt() [3/3]

const HeartBtInt& FIX::SessionState::heartBtInt | ( |  | ) | const

inline

Definition at line 98 of file SessionState.h.

References m_heartBtInt.

{ return m_heartBtInt; }
FIX::SessionState::m_heartBtInt
HeartBtInt m_heartBtInt
Definition: SessionState.h:219

## incrNextSenderMsgSeqNum()

void FIX::SessionState::incrNextSenderMsgSeqNum | ( |  | ) |
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 185 of file SessionState.h.

References FIX::MessageStore::incrNextSenderMsgSeqNum(), m_mutex, and m_pStore.

Referenced by FIX::Session::persist().

{ Locker l( m_mutex ); m_pStore->incrNextSenderMsgSeqNum(); }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227
FIX::MessageStore::incrNextSenderMsgSeqNum
virtual void incrNextSenderMsgSeqNum()=0

## incrNextTargetMsgSeqNum()

void FIX::SessionState::incrNextTargetMsgSeqNum | ( |  | ) |
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 187 of file SessionState.h.

References FIX::MessageStore::incrNextTargetMsgSeqNum(), m_mutex, and m_pStore.

Referenced by FIX::Session::generateBusinessReject(), FIX::Session::generateReject(), FIX::Session::next(), FIX::Session::nextHeartbeat(), FIX::Session::nextLogon(), FIX::Session::nextLogout(), FIX::Session::nextQueued(), FIX::Session::nextReject(), FIX::Session::nextResendRequest(), and FIX::Session::nextTestRequest().

{ Locker l( m_mutex ); m_pStore->incrNextTargetMsgSeqNum(); }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::MessageStore::incrNextTargetMsgSeqNum
virtual void incrNextTargetMsgSeqNum()=0
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## initiate() [1/2]

bool FIX::SessionState::initiate | ( |  | ) | const

inline

Definition at line 68 of file SessionState.h.

References m_initiate.

Referenced by alreadySentLogon(), FIX::Session::isAcceptor(), FIX::Session::isInitiator(), FIX::Session::nextLogon(), FIX::Session::Session(), and shouldSendLogon().

{ return m_initiate; }
FIX::SessionState::m_initiate
bool m_initiate
Definition: SessionState.h:214

## initiate() [2/2]

void FIX::SessionState::initiate | ( | bool | value | ) |

inline

Definition at line 69 of file SessionState.h.

References m_initiate.

{ m_initiate = value; }
FIX::SessionState::m_initiate
bool m_initiate
Definition: SessionState.h:214

## lastReceivedTime() [1/3]

void FIX::SessionState::lastReceivedTime | ( | const UtcTimeStamp & | value | ) |

inline

Definition at line 108 of file SessionState.h.

References m_lastReceivedTime.

Referenced by FIX::Session::generateLogon(), and FIX::Session::verify().

{ m_lastReceivedTime = value; }
FIX::SessionState::m_lastReceivedTime
UtcTimeStamp m_lastReceivedTime
Definition: SessionState.h:221

## lastReceivedTime() [2/3]

UtcTimeStamp& FIX::SessionState::lastReceivedTime | ( |  | ) |

inline

Definition at line 110 of file SessionState.h.

References m_lastReceivedTime.

Referenced by logonTimedOut(), needTestRequest(), timedOut(), and withinHeartBeat().

{ return m_lastReceivedTime; }
FIX::SessionState::m_lastReceivedTime
UtcTimeStamp m_lastReceivedTime
Definition: SessionState.h:221

## lastReceivedTime() [3/3]

const UtcTimeStamp& FIX::SessionState::lastReceivedTime | ( |  | ) | const

inline

Definition at line 112 of file SessionState.h.

References m_lastReceivedTime.

{ return m_lastReceivedTime; }
FIX::SessionState::m_lastReceivedTime
UtcTimeStamp m_lastReceivedTime
Definition: SessionState.h:221

## lastSentTime() [1/3]

void FIX::SessionState::lastSentTime | ( | const UtcTimeStamp & | value | ) |

inline

Definition at line 101 of file SessionState.h.

References m_lastSentTime.

Referenced by FIX::Session::fill().

{ m_lastSentTime = value; }
FIX::SessionState::m_lastSentTime
UtcTimeStamp m_lastSentTime
Definition: SessionState.h:220

## lastSentTime() [2/3]

UtcTimeStamp& FIX::SessionState::lastSentTime | ( |  | ) |

inline

Definition at line 103 of file SessionState.h.

References m_lastSentTime.

Referenced by logoutTimedOut(), needHeartbeat(), and withinHeartBeat().

{ return m_lastSentTime; }
FIX::SessionState::m_lastSentTime
UtcTimeStamp m_lastSentTime
Definition: SessionState.h:220

## lastSentTime() [3/3]

const UtcTimeStamp& FIX::SessionState::lastSentTime | ( |  | ) | const

inline

Definition at line 105 of file SessionState.h.

References m_lastSentTime.

{ return m_lastSentTime; }
FIX::SessionState::m_lastSentTime
UtcTimeStamp m_lastSentTime
Definition: SessionState.h:220

## log() [1/2]

Log* FIX::SessionState::log | ( |  | ) |

inline

Definition at line 91 of file SessionState.h.

References m_nullLog, and m_pLog.

Referenced by FIX::Session::Session(), and FIX::Session::~Session().

{ return m_pLog ? m_pLog : &m_nullLog; }
FIX::SessionState::m_nullLog
NullLog m_nullLog
Definition: SessionState.h:226
FIX::SessionState::m_pLog
Log * m_pLog
Definition: SessionState.h:225

## log() [2/2]

void FIX::SessionState::log | ( | Log * | pValue | ) |

inline

Definition at line 92 of file SessionState.h.

References m_pLog.

{ m_pLog = pValue; }
FIX::SessionState::m_pLog
Log * m_pLog
Definition: SessionState.h:225

## logonTimedOut()

bool FIX::SessionState::logonTimedOut | ( |  | ) | const

inline

Definition at line 117 of file SessionState.h.

References lastReceivedTime(), and logonTimeout().

Referenced by FIX::Session::next().

{
UtcTimeStamp now;
return now - lastReceivedTime() >= logonTimeout();
}
FIX::SessionState::logonTimeout
int logonTimeout() const
Definition: SessionState.h:71
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:674
FIX::SessionState::lastReceivedTime
UtcTimeStamp & lastReceivedTime()
Definition: SessionState.h:110

## logonTimeout() [1/2]

int FIX::SessionState::logonTimeout | ( |  | ) | const

inline

Definition at line 71 of file SessionState.h.

References m_logonTimeout.

Referenced by FIX::Session::getLogonTimeout(), logonTimedOut(), and FIX::Session::setLogonTimeout().

{ return m_logonTimeout; }
FIX::SessionState::m_logonTimeout
int m_logonTimeout
Definition: SessionState.h:215

## logonTimeout() [2/2]

void FIX::SessionState::logonTimeout | ( | int | value | ) |

inline

Definition at line 72 of file SessionState.h.

References m_logonTimeout.

{ m_logonTimeout = value; }
FIX::SessionState::m_logonTimeout
int m_logonTimeout
Definition: SessionState.h:215

## logoutReason() [1/2]

std::string FIX::SessionState::logoutReason | ( |  | ) | const

inline

Definition at line 150 of file SessionState.h.

References m_logoutReason, and m_mutex.

Referenced by FIX::Session::disconnect(), FIX::Session::logon(), FIX::Session::logout(), and FIX::Session::next().

{ Locker l( m_mutex ); return m_logoutReason; }
FIX::SessionState::m_logoutReason
std::string m_logoutReason
Definition: SessionState.h:222
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## logoutReason() [2/2]

void FIX::SessionState::logoutReason | ( | const std::string & | value | ) |

inline

Definition at line 152 of file SessionState.h.

References m_logoutReason, and m_mutex.

{ Locker l( m_mutex ); m_logoutReason = value; }
FIX::SessionState::m_logoutReason
std::string m_logoutReason
Definition: SessionState.h:222
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## logoutTimedOut()

bool FIX::SessionState::logoutTimedOut | ( |  | ) | const

inline

Definition at line 122 of file SessionState.h.

References lastSentTime(), logoutTimeout(), and sentLogout().

Referenced by FIX::Session::next().

{
UtcTimeStamp now;
return sentLogout() && ( ( now - lastSentTime() ) >= logoutTimeout() );
}
FIX::SessionState::logoutTimeout
int logoutTimeout() const
Definition: SessionState.h:74
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:674
FIX::SessionState::sentLogout
bool sentLogout() const
Definition: SessionState.h:56
FIX::SessionState::lastSentTime
UtcTimeStamp & lastSentTime()
Definition: SessionState.h:103

## logoutTimeout() [1/2]

int FIX::SessionState::logoutTimeout | ( |  | ) | const

inline

Definition at line 74 of file SessionState.h.

References m_logoutTimeout.

Referenced by FIX::Session::getLogoutTimeout(), logoutTimedOut(), and FIX::Session::setLogoutTimeout().

{ return m_logoutTimeout; }
FIX::SessionState::m_logoutTimeout
int m_logoutTimeout
Definition: SessionState.h:216

## logoutTimeout() [2/2]

void FIX::SessionState::logoutTimeout | ( | int | value | ) |

inline

Definition at line 75 of file SessionState.h.

References m_logoutTimeout.

{ m_logoutTimeout = value; }
FIX::SessionState::m_logoutTimeout
int m_logoutTimeout
Definition: SessionState.h:216

## needHeartbeat()

bool FIX::SessionState::needHeartbeat | ( |  | ) | const

inline

Definition at line 138 of file SessionState.h.

References heartBtInt(), lastSentTime(), and testRequest().

Referenced by FIX::Session::next().

{
UtcTimeStamp now;
return ( ( now - lastSentTime() ) >= heartBtInt() ) && !testRequest();
}
FIX::SessionState::testRequest
int testRequest() const
Definition: SessionState.h:77
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:674
FIX::SessionState::heartBtInt
HeartBtInt & heartBtInt()
Definition: SessionState.h:96
FIX::SessionState::lastSentTime
UtcTimeStamp & lastSentTime()
Definition: SessionState.h:103

## needTestRequest()

bool FIX::SessionState::needTestRequest | ( |  | ) | const

inline

Definition at line 143 of file SessionState.h.

References heartBtInt(), lastReceivedTime(), and testRequest().

Referenced by FIX::Session::next().

{
UtcTimeStamp now;
return ( now - lastReceivedTime() ) >=
( ( 1.2 * ( ( double ) testRequest() + 1 ) ) * ( double ) heartBtInt() );
}
FIX::SessionState::testRequest
int testRequest() const
Definition: SessionState.h:77
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:674
FIX::SessionState::heartBtInt
HeartBtInt & heartBtInt()
Definition: SessionState.h:96
FIX::SessionState::lastReceivedTime
UtcTimeStamp & lastReceivedTime()
Definition: SessionState.h:110

## onEvent()

void FIX::SessionState::onEvent | ( | const std::string & | string | ) |

inline virtual

Implements FIX::Log.

Definition at line 204 of file SessionState.h.

References m_mutex, m_pLog, and FIX::Log::onEvent().

Referenced by FIX::Session::disconnect(), FIX::Session::doTargetTooHigh(), FIX::Session::generateBusinessReject(), FIX::Session::generateReject(), FIX::Session::generateResendRequest(), FIX::Session::generateSequenceReset(), FIX::Session::next(), FIX::Session::nextLogon(), FIX::Session::nextLogout(), FIX::Session::nextQueued(), FIX::Session::nextResendRequest(), FIX::Session::nextSequenceReset(), FIX::Session::sendRaw(), FIX::Session::Session(), and FIX::Session::verify().

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->onEvent( string ); }
FIX::SessionState::m_pLog
Log * m_pLog
Definition: SessionState.h:225
FIX::Log::onEvent
virtual void onEvent(const std::string &)=0
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## onIncoming()

void FIX::SessionState::onIncoming | ( | const std::string & | string | ) |

inline virtual

Implements FIX::Log.

Definition at line 200 of file SessionState.h.

References m_mutex, m_pLog, and FIX::Log::onIncoming().

Referenced by FIX::Session::next().

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->onIncoming( string ); }
FIX::SessionState::m_pLog
Log * m_pLog
Definition: SessionState.h:225
FIX::Log::onIncoming
virtual void onIncoming(const std::string &)=0
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## onOutgoing()

void FIX::SessionState::onOutgoing | ( | const std::string & | string | ) |

inline virtual

Implements FIX::Log.

Definition at line 202 of file SessionState.h.

References m_mutex, m_pLog, and FIX::Log::onOutgoing().

Referenced by FIX::Session::send().

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->onOutgoing( string ); }
FIX::Log::onOutgoing
virtual void onOutgoing(const std::string &)=0
FIX::SessionState::m_pLog
Log * m_pLog
Definition: SessionState.h:225
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## queue()

void FIX::SessionState::queue | ( | int | msgSeqNum,
|  | const Message & | message
| ) |  |

inline

Definition at line 155 of file SessionState.h.

References m_mutex, and m_queue.

Referenced by FIX::Session::doTargetTooHigh().

{ Locker l( m_mutex ); m_queue[ msgSeqNum ] = message; }
FIX::SessionState::m_queue
Messages m_queue
Definition: SessionState.h:223
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## receivedLogon() [1/2]

bool FIX::SessionState::receivedLogon | ( |  | ) | const

inline

Definition at line 53 of file SessionState.h.

References m_receivedLogon.

Referenced by FIX::Session::disconnect(), FIX::Session::generateReject(), FIX::Session::next(), FIX::Session::nextLogon(), FIX::Session::receivedLogon(), and FIX::Session::validLogonState().

{ return m_receivedLogon; }
FIX::SessionState::m_receivedLogon
bool m_receivedLogon
Definition: SessionState.h:209

## receivedLogon() [2/2]

void FIX::SessionState::receivedLogon | ( | bool | value | ) |

inline

Definition at line 54 of file SessionState.h.

References m_receivedLogon.

{ m_receivedLogon = value; }
FIX::SessionState::m_receivedLogon
bool m_receivedLogon
Definition: SessionState.h:209

## receivedReset() [1/2]

bool FIX::SessionState::receivedReset | ( |  | ) | const

inline

Definition at line 62 of file SessionState.h.

References m_receivedReset.

Referenced by FIX::Session::disconnect(), FIX::Session::generateLogon(), FIX::Session::nextLogon(), FIX::Session::sendRaw(), and FIX::Session::validLogonState().

{ return m_receivedReset; }
FIX::SessionState::m_receivedReset
bool m_receivedReset
Definition: SessionState.h:213

## receivedReset() [2/2]

void FIX::SessionState::receivedReset | ( | bool | value | ) |

inline

Definition at line 63 of file SessionState.h.

References m_receivedReset.

{ m_receivedReset = value; }
FIX::SessionState::m_receivedReset
bool m_receivedReset
Definition: SessionState.h:213

## refresh()

void FIX::SessionState::refresh | ( |  | ) |
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 193 of file SessionState.h.

References m_mutex, m_pStore, and FIX::MessageStore::refresh().

Referenced by FIX::Session::refresh().

{ Locker l( m_mutex ); m_pStore->refresh(); }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227
FIX::MessageStore::refresh
virtual void refresh()=0

## resendRange() [1/2]

ResendRange FIX::SessionState::resendRange | ( |  | ) | const

inline

Definition at line 85 of file SessionState.h.

References m_resendRange.

Referenced by FIX::Session::disconnect(), FIX::Session::doTargetTooHigh(), FIX::Session::generateResendRequest(), and FIX::Session::verify().

{ return m_resendRange; }
FIX::SessionState::m_resendRange
ResendRange m_resendRange
Definition: SessionState.h:218

## resendRange() [2/2]

void FIX::SessionState::resendRange | ( | int | begin,
|  | int | end
| ) |  |

inline

Definition at line 86 of file SessionState.h.

References m_resendRange.

{ m_resendRange = std::make_pair( begin, end ); }
FIX::SessionState::m_resendRange
ResendRange m_resendRange
Definition: SessionState.h:218

## resendRequested()

bool FIX::SessionState::resendRequested | ( |  | ) | const

inline

Definition at line 80 of file SessionState.h.

References m_resendRange.

Referenced by FIX::Session::doTargetTooHigh(), and FIX::Session::verify().

{ return !(m_resendRange.first == 0 && m_resendRange.second == 0); }
FIX::SessionState::m_resendRange
ResendRange m_resendRange
Definition: SessionState.h:218

## reset()

void FIX::SessionState::reset | ( |  | ) |
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 191 of file SessionState.h.

References m_mutex, m_pStore, and FIX::MessageStore::reset().

Referenced by FIX::Session::disconnect(), FIX::Session::generateLogon(), FIX::Session::nextLogon(), FIX::Session::nextLogout(), FIX::Session::reset(), and FIX::Session::sendRaw().

{ Locker l( m_mutex ); m_pStore->reset(); }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227
FIX::MessageStore::reset
virtual void reset()=0

## retrieve()

bool FIX::SessionState::retrieve | ( | int | msgSeqNum,
|  | Message & | message
| ) |  |

inline

Definition at line 157 of file SessionState.h.

References m_mutex, and m_queue.

Referenced by FIX::Session::nextQueued().

{
Locker l( m_mutex );
Messages::iterator i = m_queue.find( msgSeqNum );
if ( i != m_queue.end() )
{
message = i->second;
m_queue.erase( i );
return true;
}
return false;
}
FIX::SessionState::m_queue
Messages m_queue
Definition: SessionState.h:223
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## sentLogon() [1/2]

bool FIX::SessionState::sentLogon | ( |  | ) | const

inline

Definition at line 59 of file SessionState.h.

References m_sentLogon.

Referenced by alreadySentLogon(), FIX::Session::disconnect(), FIX::Session::generateLogon(), FIX::Session::sentLogon(), shouldSendLogon(), and FIX::Session::validLogonState().

{ return m_sentLogon; }
FIX::SessionState::m_sentLogon
bool m_sentLogon
Definition: SessionState.h:211

## sentLogon() [2/2]

void FIX::SessionState::sentLogon | ( | bool | value | ) |

inline

Definition at line 60 of file SessionState.h.

References m_sentLogon.

{ m_sentLogon = value; }
FIX::SessionState::m_sentLogon
bool m_sentLogon
Definition: SessionState.h:211

## sentLogout() [1/2]

bool FIX::SessionState::sentLogout | ( |  | ) | const

inline

Definition at line 56 of file SessionState.h.

References m_sentLogout.

Referenced by FIX::Session::disconnect(), FIX::Session::generateLogout(), logoutTimedOut(), FIX::Session::next(), FIX::Session::nextLogout(), FIX::Session::sentLogout(), and FIX::Session::validLogonState().

{ return m_sentLogout; }
FIX::SessionState::m_sentLogout
bool m_sentLogout
Definition: SessionState.h:210

## sentLogout() [2/2]

void FIX::SessionState::sentLogout | ( | bool | value | ) |

inline

Definition at line 57 of file SessionState.h.

References m_sentLogout.

{ m_sentLogout = value; }
FIX::SessionState::m_sentLogout
bool m_sentLogout
Definition: SessionState.h:210

## sentReset() [1/2]

bool FIX::SessionState::sentReset | ( |  | ) | const

inline

Definition at line 65 of file SessionState.h.

References m_sentReset.

Referenced by FIX::Session::disconnect(), FIX::Session::nextLogon(), FIX::Session::sendRaw(), and FIX::Session::validLogonState().

{ return m_sentReset; }
FIX::SessionState::m_sentReset
bool m_sentReset
Definition: SessionState.h:212

## sentReset() [2/2]

void FIX::SessionState::sentReset | ( | bool | value | ) |

inline

Definition at line 66 of file SessionState.h.

References m_sentReset.

{ m_sentReset = value; }
FIX::SessionState::m_sentReset
bool m_sentReset
Definition: SessionState.h:212

## set()

bool FIX::SessionState::set | ( | int | s,
|  | const std::string & | m
| ) |  |
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 172 of file SessionState.h.

References m_mutex, m_pStore, and FIX::MessageStore::set().

Referenced by FIX::Session::persist().

{ Locker l( m_mutex ); return m_pStore->set( s, m ); }
FIX::MessageStore::set
virtual bool set(int, const std::string &)=0
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## setNextSenderMsgSeqNum()

void FIX::SessionState::setNextSenderMsgSeqNum | ( | int | n | ) |
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 181 of file SessionState.h.

References m_mutex, m_pStore, and FIX::MessageStore::setNextSenderMsgSeqNum().

Referenced by FIX::Session::setNextSenderMsgSeqNum().

{ Locker l( m_mutex ); m_pStore->setNextSenderMsgSeqNum( n ); }
FIX::MessageStore::setNextSenderMsgSeqNum
virtual void setNextSenderMsgSeqNum(int)=0
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227

## setNextTargetMsgSeqNum()

void FIX::SessionState::setNextTargetMsgSeqNum | ( | int | n | ) |
throw | ( | IOException
| ) |  |

inline virtual

Implements FIX::MessageStore.

Definition at line 183 of file SessionState.h.

References m_mutex, m_pStore, and FIX::MessageStore::setNextTargetMsgSeqNum().

Referenced by FIX::Session::nextSequenceReset(), and FIX::Session::setNextTargetMsgSeqNum().

{ Locker l( m_mutex ); m_pStore->setNextTargetMsgSeqNum( n ); }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224
FIX::SessionState::m_mutex
Mutex m_mutex
Definition: SessionState.h:227
FIX::MessageStore::setNextTargetMsgSeqNum
virtual void setNextTargetMsgSeqNum(int)=0

## shouldSendLogon()

bool FIX::SessionState::shouldSendLogon | ( |  | ) | const

inline

Definition at line 115 of file SessionState.h.

References initiate(), and sentLogon().

Referenced by FIX::Session::next(), and FIX::Session::nextLogon().

{ return initiate() && !sentLogon(); }
FIX::SessionState::initiate
bool initiate() const
Definition: SessionState.h:68
FIX::SessionState::sentLogon
bool sentLogon() const
Definition: SessionState.h:59

## store() [1/2]

MessageStore* FIX::SessionState::store | ( |  | ) |

inline

Definition at line 89 of file SessionState.h.

References m_pStore.

Referenced by FIX::Session::Session(), and FIX::Session::~Session().

{ return m_pStore; }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224

## store() [2/2]

void FIX::SessionState::store | ( | MessageStore * | pValue | ) |

inline

Definition at line 90 of file SessionState.h.

References m_pStore.

{ m_pStore = pValue; }
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition: SessionState.h:224

## testRequest() [1/2]

int FIX::SessionState::testRequest | ( |  | ) | const

inline

Definition at line 77 of file SessionState.h.

References m_testRequest.

Referenced by FIX::Session::generateLogon(), needHeartbeat(), needTestRequest(), FIX::Session::next(), and FIX::Session::verify().

{ return m_testRequest; }
FIX::SessionState::m_testRequest
int m_testRequest
Definition: SessionState.h:217

## testRequest() [2/2]

void FIX::SessionState::testRequest | ( | int | value | ) |

inline

Definition at line 78 of file SessionState.h.

References m_testRequest.

{ m_testRequest = value; }
FIX::SessionState::m_testRequest
int m_testRequest
Definition: SessionState.h:217

## timedOut()

bool FIX::SessionState::timedOut | ( |  | ) | const

inline

Definition at line 133 of file SessionState.h.

References heartBtInt(), and lastReceivedTime().

Referenced by FIX::Session::next().

{
UtcTimeStamp now;
return ( now - lastReceivedTime() ) >= ( 2.4 * ( double ) heartBtInt() );
}
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:674
FIX::SessionState::heartBtInt
HeartBtInt & heartBtInt()
Definition: SessionState.h:96
FIX::SessionState::lastReceivedTime
UtcTimeStamp & lastReceivedTime()
Definition: SessionState.h:110

## withinHeartBeat()

bool FIX::SessionState::withinHeartBeat | ( |  | ) | const

inline

Definition at line 127 of file SessionState.h.

References heartBtInt(), lastReceivedTime(), and lastSentTime().

Referenced by FIX::Session::next().

{
UtcTimeStamp now;
return ( ( now - lastSentTime() ) < heartBtInt() ) &&
( ( now - lastReceivedTime() ) < heartBtInt() );
}
FIX::TYPE::UtcTimeStamp
Definition: FieldTypes.h:674
FIX::SessionState::heartBtInt
HeartBtInt & heartBtInt()
Definition: SessionState.h:96
FIX::SessionState::lastReceivedTime
UtcTimeStamp & lastReceivedTime()
Definition: SessionState.h:110
FIX::SessionState::lastSentTime
UtcTimeStamp & lastSentTime()
Definition: SessionState.h:103

## Member Data Documentation

## m_enabled

bool FIX::SessionState::m_enabled

private

Definition at line 208 of file SessionState.h.

Referenced by enabled().

## m_heartBtInt

HeartBtInt FIX::SessionState::m_heartBtInt

private

Definition at line 219 of file SessionState.h.

Referenced by heartBtInt().

## m_initiate

bool FIX::SessionState::m_initiate

private

Definition at line 214 of file SessionState.h.

Referenced by initiate().

## m_lastReceivedTime

UtcTimeStamp FIX::SessionState::m_lastReceivedTime

private

Definition at line 221 of file SessionState.h.

Referenced by lastReceivedTime().

## m_lastSentTime

UtcTimeStamp FIX::SessionState::m_lastSentTime

private

Definition at line 220 of file SessionState.h.

Referenced by lastSentTime().

## m_logonTimeout

int FIX::SessionState::m_logonTimeout

private

Definition at line 215 of file SessionState.h.

Referenced by logonTimeout().

## m_logoutReason

std::string FIX::SessionState::m_logoutReason

private

Definition at line 222 of file SessionState.h.

Referenced by logoutReason().

## m_logoutTimeout

int FIX::SessionState::m_logoutTimeout

private

Definition at line 216 of file SessionState.h.

Referenced by logoutTimeout().

## m_mutex

Mutex FIX::SessionState::m_mutex

mutable private

Definition at line 227 of file SessionState.h.

Referenced by backup(), clear(), clearQueue(), get(), getCreationTime(), getNextSenderMsgSeqNum(), getNextTargetMsgSeqNum(), incrNextSenderMsgSeqNum(), incrNextTargetMsgSeqNum(), logoutReason(), onEvent(), onIncoming(), onOutgoing(), queue(), refresh(), reset(), retrieve(), set(), setNextSenderMsgSeqNum(), and setNextTargetMsgSeqNum().

## m_nullLog

NullLog FIX::SessionState::m_nullLog

private

Definition at line 226 of file SessionState.h.

Referenced by log().

## m_pLog

Log* FIX::SessionState::m_pLog

private

Definition at line 225 of file SessionState.h.

Referenced by backup(), clear(), log(), onEvent(), onIncoming(), and onOutgoing().

## m_pStore

MessageStore* FIX::SessionState::m_pStore

private

Definition at line 224 of file SessionState.h.

Referenced by get(), getCreationTime(), getNextSenderMsgSeqNum(), getNextTargetMsgSeqNum(), incrNextSenderMsgSeqNum(), incrNextTargetMsgSeqNum(), refresh(), reset(), set(), setNextSenderMsgSeqNum(), setNextTargetMsgSeqNum(), and store().

## m_queue

Messages FIX::SessionState::m_queue

private

Definition at line 223 of file SessionState.h.

Referenced by clearQueue(), queue(), and retrieve().

## m_receivedLogon

bool FIX::SessionState::m_receivedLogon

private

Definition at line 209 of file SessionState.h.

Referenced by receivedLogon().

## m_receivedReset

bool FIX::SessionState::m_receivedReset

private

Definition at line 213 of file SessionState.h.

Referenced by receivedReset().

## m_resendRange

ResendRange FIX::SessionState::m_resendRange

private

Definition at line 218 of file SessionState.h.

Referenced by resendRange(), and resendRequested().

## m_sentLogon

bool FIX::SessionState::m_sentLogon

private

Definition at line 211 of file SessionState.h.

Referenced by sentLogon().

## m_sentLogout

bool FIX::SessionState::m_sentLogout

private

Definition at line 210 of file SessionState.h.

Referenced by sentLogout().

## m_sentReset

bool FIX::SessionState::m_sentReset

private

Definition at line 212 of file SessionState.h.

Referenced by sentReset().

## m_testRequest

int FIX::SessionState::m_testRequest

private

Definition at line 217 of file SessionState.h.

Referenced by testRequest().

The documentation for this class was generated from the following file:

- SessionState.h