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