retdec
visit_all_visitor.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_CTYPES_VISIT_ALL_VISITOR_H
8 #define RETDEC_CTYPES_VISIT_ALL_VISITOR_H
9 
10 #include <unordered_set>
11 
12 #include "retdec/ctypes/visitor.h"
13 
14 namespace retdec {
15 namespace ctypes {
16 
17 class Type;
18 
22 class VisitAllVisitor: public Visitor
23 {
24  public:
27  virtual void visit(const std::shared_ptr<ArrayType> &type) override;
28  virtual void visit(const std::shared_ptr<EnumType> &type) override;
29  virtual void visit(const std::shared_ptr<FloatingPointType> &type) override;
30  virtual void visit(const std::shared_ptr<FunctionType> &type) override;
31  virtual void visit(const std::shared_ptr<IntegralType> &type) override;
32  virtual void visit(const std::shared_ptr<NamedType> &type) override;
33  virtual void visit(const std::shared_ptr<PointerType> &type) override;
34  virtual void visit(const std::shared_ptr<ReferenceType> &type) override;
35  virtual void visit(const std::shared_ptr<StructType> &type) override;
36  virtual void visit(const std::shared_ptr<TypedefedType> &type) override;
37  virtual void visit(const std::shared_ptr<UnionType> &type) override;
38  virtual void visit(const std::shared_ptr<UnknownType> &type) override;
39  virtual void visit(const std::shared_ptr<VoidType> &type) override;
41 
42  public:
43  using AccessedTypes = std::unordered_set<std::shared_ptr<Type>>;
44 
45  protected:
46  VisitAllVisitor() = default;
47 
48  bool makeAccessedAndCheckIfAccessed(const std::shared_ptr<Type> &type);
49 
50  protected:
53 
54 };
55 
56 } // namespace ctypes
57 } // namespace retdec
58 
59 #endif
A visitor that visits all types inside some type.
Definition: visit_all_visitor.h:23
std::unordered_set< std::shared_ptr< Type > > AccessedTypes
Definition: visit_all_visitor.h:43
AccessedTypes accessedTypes
A set of all accessed types.
Definition: visit_all_visitor.h:52
virtual void visit(const std::shared_ptr< ArrayType > &type) override
Definition: visit_all_visitor.cpp:27
bool makeAccessedAndCheckIfAccessed(const std::shared_ptr< Type > &type)
Definition: visit_all_visitor.cpp:155
A base class of all C-types' visitors.
Definition: visitor.h:33
A base class of all visitors.
Definition: archive_wrapper.h:19