fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::f8Exception Class Reference

Base exception class. More...

#include <f8exception.hpp>

Inheritance diagram for FIX8::f8Exception:
FIX8::BadCheckSum FIX8::BadCompidId FIX8::BadSendingTime FIX8::ConfigurationError FIX8::DuplicateField FIX8::f8_threadException FIX8::IllegalMessage FIX8::InvalidBodyLength FIX8::InvalidConfiguration FIX8::InvalidDomainValue< T > FIX8::InvalidField FIX8::InvalidMessage FIX8::InvalidMetadata< T > FIX8::InvalidMsgSequence FIX8::InvalidRepeatingGroup FIX8::InvalidVersion FIX8::LogfileException FIX8::MissingMandatoryField FIX8::MissingMessageComponent FIX8::MissingRepeatingGroupField FIX8::MsgSequenceTooLow FIX8::PeerResetConnection FIX8::UnknownField FIX8::XMLError

Public Member Functions

 f8Exception (bool force_logoff=false)
 
 f8Exception (const std::string &msg, bool force_logoff=false)
 
 f8Exception (const char *msg, bool force_logoff=false)
 
template<typename T >
 f8Exception (const std::string &msg, const T &val, bool force_logoff=false)
 
virtual ~f8Exception () throw ()
 Dtor. More...
 
const char * what () const throw ()
 
bool force_logoff () const
 

Protected Member Functions

template<typename T >
void format (const std::string &msg, const T what)
 
template<typename T , typename S >
void format (const std::string &msg, const T what, const std::string &msg2, const S what2)
 

Private Attributes

std::string _reason
 
bool _force_logoff
 

Detailed Description

Base exception class.

Definition at line 49 of file f8exception.hpp.

Constructor & Destructor Documentation

FIX8::f8Exception::f8Exception ( bool  force_logoff = false)
inline

Ctor.

Parameters
force_logoffif true, logoff when thrown

Definition at line 57 of file f8exception.hpp.

bool force_logoff() const
Definition: f8exception.hpp:89
FIX8::f8Exception::f8Exception ( const std::string &  msg,
bool  force_logoff = false 
)
inline

Ctor.

Parameters
msgmessage associated with this exception
force_logoffif true, logoff when thrown

Definition at line 62 of file f8exception.hpp.

bool force_logoff() const
Definition: f8exception.hpp:89
std::string _reason
Definition: f8exception.hpp:51
FIX8::f8Exception::f8Exception ( const char *  msg,
bool  force_logoff = false 
)
inline

Ctor.

Parameters
msgmessage associated with this exception
force_logoffif true, logoff when thrown

Definition at line 68 of file f8exception.hpp.

bool force_logoff() const
Definition: f8exception.hpp:89
std::string _reason
Definition: f8exception.hpp:51
template<typename T >
FIX8::f8Exception::f8Exception ( const std::string &  msg,
const T &  val,
bool  force_logoff = false 
)
inline

Ctor.

Template Parameters
Ttype of value to format
Parameters
msgmessage associated with this exception
valvalue to display with this exception
force_logoffif true, logoff when thrown

Definition at line 77 of file f8exception.hpp.

References format().

78  : _reason(msg), _force_logoff(force_logoff) { format(msg, val); }
bool force_logoff() const
Definition: f8exception.hpp:89
std::string _reason
Definition: f8exception.hpp:51
void format(const std::string &msg, const T what)
Definition: f8exception.hpp:97
virtual FIX8::f8Exception::~f8Exception ( )
throw (
)
inlinevirtual

Dtor.

Definition at line 81 of file f8exception.hpp.

81 {}

Member Function Documentation

bool FIX8::f8Exception::force_logoff ( ) const
inline

Get the force logoff setting.

Returns
true if force logoff is set

Definition at line 89 of file f8exception.hpp.

References _force_logoff.

Referenced by FIX8::Session::process().

89 { return _force_logoff; }
template<typename T >
void FIX8::f8Exception::format ( const std::string &  msg,
const T  what 
)
inlineprotected

Format a message to associate with this exception.

Template Parameters
Ttype of value to format
Parameters
msgmessage associated with this exception
whatto display with this exception

Definition at line 97 of file f8exception.hpp.

References what().

Referenced by FIX8::BadCheckSum::BadCheckSum(), FIX8::BadCompidId::BadCompidId(), FIX8::BadSendingTime::BadSendingTime(), FIX8::ConfigurationError::ConfigurationError(), FIX8::DuplicateField::DuplicateField(), FIX8::f8_threadException::f8_threadException(), f8Exception(), FIX8::IllegalMessage::IllegalMessage(), FIX8::InvalidBodyLength::InvalidBodyLength(), FIX8::InvalidConfiguration::InvalidConfiguration(), FIX8::InvalidDomainValue< T >::InvalidDomainValue(), FIX8::InvalidField::InvalidField(), FIX8::InvalidMessage::InvalidMessage(), FIX8::InvalidMetadata< T >::InvalidMetadata(), FIX8::InvalidMsgSequence::InvalidMsgSequence(), FIX8::InvalidRepeatingGroup::InvalidRepeatingGroup(), FIX8::InvalidVersion::InvalidVersion(), FIX8::LogfileException::LogfileException(), FIX8::MissingMandatoryField::MissingMandatoryField(), FIX8::MissingMessageComponent::MissingMessageComponent(), FIX8::MissingRepeatingGroupField::MissingRepeatingGroupField(), FIX8::MsgSequenceTooLow::MsgSequenceTooLow(), FIX8::PeerResetConnection::PeerResetConnection(), FIX8::UnknownField::UnknownField(), and FIX8::XMLError::XMLError().

98  {
99  std::ostringstream ostr;
100  ostr << msg << ": " << what;
101  _reason = ostr.str();
102  }
std::string _reason
Definition: f8exception.hpp:51
const char * what() const
Definition: f8exception.hpp:85
template<typename T , typename S >
void FIX8::f8Exception::format ( const std::string &  msg,
const T  what,
const std::string &  msg2,
const S  what2 
)
inlineprotected

Format a message to associate with this exception.

Template Parameters
Ttype of value to format
Stype of 2nd value to format
Parameters
msgmessage associated with this exception
whatto display with this exception
msg2message associated with this exception
what2to display with this exception

Definition at line 112 of file f8exception.hpp.

113  {
114  std::ostringstream ostr;
115  ostr << msg << ": " << what << msg2 << ": " << what2;
116  _reason = ostr.str();
117  }
std::string _reason
Definition: f8exception.hpp:51
const char * what() const
Definition: f8exception.hpp:85
const char* FIX8::f8Exception::what ( ) const
throw (
)
inline

Get message associated with this exception.

Returns
text message

Definition at line 85 of file f8exception.hpp.

Referenced by FIX8::FIXReader::execute(), FIX8::FIXWriter::execute(), format(), main(), FIX8::ReliableClientSession< T >::operator()(), FIX8::Session::process(), FIX8::Session::send_process(), and FIX8::SessionInstance< T >::~SessionInstance().

85 { return _reason.c_str(); }
std::string _reason
Definition: f8exception.hpp:51

Member Data Documentation

bool FIX8::f8Exception::_force_logoff
private

Definition at line 52 of file f8exception.hpp.

Referenced by force_logoff().

std::string FIX8::f8Exception::_reason
private

Definition at line 51 of file f8exception.hpp.


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