LLDB  mainline
TypeList.h
Go to the documentation of this file.
1 //===-- TypeList.h ----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_TypeList_h_
10 #define liblldb_TypeList_h_
11 
12 #include "lldb/Symbol/Type.h"
13 #include "lldb/Utility/Iterable.h"
14 #include "lldb/lldb-private.h"
15 #include <functional>
16 #include <vector>
17 
18 namespace lldb_private {
19 
20 class TypeList {
21 public:
22  // Constructors and Destructors
23  TypeList();
24 
25  virtual ~TypeList();
26 
27  void Clear();
28 
29  void Dump(Stream *s, bool show_context);
30 
31  // lldb::TypeSP
32  // FindType(lldb::user_id_t uid);
33 
35 
36  void Insert(const lldb::TypeSP &type);
37 
38  uint32_t GetSize() const;
39 
40  lldb::TypeSP GetTypeAtIndex(uint32_t idx);
41 
42  typedef std::vector<lldb::TypeSP> collection;
45 
46  TypeIterable Types() { return TypeIterable(m_types); }
47 
48  void ForEach(
49  std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
50 
51  void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
52 
53  void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match);
54 
55  void RemoveMismatchedTypes(const std::string &type_scope,
56  const std::string &type_basename,
57  lldb::TypeClass type_class, bool exact_match);
58 
59  void RemoveMismatchedTypes(lldb::TypeClass type_class);
60 
61 private:
62  typedef collection::iterator iterator;
63  typedef collection::const_iterator const_iterator;
64 
65  collection m_types;
66 
67  DISALLOW_COPY_AND_ASSIGN(TypeList);
68 };
69 
70 } // namespace lldb_private
71 
72 #endif // liblldb_TypeList_h_
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeList.cpp:66
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
std::vector< lldb::TypeSP > collection
Definition: TypeList.h:42
uint32_t GetSize() const
Definition: TypeList.cpp:60
void Insert(const lldb::TypeSP &type)
Definition: TypeList.cpp:27
void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match)
Definition: TypeList.cpp:100
void Dump(Stream *s, bool show_context)
Definition: TypeList.cpp:94
TypeList FindTypes(ConstString name)
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition: TypeList.cpp:78
A uniqued constant string class.
Definition: ConstString.h:38
TypeIterable Types()
Definition: TypeList.h:46
AdaptedIterable< collection, lldb::TypeSP, vector_adapter > TypeIterable
Definition: TypeList.h:44