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_pLog
Log * m_pLog
Definition SessionState.h:225
FIX::SessionState::m_enabled
bool m_enabled
Definition SessionState.h:208
FIX::SessionState::m_initiate
bool m_initiate
Definition SessionState.h:214
FIX::SessionState::m_sentLogon
bool m_sentLogon
Definition SessionState.h:211
FIX::SessionState::m_sentLogout
bool m_sentLogout
Definition SessionState.h:210
FIX::SessionState::m_logonTimeout
int m_logonTimeout
Definition SessionState.h:215
FIX::SessionState::m_sentReset
bool m_sentReset
Definition SessionState.h:212
FIX::SessionState::m_receivedLogon
bool m_receivedLogon
Definition SessionState.h:209
FIX::SessionState::m_logoutTimeout
int m_logoutTimeout
Definition SessionState.h:216
FIX::SessionState::m_pStore
MessageStore * m_pStore
Definition SessionState.h:224
FIX::SessionState::m_testRequest
int m_testRequest
Definition SessionState.h:217
FIX::SessionState::m_receivedReset
bool m_receivedReset
Definition SessionState.h:213

## Member Function Documentation

## alreadySentLogon()

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

inline

Definition at line 116 of file SessionState.h.

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

References initiate(), and sentLogon().

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

## backup()

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

inline virtual

Implements FIX::Log.

Definition at line 198 of file SessionState.h.

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->backup(); }
FIX::Log::backup
virtual void backup()=0
FIX::SessionState::set
bool set(int s, const std::string &m)
Definition SessionState.h:172
FIX::SessionState::m_mutex
Mutex m_mutex
Definition SessionState.h:227

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

## clear()

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

inline virtual

Implements FIX::Log.

Definition at line 196 of file SessionState.h.

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->clear(); }
FIX::Log::clear
virtual void clear()=0

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

## clearQueue()

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

inline

Definition at line 169 of file SessionState.h.

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

References m_mutex, m_queue, and set().

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

## enabled() [1/2]

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

inline

Definition at line 50 of file SessionState.h.

{ return m_enabled; }

References m_enabled.

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

## enabled() [2/2]

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

inline

Definition at line 51 of file SessionState.h.

{ m_enabled = value; }

References m_enabled.

## 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.

{ Locker l( m_mutex ); m_pStore->get( b, e, m ); }
FIX::MessageStore::get
virtual void get(int, int, std::vector< std::string > &) const =0

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

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

## getCreationTime()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 189 of file SessionState.h.

{ Locker l( m_mutex ); return m_pStore->getCreationTime(); }
FIX::MessageStore::getCreationTime
virtual UtcTimeStamp getCreationTime() const =0

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

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

## getNextSenderMsgSeqNum()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 177 of file SessionState.h.

{ Locker l( m_mutex ); return m_pStore->getNextSenderMsgSeqNum(); }
FIX::MessageStore::getNextSenderMsgSeqNum
virtual int getNextSenderMsgSeqNum() const =0

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

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

## getNextTargetMsgSeqNum()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 179 of file SessionState.h.

{ Locker l( m_mutex ); return m_pStore->getNextTargetMsgSeqNum(); }
FIX::MessageStore::getNextTargetMsgSeqNum
virtual int getNextTargetMsgSeqNum() const =0

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

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

## heartBtInt() [1/3]

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

inline

Definition at line 96 of file SessionState.h.

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

References m_heartBtInt.

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

## heartBtInt() [2/3]

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

inline

Definition at line 98 of file SessionState.h.

{ return m_heartBtInt; }

References m_heartBtInt.

## heartBtInt() [3/3]

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

inline

Definition at line 94 of file SessionState.h.

{ m_heartBtInt = value; }

References m_heartBtInt.

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

## incrNextSenderMsgSeqNum()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 185 of file SessionState.h.

{ Locker l( m_mutex ); m_pStore->incrNextSenderMsgSeqNum(); }
FIX::MessageStore::incrNextSenderMsgSeqNum
virtual void incrNextSenderMsgSeqNum()=0

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

## incrNextTargetMsgSeqNum()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 187 of file SessionState.h.

{ Locker l( m_mutex ); m_pStore->incrNextTargetMsgSeqNum(); }
FIX::MessageStore::incrNextTargetMsgSeqNum
virtual void incrNextTargetMsgSeqNum()=0

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

Referenced by FIX::Session::generateBusinessReject(), FIX::Session::generateReject(), 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().

## initiate() [1/2]

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

inline

Definition at line 68 of file SessionState.h.

{ return m_initiate; }

References m_initiate.

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

## initiate() [2/2]

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

inline

Definition at line 69 of file SessionState.h.

{ m_initiate = value; }

References m_initiate.

## lastReceivedTime() [1/3]

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

inline

Definition at line 110 of file SessionState.h.

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

References m_lastReceivedTime.

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

## lastReceivedTime() [2/3]

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

inline

Definition at line 112 of file SessionState.h.

{ return m_lastReceivedTime; }

References m_lastReceivedTime.

## lastReceivedTime() [3/3]

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

inline

Definition at line 108 of file SessionState.h.

{ m_lastReceivedTime = value; }

References m_lastReceivedTime.

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

## lastSentTime() [1/3]

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

inline

Definition at line 103 of file SessionState.h.

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

References m_lastSentTime.

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

## lastSentTime() [2/3]

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

inline

Definition at line 105 of file SessionState.h.

{ return m_lastSentTime; }

References m_lastSentTime.

## lastSentTime() [3/3]

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

inline

Definition at line 101 of file SessionState.h.

{ m_lastSentTime = value; }

References m_lastSentTime.

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

## log() [1/2]

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

inline

Definition at line 91 of file SessionState.h.

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

References m_nullLog, and m_pLog.

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

## log() [2/2]

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

inline

Definition at line 92 of file SessionState.h.

{ m_pLog = pValue; }

References m_pLog, and set().

## logonTimedOut()

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

inline

Definition at line 117 of file SessionState.h.

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

References lastReceivedTime(), logonTimeout(), and set().

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

## logonTimeout() [1/2]

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

inline

Definition at line 71 of file SessionState.h.

{ return m_logonTimeout; }

References m_logonTimeout.

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

## logonTimeout() [2/2]

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

inline

Definition at line 72 of file SessionState.h.

{ m_logonTimeout = value; }

References m_logonTimeout.

## logoutReason() [1/2]

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

inline

Definition at line 150 of file SessionState.h.

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

References m_logoutReason, m_mutex, and set().

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

## logoutReason() [2/2]

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

inline

Definition at line 152 of file SessionState.h.

{ Locker l( m_mutex ); m_logoutReason = value; }

References m_logoutReason, m_mutex, and set().

## logoutTimedOut()

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

inline

Definition at line 122 of file SessionState.h.

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

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

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

## logoutTimeout() [1/2]

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

inline

Definition at line 74 of file SessionState.h.

{ return m_logoutTimeout; }

References m_logoutTimeout.

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

## logoutTimeout() [2/2]

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

inline

Definition at line 75 of file SessionState.h.

{ m_logoutTimeout = value; }

References m_logoutTimeout.

## needHeartbeat()

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

inline

Definition at line 138 of file SessionState.h.

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

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

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

## needTestRequest()

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

inline

Definition at line 143 of file SessionState.h.

{
UtcTimeStamp now;
return ( now - lastReceivedTime() ) >=
( ( 1.2 * ( ( double ) testRequest() + 1 ) ) * ( double ) heartBtInt() );
}

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

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

## onEvent()

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

inline virtual

Implements FIX::Log.

Definition at line 204 of file SessionState.h.

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->onEvent( string ); }
FIX::Log::onEvent
virtual void onEvent(const std::string &)=0

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

Referenced by FIX::Session::disconnect(), FIX::Session::doTargetTooHigh(), FIX::Session::generateBusinessReject(), FIX::Session::generateReject(), FIX::Session::generateReject(), FIX::Session::generateResendRequest(), FIX::Session::generateSequenceReset(), FIX::Session::next(), FIX::Session::next(), 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().

## onIncoming()

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

inline virtual

Implements FIX::Log.

Definition at line 200 of file SessionState.h.

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->onIncoming( string ); }
FIX::Log::onIncoming
virtual void onIncoming(const std::string &)=0

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

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

## onOutgoing()

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

inline virtual

Implements FIX::Log.

Definition at line 202 of file SessionState.h.

{ if ( !m_pLog ) return ; Locker l( m_mutex ); m_pLog->onOutgoing( string ); }
FIX::Log::onOutgoing
virtual void onOutgoing(const std::string &)=0

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

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

## queue()

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

inline

Definition at line 155 of file SessionState.h.

{ Locker l( m_mutex ); m_queue[ msgSeqNum ] = message; }

References m_mutex, m_queue, and set().

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

## receivedLogon() [1/2]

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

inline

Definition at line 53 of file SessionState.h.

{ return m_receivedLogon; }

References m_receivedLogon.

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

## receivedLogon() [2/2]

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

inline

Definition at line 54 of file SessionState.h.

{ m_receivedLogon = value; }

References m_receivedLogon.

## receivedReset() [1/2]

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

inline

Definition at line 62 of file SessionState.h.

{ return m_receivedReset; }

References m_receivedReset.

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

## receivedReset() [2/2]

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

inline

Definition at line 63 of file SessionState.h.

{ m_receivedReset = value; }

References m_receivedReset.

## refresh()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 193 of file SessionState.h.

{ Locker l( m_mutex ); m_pStore->refresh(); }
FIX::MessageStore::refresh
virtual void refresh()=0

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

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

## resendRange() [1/2]

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

inline

Definition at line 85 of file SessionState.h.

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

References m_resendRange.

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

## resendRange() [2/2]

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

inline

Definition at line 86 of file SessionState.h.

{ m_resendRange = std::make_pair( begin, end ); }

References m_resendRange.

## resendRequested()

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

inline

Definition at line 80 of file SessionState.h.

{ return !(m_resendRange.first == 0 && m_resendRange.second == 0); }

References m_resendRange.

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

## reset()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 191 of file SessionState.h.

{ Locker l( m_mutex ); m_pStore->reset(); }
FIX::MessageStore::reset
virtual void reset()=0

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

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

## retrieve()

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

inline

Definition at line 157 of file SessionState.h.

{
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;
}

References m_mutex, m_queue, and set().

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

## sentLogon() [1/2]

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

inline

Definition at line 59 of file SessionState.h.

{ return m_sentLogon; }

References m_sentLogon.

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

## sentLogon() [2/2]

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

inline

Definition at line 60 of file SessionState.h.

{ m_sentLogon = value; }

References m_sentLogon.

## sentLogout() [1/2]

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

inline

Definition at line 56 of file SessionState.h.

{ return m_sentLogout; }

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().

## sentLogout() [2/2]

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

inline

Definition at line 57 of file SessionState.h.

{ m_sentLogout = value; }

References m_sentLogout.

## sentReset() [1/2]

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

inline

Definition at line 65 of file SessionState.h.

{ return m_sentReset; }

References m_sentReset.

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

## sentReset() [2/2]

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

inline

Definition at line 66 of file SessionState.h.

{ m_sentReset = value; }

References m_sentReset.

## 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.

{ Locker l( m_mutex ); return m_pStore->set( s, m ); }
FIX::MessageStore::set
virtual bool set(int, const std::string &)=0

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

Referenced by backup(), clear(), clearQueue(), get(), getCreationTime(), getNextSenderMsgSeqNum(), getNextTargetMsgSeqNum(), incrNextSenderMsgSeqNum(), incrNextTargetMsgSeqNum(), log(), logonTimedOut(), logoutReason(), logoutReason(), logoutTimedOut(), needHeartbeat(), needTestRequest(), onEvent(), onIncoming(), onOutgoing(), queue(), refresh(), reset(), retrieve(), set(), setNextSenderMsgSeqNum(), setNextTargetMsgSeqNum(), store(), timedOut(), and withinHeartBeat().

## setNextSenderMsgSeqNum()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 181 of file SessionState.h.

{ Locker l( m_mutex ); m_pStore->setNextSenderMsgSeqNum( n ); }
FIX::MessageStore::setNextSenderMsgSeqNum
virtual void setNextSenderMsgSeqNum(int)=0

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

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

## setNextTargetMsgSeqNum()

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

inline virtual

Implements FIX::MessageStore.

Definition at line 183 of file SessionState.h.

{ Locker l( m_mutex ); m_pStore->setNextTargetMsgSeqNum( n ); }
FIX::MessageStore::setNextTargetMsgSeqNum
virtual void setNextTargetMsgSeqNum(int)=0

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

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

## shouldSendLogon()

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

inline

Definition at line 115 of file SessionState.h.

{ return initiate() && !sentLogon(); }

References initiate(), and sentLogon().

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

## store() [1/2]

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

inline

Definition at line 89 of file SessionState.h.

{ return m_pStore; }

References m_pStore.

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

## store() [2/2]

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

inline

Definition at line 90 of file SessionState.h.

{ m_pStore = pValue; }

References m_pStore, and set().

## testRequest() [1/2]

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

inline

Definition at line 77 of file SessionState.h.

{ return m_testRequest; }

References m_testRequest.

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

## testRequest() [2/2]

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

inline

Definition at line 78 of file SessionState.h.

{ m_testRequest = value; }

References m_testRequest.

## timedOut()

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

inline

Definition at line 133 of file SessionState.h.

{
UtcTimeStamp now;
return ( now - lastReceivedTime() ) >= ( 2.4 * ( double ) heartBtInt() );
}

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

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

## withinHeartBeat()

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

inline

Definition at line 127 of file SessionState.h.

{
UtcTimeStamp now;
return ( ( now - lastSentTime() ) < heartBtInt() ) &&
( ( now - lastReceivedTime() ) < heartBtInt() );
}

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

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

## Member Data Documentation

## m_enabled

bool FIX::SessionState::m_enabled

private

Definition at line 208 of file SessionState.h.

Referenced by enabled(), and enabled().

## m_heartBtInt

HeartBtInt FIX::SessionState::m_heartBtInt

private

Definition at line 219 of file SessionState.h.

Referenced by heartBtInt(), heartBtInt(), and heartBtInt().

## m_initiate

bool FIX::SessionState::m_initiate

private

Definition at line 214 of file SessionState.h.

Referenced by initiate(), and initiate().

## m_lastReceivedTime

UtcTimeStamp FIX::SessionState::m_lastReceivedTime

private

Definition at line 221 of file SessionState.h.

Referenced by lastReceivedTime(), lastReceivedTime(), and lastReceivedTime().

## m_lastSentTime

UtcTimeStamp FIX::SessionState::m_lastSentTime

private

Definition at line 220 of file SessionState.h.

Referenced by lastSentTime(), lastSentTime(), and lastSentTime().

## m_logonTimeout

int FIX::SessionState::m_logonTimeout

private

Definition at line 215 of file SessionState.h.

Referenced by logonTimeout(), and logonTimeout().

## m_logoutReason

std::string FIX::SessionState::m_logoutReason

private

Definition at line 222 of file SessionState.h.

Referenced by logoutReason(), and logoutReason().

## m_logoutTimeout

int FIX::SessionState::m_logoutTimeout

private

Definition at line 216 of file SessionState.h.

Referenced by logoutTimeout(), and 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(), 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(), 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(), store(), 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(), and receivedLogon().

## m_receivedReset

bool FIX::SessionState::m_receivedReset

private

Definition at line 213 of file SessionState.h.

Referenced by receivedReset(), and receivedReset().

## m_resendRange

ResendRange FIX::SessionState::m_resendRange

private

Definition at line 218 of file SessionState.h.

Referenced by resendRange(), resendRange(), and resendRequested().

## m_sentLogon

bool FIX::SessionState::m_sentLogon

private

Definition at line 211 of file SessionState.h.

Referenced by sentLogon(), and sentLogon().

## m_sentLogout

bool FIX::SessionState::m_sentLogout

private

Definition at line 210 of file SessionState.h.

Referenced by sentLogout(), and sentLogout().

## m_sentReset

bool FIX::SessionState::m_sentReset

private

Definition at line 212 of file SessionState.h.

Referenced by sentReset(), and sentReset().

## m_testRequest

int FIX::SessionState::m_testRequest

private

Definition at line 217 of file SessionState.h.

Referenced by testRequest(), and testRequest().

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

- SessionState.h