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

An exception that is thrown when a record is requested from a page that has a bad record ID. More...

#include <invalid_record_exception.h>

Inheritance diagram for wiscdb::InvalidRecordException:
wiscdb::WiscDbException

Public Member Functions

 InvalidRecordException (const RecordId &rec_id, const PageId page_num)
 
virtual const RecordIdrecord_id () const
 
virtual PageId page_number () const
 
virtual const std::string & message () const
 
virtual const char * what () const throw ()
 

Protected Attributes

const RecordId record_id_
 
const PageId page_number_
 
std::string message_
 

Detailed Description

An exception that is thrown when a record is requested from a page that has a bad record ID.

Definition at line 21 of file invalid_record_exception.h.

Constructor & Destructor Documentation

wiscdb::InvalidRecordException::InvalidRecordException ( const RecordId rec_id,
const PageId  page_num 
)

Constructs an invalid record exception for the given requested record ID and page number.

Parameters
rec_idRequested record ID.
page_numPage from which record is requested.

Definition at line 15 of file invalid_record_exception.cpp.

17  : WiscDbException(""),
18  record_id_(rec_id),
19  page_number_(page_num) {
20  std::stringstream ss;
21  ss << "Request made for an invalid record."
22  << " Record {page=" << record_id_.page_number
23  << ", slot=" << record_id_.slot_number
24  << "} from page " << page_number_;
25  message_.assign(ss.str());
26 }
WiscDbException(const std::string &msg)
SlotId slot_number
Definition: types.h:39
PageId page_number
Definition: types.h:34

Member Function Documentation

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

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 PageId wiscdb::InvalidRecordException::page_number ( ) const
inlinevirtual

Returns the page number of the page that caused this exception.

Definition at line 41 of file invalid_record_exception.h.

virtual const RecordId& wiscdb::InvalidRecordException::record_id ( ) const
inlinevirtual

Returns the requested record ID that caused this exception.

Definition at line 36 of file invalid_record_exception.h.

36 { return record_id_; }
virtual const char* wiscdb::WiscDbException::what ( ) const
throw (
)
inlinevirtualinherited

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(); }

Member Data Documentation

std::string wiscdb::WiscDbException::message_
protectedinherited

Message describing the problem that caused this exception.

Definition at line 64 of file wiscdb_exception.h.

const PageId wiscdb::InvalidRecordException::page_number_
protected

Page number of page which caused this exception.

Definition at line 52 of file invalid_record_exception.h.

const RecordId wiscdb::InvalidRecordException::record_id_
protected

Record ID which caused this exception.

Definition at line 47 of file invalid_record_exception.h.


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