Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CTCPBadSocketState Class Reference

#include <CTCPBadSocketState.h>

List of all members.

Public Member Functions

 CTCPBadSocketState (CSocket::State badState, STD(vector)< CSocket::State > okStates, const char *pDoing)
 CTCPBadSocketState (const CTCPBadSocketState &rhs)
virtual ~CTCPBadSocketState ()
CTCPBadSocketStateoperator= (const CTCPBadSocketState &rhs)
int operator== (const CTCPBadSocketState &rhs)
CSocket::State getBadState () const
 STD (vector)< CSocket
virtual const char * ReasonText () const

Protected Member Functions

void setBadState (CSocket::State newState)
void setValidStates (const STD(vector)< CSocket::State > &newStates)

Private Attributes

CSocket::State m_BadState
 Incorrect state at time of throw.
STD(vector)< CSocke STD )(string) m_Message
 Full error message built up here.


Detailed Description

Encapsulates an exception which will be thrown whenever a CSocket member is called when the socket is in an invalid state. The exception recognizes that there may be a list of valid states which the socket can be in and will indicate in the exception message the set of valid states.

Definition at line 323 of file CTCPBadSocketState.h.


Constructor & Destructor Documentation

CTCPBadSocketState::CTCPBadSocketState CSocket::State  badState,
STD(vector)< CSocket::State okStates,
const char *  pDoing
 

CTCPBadSocketState::CTCPBadSocketState const CTCPBadSocketState rhs  ) 
 

"Copy constructor" This constructor creates a new object from a 'reference' object. This is used by the compiler to create temporaries, it is also used by throw to copy the exception to a "spot" where it cannot go out of scope as it travels up the call stack in search of a handler.

Parameters:
rhs - the reference object copied.

Definition at line 329 of file CTCPBadSocketState.cpp.

virtual CTCPBadSocketState::~CTCPBadSocketState  )  [inline, virtual]
 

Definition at line 337 of file CTCPBadSocketState.h.


Member Function Documentation

CSocket::State CTCPBadSocketState::getBadState  )  const [inline]
 

Definition at line 345 of file CTCPBadSocketState.h.

CTCPBadSocketState & CTCPBadSocketState::operator= const CTCPBadSocketState rhs  ) 
 

Assignement... little different from copy construction however:

  • Any existing members require cleanup if they are dynamic, since we are already fully constructed.
  • We avoid self assignment.
  • We return a reference to ourselves after the copy in.

Parameters:
rhs The right hand side object which is being assigned to us.

Definition at line 347 of file CTCPBadSocketState.cpp.

References m_BadState.

int CTCPBadSocketState::operator== const CTCPBadSocketState rhs  ) 
 

Equality comparison. Returns int indicating if for all practical purposes this is the same as the rhs. m_Message is not compared as it is inconsequential.

Parameters:
rhs The object *this is being compared to.

Definition at line 364 of file CTCPBadSocketState.cpp.

References m_BadState.

const char * CTCPBadSocketState::ReasonText  )  const [virtual]
 

Build up and return a text string describing why the exception was thrown. This is done from the m_BadState, m_ValidStates, and base class WasDoing() strings. The final string is of the form:

"CSocket member called while in state m_BadState, Valid states are m_ValidStates, CSocket was attempting to: WasDoing()"

Definition at line 384 of file CTCPBadSocketState.cpp.

References m_BadState.

void CTCPBadSocketState::setBadState CSocket::State  newState  )  [inline, protected]
 

Definition at line 353 of file CTCPBadSocketState.h.

References m_BadState.

void CTCPBadSocketState::setValidStates const STD(vector)< CSocket::State > &  newStates  )  [inline, protected]
 

Definition at line 355 of file CTCPBadSocketState.h.

CTCPBadSocketState::STD vector   )  [inline]
 

Definition at line 347 of file CTCPBadSocketState.h.


Member Data Documentation

CSocket::State CTCPBadSocketState::m_BadState [private]
 

Incorrect state at time of throw.

Definition at line 327 of file CTCPBadSocketState.h.

Referenced by operator=(), operator==(), ReasonText(), and setBadState().

STD (vector)<CSocke CTCPBadSocketState::STD)(string) m_Message [mutable, private]
 

Full error message built up here.


The documentation for this class was generated from the following files:
Generated on Thu Jan 6 16:58:44 2005 for Spectrodaq External Event Framework by  doxygen 1.3.9.1