QuickFIX: FIX::SessionID Class Reference

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

# FIX::SessionID Class Reference

Unique session id consists of BeginString, SenderCompID and TargetCompID. More...

`#include <SessionID.h>`

List of all members.

## Public Member Functions
| SessionID ()
| SessionID (const std::string &beginString, const std::string &senderCompID, const std::string &targetCompID, const std::string &sessionQualifier="")
const BeginString & | getBeginString () const
const SenderCompID & | getSenderCompID () const
const TargetCompID & | getTargetCompID () const
const std::string & | getSessionQualifier () const
const bool | isFIXT () const
std::string | toString () const
| Get a string representation of the SessionID.
const std::string & | toStringFrozen () const
void | fromString (const std::string &str)
| Build from string representation of SessionID.
std::string & | toString (std::string &str) const
| Get a string representation without making a copy.
SessionID | operator~ () const
## Private Attributes
BeginString | m_beginString
SenderCompID | m_senderCompID
TargetCompID | m_targetCompID
std::string | m_sessionQualifier
bool | m_isFIXT
std::string | m_frozenString
## Friends
bool | operator< (const SessionID &, const SessionID &)
bool | operator== (const SessionID &, const SessionID &)
bool | operator!= (const SessionID &, const SessionID &)
std::ostream & | operator<< (std::ostream &, const SessionID &)
std::ostream & | operator>> (std::ostream &, const SessionID &)

## Detailed Description

Unique session id consists of BeginString, SenderCompID and TargetCompID.

Definition at line 30 of file SessionID.h.

## Constructor & Destructor Documentation

FIX::SessionID::SessionID | ( |  | ) | `[inline]`

Definition at line 33 of file SessionID.h.

References m_frozenString, and toString().

Referenced by operator~().

    00034   {
    00035         toString(m_frozenString);
    00036   }

FIX::SessionID::SessionID | ( | const std::string & | beginString,
|  | const std::string & | senderCompID,
|  | const std::string & | targetCompID,
|  | const std::string & | sessionQualifier = `""` |
| ) |  |  | `[inline]`

Definition at line 38 of file SessionID.h.

References m_frozenString, m_isFIXT, and toString().

    00042   : m_beginString( BeginString(beginString) ),
    00043     m_senderCompID( SenderCompID(senderCompID) ),
    00044     m_targetCompID( TargetCompID(targetCompID) ),
    00045     m_sessionQualifier( sessionQualifier ),
    00046           m_isFIXT(false)
    00047   {
    00048     toString(m_frozenString);
    00049                 if( beginString.substr(0, 4) == "FIXT" )
    00050                         m_isFIXT = true;
    00051   }

## Member Function Documentation

void FIX::SessionID::fromString | ( | const std::string & | str | ) | `[inline]`

Build from string representation of SessionID.

Definition at line 77 of file SessionID.h.

References m_beginString, m_frozenString, m_senderCompID, m_sessionQualifier, m_targetCompID, and toString().

    00078   {
    00079     std::string::size_type first =
    00080       str.find_first_of(':');
    00081     std::string::size_type second =
    00082       str.find("->");
    00083     std::string::size_type third =
    00084       str.find_last_of(':');
    00085     if( first == std::string::npos )
    00086       return;
    00087     if( second == std::string::npos )
    00088       return;
    00089     m_beginString = str.substr(0, first);
    00090     m_senderCompID = str.substr(first+1, second - first - 1);
    00091     if( first == third )
    00092     {
    00093       m_targetCompID = str.substr(second+2);
    00094       m_sessionQualifier = "";
    00095     }
    00096     else
    00097     {
    00098       m_targetCompID = str.substr(second+2, third - second - 2);
    00099       m_sessionQualifier = str.substr(third+1);
    00100     }
    00101     toString(m_frozenString);
    00102   }

const BeginString& FIX::SessionID::getBeginString | ( |  | ) | const`[inline]`

Definition at line 53 of file SessionID.h.

References m_beginString.

Referenced by FIX::FileStore::FileStore(), FIX::Session::fill(), FIX::FileLog::generatePrefix(), FIX::Session::generateReject(), FIX::Session::insertOrigSendingTime(), FIX::Session::insertSendingTime(), FIX::Session::next(), FIX::Session::nextResendRequest(), FIX::Session::populateRejectReason(), FIX::Message::setSessionID(), FIX::Session::shouldSendReset(), and toString().

    00054     { return m_beginString; }

const SenderCompID& FIX::SessionID::getSenderCompID | ( |  | ) | const`[inline]`

Definition at line 55 of file SessionID.h.

References m_senderCompID.

Referenced by FIX::FileStore::FileStore(), FIX::Session::fill(), FIX::FileLog::generatePrefix(), FIX::Session::isCorrectCompID(), FIX::Message::setSessionID(), and toString().

    00056     { return m_senderCompID; }

const std::string& FIX::SessionID::getSessionQualifier | ( |  | ) | const`[inline]`

Definition at line 59 of file SessionID.h.

References m_sessionQualifier.

Referenced by FIX::FileStore::FileStore(), and FIX::FileLog::generatePrefix().

    00060     { return m_sessionQualifier; }

const TargetCompID& FIX::SessionID::getTargetCompID | ( |  | ) | const`[inline]`

Definition at line 57 of file SessionID.h.

References m_targetCompID.

Referenced by FIX::FileStore::FileStore(), FIX::Session::fill(), FIX::FileLog::generatePrefix(), FIX::Session::isCorrectCompID(), FIX::Message::setSessionID(), and toString().

    00058     { return m_targetCompID; }

const bool FIX::SessionID::isFIXT | ( |  | ) | const`[inline]`

Definition at line 61 of file SessionID.h.

References m_isFIXT.

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

    00062     { return m_isFIXT; }

SessionID FIX::SessionID::operator~ | ( |  | ) | const`[inline]`

Definition at line 121 of file SessionID.h.

References m_beginString, m_senderCompID, m_sessionQualifier, m_targetCompID, FIX::FIELD::SenderCompID, SessionID(), and FIX::FIELD::TargetCompID.

    00122   {
    00123     return SessionID( m_beginString, SenderCompID( m_targetCompID ),
    00124                       TargetCompID( m_senderCompID ), m_sessionQualifier );
    00125   }

std::string& FIX::SessionID::toString | ( | std::string & | str | ) | const`[inline]`

Get a string representation without making a copy.

Definition at line 105 of file SessionID.h.

References getBeginString(), getSenderCompID(), getTargetCompID(), and m_sessionQualifier.

    00106   {
    00107     str = getBeginString().getValue() + ":" +
    00108           getSenderCompID().getValue() + "->" +
    00109           getTargetCompID().getValue();
    00110     if( m_sessionQualifier.size() )
    00111       str += ":" + m_sessionQualifier;
    00112     return str;
    00113   }

std::string FIX::SessionID::toString | ( |  | ) | const`[inline]`

Get a string representation of the SessionID.

Definition at line 65 of file SessionID.h.

References m_frozenString.

Referenced by fromString(), FIX::HttpConnection::processRefreshSession(), FIX::HttpConnection::processResetSession(), and SessionID().

    00066   {
    00067     return m_frozenString;
    00068   }

const std::string& FIX::SessionID::toStringFrozen | ( |  | ) | const`[inline]`

Definition at line 71 of file SessionID.h.

References m_frozenString.

Referenced by FIX::operator<(), and FIX::operator==().

    00072   {
    00073     return m_frozenString;
    00074   }

## Friends And Related Function Documentation

bool operator!= | ( | const SessionID & | ,
|  | const SessionID & |  |
| ) |  |  | `[friend]`

bool operator< | ( | const SessionID & | ,
|  | const SessionID & |  |
| ) |  |  | `[friend]`

std::ostream& operator<< | ( | std::ostream & | ,
|  | const SessionID & |  |
| ) |  |  | `[friend]`

bool operator== | ( | const SessionID & | ,
|  | const SessionID & |  |
| ) |  |  | `[friend]`

std::ostream& operator>> | ( | std::ostream & | ,
|  | const SessionID & |  |
| ) |  |  | `[friend]`

## Member Data Documentation

BeginString FIX::SessionID::m_beginString`[private]`

Definition at line 128 of file SessionID.h.

Referenced by fromString(), getBeginString(), and operator~().

std::string FIX::SessionID::m_frozenString`[private]`

Definition at line 133 of file SessionID.h.

Referenced by fromString(), SessionID(), toString(), and toStringFrozen().

bool FIX::SessionID::m_isFIXT`[private]`

Definition at line 132 of file SessionID.h.

Referenced by isFIXT(), and SessionID().

SenderCompID FIX::SessionID::m_senderCompID`[private]`

Definition at line 129 of file SessionID.h.

Referenced by fromString(), getSenderCompID(), and operator~().

std::string FIX::SessionID::m_sessionQualifier`[private]`

Definition at line 131 of file SessionID.h.

Referenced by fromString(), getSessionQualifier(), operator~(), and toString().

TargetCompID FIX::SessionID::m_targetCompID`[private]`

Definition at line 130 of file SessionID.h.

Referenced by fromString(), getTargetCompID(), and operator~().

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

- /home/omiller/Development/autobuild/quickfix/src/C++/SessionID.h