wisc_db
Public Member Functions | Protected Attributes | Friends | List of all members
wiscdb::WiscDbException Class Reference

Base class for all WiscDB-specific exceptions. More...

#include <wiscdb_exception.h>

Inheritance diagram for wiscdb::WiscDbException:
wiscdb::BadBufferException wiscdb::BufferExceededException wiscdb::FileExistsException wiscdb::FileNotFoundException wiscdb::FileOpenException wiscdb::HashAlreadyPresentException wiscdb::HashNotFoundException wiscdb::HashTableException wiscdb::InsufficientSpaceException wiscdb::InvalidPageException wiscdb::InvalidRecordException wiscdb::InvalidSlotException wiscdb::PageNotPinnedException wiscdb::PagePinnedException wiscdb::SlotInUseException

Public Member Functions

 WiscDbException (const std::string &msg)
 
virtual ~WiscDbException () throw ()
 
virtual const std::string & message () const
 
virtual const char * what () const throw ()
 

Protected Attributes

std::string message_
 

Friends

std::ostream & operator<< (std::ostream &out, const WiscDbException &exception)
 

Detailed Description

Base class for all WiscDB-specific exceptions.

Definition at line 18 of file wiscdb_exception.h.

Constructor & Destructor Documentation

wiscdb::WiscDbException::WiscDbException ( const std::string &  msg)
explicit

Constructs a new exception with the given message.

Parameters
msgMessage with information about the exception.

Definition at line 12 of file wiscdb_exception.cpp.

13  : message_(msg) {
14 }
virtual wiscdb::WiscDbException::~WiscDbException ( )
throw (
)
inlinevirtual

Destroys the exception. Does nothing special; just included to make the compiler happy.

Definition at line 31 of file wiscdb_exception.h.

31 {}

Member Function Documentation

virtual const std::string& wiscdb::WiscDbException::message ( ) const
inlinevirtual

Returns a message describing the problem that caused this exception.

Returns
Message describing the problem that caused this exception.

Definition at line 38 of file wiscdb_exception.h.

38 { return message_; }
virtual const char* wiscdb::WiscDbException::what ( ) const
throw (
)
inlinevirtual

Returns a description of the exception.

Returns
Description of the exception.

Definition at line 45 of file wiscdb_exception.h.

45 { return message_.c_str(); }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const WiscDbException exception 
)
friend

Formats this exception for printing on the given stream.

Parameters
outStream to print exception to.
exceptionException to print.
Returns
Stream with exception printed.

Definition at line 54 of file wiscdb_exception.h.

55  {
56  out << exception.message();
57  return out;
58  }

Member Data Documentation

std::string wiscdb::WiscDbException::message_
protected

Message describing the problem that caused this exception.

Definition at line 64 of file wiscdb_exception.h.


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