retdec
visitable.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_SUPPORT_VISITABLE_H
8 #define RETDEC_LLVMIR2HLL_SUPPORT_VISITABLE_H
9 
10 namespace retdec {
11 namespace llvmir2hll {
12 
13 class Visitor;
14 
20 class Visitable {
21 public:
33  virtual void accept(Visitor *v) = 0;
34 
35 protected:
36  // Public constructor is not needed in an interface, so prevent the
37  // compiler from generating a public one.
38  Visitable() = default;
39 
40  // Protected non-virtual destructor disables polymorphic destruction, which
41  // is the appropriate behavior in this case.
42  ~Visitable() = default;
43 };
44 
45 } // namespace llvmir2hll
46 } // namespace retdec
47 
48 #endif
Interface for classes whose instances are visitable by a Visitor.
Definition: visitable.h:20
virtual void accept(Visitor *v)=0
Visitor pattern implementation.
A base class of all visitors.
Definition: visitor.h:95
A library providing API for working with back-end IR.
Definition: archive_wrapper.h:19