FIX::SessionID Class Reference

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

`#include <SessionID.h>`

## 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. More...
const std::string & | toStringFrozen () const
void | fromString (const std::string &str)
| Build from string representation of SessionID. More...
std::string & | toString (std::string &str) const
| Get a string representation without making a copy. More...
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 47 of file SessionID.h.

## Constructor & Destructor Documentation

## SessionID() [1/2]

FIX::SessionID::SessionID | ( |  | ) |

inline

Definition at line 67 of file SessionID.h.

## SessionID() [2/2]

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

inline

Definition at line 72 of file SessionID.h.

{
return m_frozenString;
}
void fromString( const std::string& str )
{
std::string::size_type first =
str.find_first_of(':');
std::string::size_type second =
str.find("->");
std::string::size_type third =
str.find_last_of(':');
if( first == std::string::npos )

References m_frozenString.

## Member Function Documentation

## fromString()

void FIX::SessionID::fromString | ( | const std::string & | str | ) |

inline

Build from string representation of SessionID.

Definition at line 111 of file SessionID.h.

:" + m_sessionQualifier;
return str;
}
friend bool operator<( const SessionID&, const SessionID& );
friend bool operator==( const SessionID&, const SessionID& );
friend bool operator!=( const SessionID&, const SessionID& );
friend std::ostream& operator<<( std::ostream&, const SessionID& );
friend std::ostream& operator>>( std::ostream&, const SessionID& );
SessionID operator~() const
{
return SessionID( m_beginString, SenderCompID( m_targetCompID ),
TargetCompID( m_senderCompID ), m_sessionQualifier );
}
private:
BeginString m_beginString;
SenderCompID m_senderCompID;
TargetCompID m_targetCompID;
std::string m_sessionQualifier;
bool m_isFIXT;
std::string m_frozenString;
};

## getBeginString()

const BeginString& FIX::SessionID::getBeginString | ( |  | ) | const

inline

Definition at line 87 of file SessionID.h.

{

Referenced by toStringFrozen().

## getSenderCompID()

const SenderCompID& FIX::SessionID::getSenderCompID | ( |  | ) | const

inline

Definition at line 89 of file SessionID.h.

{

Referenced by toStringFrozen().

## getSessionQualifier()

const std::string& FIX::SessionID::getSessionQualifier | ( |  | ) | const

inline

Definition at line 93 of file SessionID.h.

{

## getTargetCompID()

const TargetCompID& FIX::SessionID::getTargetCompID | ( |  | ) | const

inline

Definition at line 91 of file SessionID.h.

{

Referenced by toStringFrozen().

## isFIXT()

const bool FIX::SessionID::isFIXT | ( |  | ) | const

inline

Definition at line 95 of file SessionID.h.

{

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

## operator~()

SessionID FIX::SessionID::operator~ | ( |  | ) | const

inline

Definition at line 155 of file SessionID.h.

## toString() [1/2]

std::string FIX::SessionID::toString | ( |  | ) | const

inline

Get a string representation of the SessionID.

Definition at line 99 of file SessionID.h.

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

## toString() [2/2]

std::string& FIX::SessionID::toString | ( | std::string & | str | ) | const

inline

Get a string representation without making a copy.

Definition at line 139 of file SessionID.h.

{
return lhs.toStringFrozen() == rhs.toStringFrozen();
}
inline bool operator!=( const SessionID& lhs, const SessionID& rhs )

## toStringFrozen()

const std::string& FIX::SessionID::toStringFrozen | ( |  | ) | const

inline

Definition at line 105 of file SessionID.h.

{
str = getBeginString().getValue() + ":" +
getSenderCompID().getValue() + "->" +

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

## Friends And Related Function Documentation

## operator!=

bool operator!= | ( | const SessionID & | lhs,
|  | const SessionID & | rhs
| ) |  |

friend

Definition at line 164 of file SessionID.h.

## operator<

bool operator< | ( | const SessionID & | lhs,
|  | const SessionID & | rhs
| ) |  |

friend

Definition at line 154 of file SessionID.h.

{
stream << sessionID.toStringFrozen();
return stream;
}

## operator<<

std::ostream& operator<< | ( | std::ostream & | stream,
|  | const SessionID & | sessionID
| ) |  |

friend

Definition at line 170 of file SessionID.h.

## operator==

bool operator== | ( | const SessionID & | lhs,
|  | const SessionID & | rhs
| ) |  |

friend

Definition at line 159 of file SessionID.h.

{
std::string str;

## operator>>

std::ostream& operator>> | ( | std::ostream & | ,
|  | const SessionID & |
| ) |  |

friend

## Member Data Documentation

## m_beginString

BeginString FIX::SessionID::m_beginString

private

Definition at line 162 of file SessionID.h.

## m_frozenString

std::string FIX::SessionID::m_frozenString

private

Definition at line 167 of file SessionID.h.

Referenced by SessionID().

## m_isFIXT

bool FIX::SessionID::m_isFIXT

private

Definition at line 166 of file SessionID.h.

## m_senderCompID

SenderCompID FIX::SessionID::m_senderCompID

private

Definition at line 163 of file SessionID.h.

## m_sessionQualifier

std::string FIX::SessionID::m_sessionQualifier

private

Definition at line 165 of file SessionID.h.

Referenced by toStringFrozen().

## m_targetCompID

TargetCompID FIX::SessionID::m_targetCompID

private

Definition at line 164 of file SessionID.h.

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

- SessionID.h

FIX::SessionID::fromString
void fromString(const std::string &str)
Build from string representation of SessionID.
Definition: SessionID.h:111
FIX::SessionID::m_frozenString
std::string m_frozenString
Definition: SessionID.h:167
FIX::SessionID::getSenderCompID
const SenderCompID & getSenderCompID() const
Definition: SessionID.h:89
FIX::SessionID::SessionID
SessionID()
Definition: SessionID.h:67
FIX::SessionID::getBeginString
const BeginString & getBeginString() const
Definition: SessionID.h:87
FIX::SessionID::operator!=
friend bool operator!=(const SessionID &, const SessionID &)
Definition: SessionID.h:164