ROSE  0.9.10.69
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 class PlaceholderError: public Exception {
22  rose_addr_t startVa_;
23 public:
24  PlaceholderError(rose_addr_t startVa, const std::string &mesg)
25  : Exception(mesg), startVa_(startVa) {}
26  ~PlaceholderError() throw() {}
27  rose_addr_t startVa() const { return startVa_; }
28 };
29 
30 class BasicBlockError: public Exception {
31  BasicBlock::Ptr bblock_;
32 public:
33  BasicBlockError(const BasicBlock::Ptr &bblock, const std::string &mesg)
34  : Exception(mesg), bblock_(bblock) {}
35  ~BasicBlockError() throw() {}
36  BasicBlock::Ptr bblock() const { return bblock_; }
37 };
38 
39 class DataBlockError: public Exception {
40  DataBlock::Ptr dblock_;
41 public:
42  DataBlockError(const DataBlock::Ptr &dblock, const std::string &mesg)
43  : Exception(mesg), dblock_(dblock) {}
44  ~DataBlockError() throw() {}
45  DataBlock::Ptr dblock() const { return dblock_; }
46 };
47 
48 class FunctionError: public Exception {
49  Function::Ptr function_;
50 public:
51  FunctionError(const Function::Ptr &function, const std::string &mesg)
52  : Exception(mesg), function_(function) {}
53  ~FunctionError() throw() {}
54  Function::Ptr function() const { return function_; }
55 };
56 
57 class FileError: public Exception {
58 public:
59  FileError(const std::string &mesg)
60  : Exception(mesg) {}
61  ~FileError() throw() {}
62 };
63 
64 } // namespace
65 } // namespace
66 } // namespace
67 
68 #endif
Main namespace for the ROSE library.