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

An exception that is thrown when a record is attempted to be inserted into a slot that is already in use. More...

#include <slot_in_use_exception.h>

Inheritance diagram for wiscdb::SlotInUseException:
wiscdb::WiscDbException

Public Member Functions

 SlotInUseException (const PageId page_num, const SlotId slot_num)
 
virtual PageId page_number () const
 
virtual SlotId slot_number () const
 
virtual const std::string & message () const
 
virtual const char * what () const throw ()
 

Protected Attributes

const PageId page_number_
 
const SlotId slot_number_
 
std::string message_
 

Detailed Description

An exception that is thrown when a record is attempted to be inserted into a slot that is already in use.

Definition at line 21 of file slot_in_use_exception.h.

Constructor & Destructor Documentation

wiscdb::SlotInUseException::SlotInUseException ( const PageId  page_num,
const SlotId  slot_num 
)

Constructs a slot in use exception file for the given page and slot.

Parameters
page_numNumber of page containing slot.
slot_numNumber of slot which is in use.

Definition at line 15 of file slot_in_use_exception.cpp.

17  : WiscDbException(""),
18  page_number_(page_num),
19  slot_number_(slot_num) {
20  std::stringstream ss;
21  ss << "Attempt to insert data to a slot that is currently in use."
22  << " Page: " << page_number_ << " Slot: " << slot_number_;
23  message_.assign(ss.str());
24 }
WiscDbException(const std::string &msg)

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::SlotInUseException::page_number ( ) const
inlinevirtual

Returns the page number of the page containing the slot which caused this exception.

Definition at line 35 of file slot_in_use_exception.h.

35 { return page_number_; }
virtual SlotId wiscdb::SlotInUseException::slot_number ( ) const
inlinevirtual

Returns the slot number of the slot which caused this exception.

Definition at line 40 of file slot_in_use_exception.h.

40 { return slot_number_; }
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::SlotInUseException::page_number_
protected

Page number of the page containing the slot which caused this exception.

Definition at line 46 of file slot_in_use_exception.h.

const SlotId wiscdb::SlotInUseException::slot_number_
protected

Slot number of the slot which caused this exception.

Definition at line 51 of file slot_in_use_exception.h.


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