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 LLDB_SYMBOL_TYPELIST_H
10 #define LLDB_SYMBOL_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 
32 
33  void Insert(const lldb::TypeSP &type);
34 
35  uint32_t GetSize() const;
36 
37  bool Empty() const { return !GetSize(); }
38 
39  lldb::TypeSP GetTypeAtIndex(uint32_t idx);
40 
41  typedef std::vector<lldb::TypeSP> collection;
44 
46 
47  void ForEach(
48  std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
49 
50  void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
51 
52  void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match);
53 
54  void RemoveMismatchedTypes(const std::string &type_scope,
55  const std::string &type_basename,
56  lldb::TypeClass type_class, bool exact_match);
57 
58  void RemoveMismatchedTypes(lldb::TypeClass type_class);
59 
60 private:
61  typedef collection::iterator iterator;
62  typedef collection::const_iterator const_iterator;
63 
65 
66  TypeList(const TypeList &) = delete;
67  const TypeList &operator=(const TypeList &) = delete;
68 };
69 
70 } // namespace lldb_private
71 
72 #endif // LLDB_SYMBOL_TYPELIST_H
lldb_private::TypeList::const_iterator
collection::const_iterator const_iterator
Definition: TypeList.h:62
lldb_private::TypeList::collection
std::vector< lldb::TypeSP > collection
Definition: TypeList.h:41
lldb_private::AdaptedIterable
Definition: Iterable.h:153
lldb_private::Stream
Definition: Stream.h:28
lldb_private::TypeList::GetTypeAtIndex
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeList.cpp:66
lldb_private::TypeList::Dump
void Dump(Stream *s, bool show_context)
Definition: TypeList.cpp:94
lldb_private::TypeList::ForEach
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition: TypeList.cpp:78
lldb_private::TypeList::iterator
collection::iterator iterator
Definition: TypeList.h:61
lldb_private::TypeList::~TypeList
virtual ~TypeList()
lldb_private::TypeList::operator=
const TypeList & operator=(const TypeList &)=delete
lldb_private::TypeList::Empty
bool Empty() const
Definition: TypeList.h:37
lldb_private::TypeList::Insert
void Insert(const lldb::TypeSP &type)
Definition: TypeList.cpp:27
lldb_private::TypeList::TypeIterable
AdaptedIterable< collection, lldb::TypeSP, vector_adapter > TypeIterable
Definition: TypeList.h:43
lldb_private::TypeList::Clear
void Clear()
Definition: TypeList.cpp:58
lldb_private::TypeList::TypeList
TypeList()
Definition: TypeList.cpp:22
Type.h
lldb_private::TypeList::GetSize
uint32_t GetSize() const
Definition: TypeList.cpp:60
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::TypeList::RemoveMismatchedTypes
void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match)
Definition: TypeList.cpp:100
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb-private.h
Iterable.h
uint32_t
lldb_private::TypeList::FindTypes
TypeList FindTypes(ConstString name)
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::TypeList
Definition: TypeList.h:20
lldb_private::TypeList::m_types
collection m_types
Definition: TypeList.h:64
lldb_private::TypeList::Types
TypeIterable Types()
Definition: TypeList.h:45