BadgerDB
/afs/cs.wisc.edu/p/course/cs564-jignesh/public/html/projects/BadgerDB/bufmgr/src/exceptions/badgerdb_exception.h
00001 
00008 #pragma once
00009 
00010 #include <exception>
00011 #include <string>
00012 
00013 namespace badgerdb {
00014 
00018 class BadgerDbException : public std::exception {
00019  public:
00025   explicit BadgerDbException(const std::string& msg);
00026 
00031   virtual ~BadgerDbException() throw() {}
00032 
00038   virtual const std::string& message() const { return message_; }
00039 
00045   virtual const char* what() const throw() { return message_.c_str(); }
00046 
00054   friend std::ostream& operator<<(std::ostream& out,
00055                                   const BadgerDbException& exception) {
00056     out << exception.message();
00057     return out;
00058   }
00059 
00060  protected:
00064   std::string message_;
00065 };
00066 
00067 }
 All Classes Namespaces Functions Variables Typedefs Friends