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