]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Symbol/TypeList.h
MFV r337014:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Symbol / TypeList.h
1 //===-- TypeList.h ----------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_TypeList_h_
11 #define liblldb_TypeList_h_
12
13 #include "lldb/Symbol/Type.h"
14 #include "lldb/Utility/Iterable.h"
15 #include "lldb/lldb-private.h"
16 #include <functional>
17 #include <vector>
18
19 namespace lldb_private {
20
21 class TypeList {
22 public:
23   //------------------------------------------------------------------
24   // Constructors and Destructors
25   //------------------------------------------------------------------
26   TypeList();
27
28   virtual ~TypeList();
29
30   void Clear();
31
32   void Dump(Stream *s, bool show_context);
33
34   //    lldb::TypeSP
35   //    FindType(lldb::user_id_t uid);
36
37   TypeList FindTypes(const ConstString &name);
38
39   void Insert(const lldb::TypeSP &type);
40
41   uint32_t GetSize() const;
42
43   lldb::TypeSP GetTypeAtIndex(uint32_t idx);
44
45   typedef std::vector<lldb::TypeSP> collection;
46   typedef AdaptedIterable<collection, lldb::TypeSP, vector_adapter>
47       TypeIterable;
48
49   TypeIterable Types() { return TypeIterable(m_types); }
50
51   void ForEach(
52       std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
53
54   void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
55
56   void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match);
57
58   void RemoveMismatchedTypes(const std::string &type_scope,
59                              const std::string &type_basename,
60                              lldb::TypeClass type_class, bool exact_match);
61
62   void RemoveMismatchedTypes(lldb::TypeClass type_class);
63
64 private:
65   typedef collection::iterator iterator;
66   typedef collection::const_iterator const_iterator;
67
68   collection m_types;
69
70   DISALLOW_COPY_AND_ASSIGN(TypeList);
71 };
72
73 } // namespace lldb_private
74
75 #endif // liblldb_TypeList_h_