ROSE  0.9.9.109
frontend/Partitioner2/Exception.h
1 #ifndef ROSE_Partitioner2_Exception_H
2 #define ROSE_Partitioner2_Exception_H
3 
4 #include <Partitioner2/BasicBlock.h>
5 #include <Partitioner2/DataBlock.h>
6 #include <Partitioner2/Function.h>
7 
8 #include <stdexcept>
9 #include <string>
10 
11 namespace Rose {
12 namespace BinaryAnalysis {
13 namespace Partitioner2 {
14 
15 class Exception: public std::runtime_error {
16 public:
17  Exception(const std::string &mesg): std::runtime_error(mesg) {}
18  ~Exception() throw() {}
19 
20 };
21 
22 class PlaceholderError: public Exception {
23  rose_addr_t startVa_;
24 public:
25  PlaceholderError(rose_addr_t startVa, const std::string &mesg)
26  : Exception(mesg), startVa_(startVa) {}
27  ~PlaceholderError() throw() {}
28  rose_addr_t startVa() const { return startVa_; }
29 };
30 
31 class BasicBlockError: public Exception {
32  BasicBlock::Ptr bblock_;
33 public:
34  BasicBlockError(const BasicBlock::Ptr &bblock, const std::string &mesg)
35  : Exception(mesg), bblock_(bblock) {}
36  ~BasicBlockError() throw() {}
37  BasicBlock::Ptr bblock() const { return bblock_; }
38 };
39 
40 class DataBlockError: public Exception {
41  DataBlock::Ptr dblock_;
42 public:
43  DataBlockError(const DataBlock::Ptr &dblock, const std::string &mesg)
44  : Exception(mesg), dblock_(dblock) {}
45  ~DataBlockError() throw() {}
46  DataBlock::Ptr dblock() const { return dblock_; }
47 };
48 
49 class FunctionError: public Exception {
50  Function::Ptr function_;
51 public:
52  FunctionError(const Function::Ptr &function, const std::string &mesg)
53  : Exception(mesg), function_(function) {}
54  ~FunctionError() throw() {}
55  Function::Ptr function() const { return function_; }
56 };
57 
58 } // namespace
59 } // namespace
60 } // namespace
61 
62 #endif
Main namespace for the ROSE library.