FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
Public Member Functions | List of all members
CStateException Class Reference

#include <StateException.h>

Inheritance diagram for CStateException:
Inheritance graph
[legend]
Collaboration diagram for CStateException:
Collaboration graph
[legend]

Public Member Functions

 CStateException (const char *state, const char *allowedStates, const char *pAction)
 
virtual ~CStateException ()
 
 CStateException (const CStateException &rhs)
 
CStateExceptionoperator= (const CStateException &rhs)
 
int operator== (const CStateException &rhs) const
 
int operator!= (const CStateException &rhs) const
 
virtual const char * ReasonText () const
 
virtual int ReasonCode () const
 
- Public Member Functions inherited from CException
 CException (const char *pszAction)
 
 CException (const std::string &rsAction)
 
 CException (const CException &aCException)
 
CExceptionoperator= (const CException &aCException)
 
int operator== (const CException &aCException) const
 
int operator!= (const CException &rException) const
 
const char * getAction () const
 
const char * WasDoing () const
 

Additional Inherited Members

- Protected Member Functions inherited from CException
void setAction (const char *pszAction)
 
void setAction (const std::string &rsAction)
 
virtual void DoAssign (const CException &rhs)
 

Detailed Description

This class provides an exception that can be thrown if a program detects a 'state mismatch'. A state mismatch is said to occur when something is requested of an object, but its internal state forbids that service from being rendered to the client. In particular, this was developed to deal with services being requested in the TCL class library of objects that require an interpreter to satisfy, when objects were not (yet) bound to an interpreter.

Constructor & Destructor Documentation

◆ CStateException() [1/2]

CStateException::CStateException ( const char *  state,
const char *  allowedStates,
const char *  pAction 
)

Construct a state exception.

Parameters
state: const char* Describes the state the object is in.
allowedStates: const char* Describes the state the object should be in to be able to perform the request.
pAction: const char* Describes what the program is doing at the time of the exception.

◆ ~CStateException()

CStateException::~CStateException ( )
virtual

Destruction is a no-op.

◆ CStateException() [2/2]

CStateException::CStateException ( const CStateException rhs)

Copy construction.. just need to construct the base class and our reason string.

Member Function Documentation

◆ operator!=()

int CStateException::operator!= ( const CStateException rhs) const

Inequality comparision.. this is just the inverse of equality compare.

◆ operator=()

CStateException & CStateException::operator= ( const CStateException rhs)

Asignment operator. base class assign and then assign our reason text.

◆ operator==()

int CStateException::operator== ( const CStateException rhs) const

Equality comparison... if base class and reason text are the same.

◆ ReasonCode()

int CStateException::ReasonCode ( ) const
virtual

Reason code is always meaningless so we return a -1.

Reimplemented from CException.

◆ ReasonText()

const char * CStateException::ReasonText ( ) const
virtual

Return the reason for the exception. This was stored at construction time in m_Reason.

Returns
const char*
Return values
m_Reason.c_str()

Reimplemented from CException.


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