retdec
visitable.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_CTYPES_VISITABLE_H
8 #define RETDEC_CTYPES_VISITABLE_H
9 
10 namespace retdec {
11 namespace ctypes {
12 
13 class Visitor;
14 
20 class Visitable
21 {
22  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 ctypes
46 } // namespace retdec
47 
48 #endif
Interface for classes whose instances are visitable by a visitor.
Definition: visitable.h:21
virtual void accept(Visitor *v)=0
Visitor pattern implementation.
A base class of all C-types' visitors.
Definition: visitor.h:33
Definition: archive_wrapper.h:19