blocxx
BLOCXX_NAMESPACE::SocketException Class Reference

#include <SocketException.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::SocketException:
BLOCXX_NAMESPACE::Exception BLOCXX_NAMESPACE::SSLException

Public Member Functions

 SocketException (const char *file, int line, const char *msg, int errorCode=::BLOCXX_NAMESPACE::Exception::UNKNOWN_ERROR_CODE, const Exception *otherException=0, int subClassId=::BLOCXX_NAMESPACE::Exception::UNKNOWN_SUBCLASS_ID)
 
virtual ~SocketException () throw ()
 
virtual const char * type () const
 Returns a string representing the concrete type.
 
virtual SocketExceptionclone () const
 Make a copy of this exception object.
 
virtual void rethrow () const
 Re-throws the exception.
 
- Public Member Functions inherited from BLOCXX_NAMESPACE::Exception
virtual ~Exception () throw ()
 
virtual const char * getMessage () const
 Returns the message.
 
const char * getFile () const
 Returns the file.
 
int getLine () const
 
int getSubClassId () const
 
const ExceptiongetSubException () const
 Returns the sub exception if available, otherwise 0.
 
int getErrorCode () const
 Returns the error code representing the error which occurred.
 
virtual const char * what () const throw ()
 Returns getMessage()
 
char * dupString (const char *str)
 Utility function to copy a string.
 

Additional Inherited Members

- Static Public Attributes inherited from BLOCXX_NAMESPACE::Exception
static const int UNKNOWN_SUBCLASS_ID = -1
 
static const int UNKNOWN_ERROR_CODE = -1
 
- Protected Member Functions inherited from BLOCXX_NAMESPACE::Exception
 Exception (const char *file, int line, const char *msg) BLOCXX_DEPRECATED
 This constructor is deprecated.
 
 Exception (const char *file, int line, const char *msg, int errorCode, const Exception *otherException=0, int subClassId=UNKNOWN_SUBCLASS_ID)
 
 Exception (int subClassId, const char *file, int line, const char *msg, int errorCode, const Exception *otherException=0) BLOCXX_DEPRECATED
 
 Exception (const Exception &e)
 
Exceptionoperator= (const Exception &rhs)
 
void swap (Exception &x)
 
void setSubClassId (int subClassId)
 
void setErrorCode (int errorCode)
 

Detailed Description

Definition at line 46 of file SocketException.hpp.

Constructor & Destructor Documentation

◆ SocketException()

BLOCXX_NAMESPACE::SocketException::SocketException ( const char * file,
int line,
const char * msg,
int errorCode = ::BLOCXX_NAMESPACE::Exception::UNKNOWN_ERROR_CODE,
const Exception * otherException = 0,
int subClassId = ::BLOCXX_NAMESPACE::Exception::UNKNOWN_SUBCLASS_ID )

Definition at line 54 of file Socket.cpp.

Referenced by BLOCXX_NAMESPACE::SSLException::clone().

◆ ~SocketException()

BLOCXX_NAMESPACE::SocketException::~SocketException ( )
throw ( )
virtual

Definition at line 54 of file Socket.cpp.

Member Function Documentation

◆ clone()

SocketException * BLOCXX_NAMESPACE::SocketException::clone ( ) const
virtual

Make a copy of this exception object.

If allocation fails, return 0. Subclasses need to override this function. This function must not throw. Here is an example of how to implement this in a derived class:

virtual DerivedException* clone() const { return new(std::nothrow) DerivedException(*this); }

Reimplemented from BLOCXX_NAMESPACE::Exception.

Reimplemented in BLOCXX_NAMESPACE::SSLException.

Definition at line 54 of file Socket.cpp.

◆ rethrow()

void BLOCXX_NAMESPACE::SocketException::rethrow ( ) const
virtual

Re-throws the exception.

All derived classes should override this which makes it possible to catch a base class Exception and still re-thrown the derived class.

Reimplemented from BLOCXX_NAMESPACE::Exception.

Reimplemented in BLOCXX_NAMESPACE::SSLException.

Definition at line 54 of file Socket.cpp.

◆ type()

const char * BLOCXX_NAMESPACE::SocketException::type ( ) const
virtual

Returns a string representing the concrete type.

e.g. "SocketException". Will not return 0. This function will not throw. Derived class implementations must not throw.

Reimplemented from BLOCXX_NAMESPACE::Exception.

Reimplemented in BLOCXX_NAMESPACE::SSLException.

Definition at line 54 of file Socket.cpp.


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