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"
14#include "lldb/lldb-private.h"
15#include <functional>
16#include <vector>
17
18namespace lldb_private {
19
20class TypeList {
21public:
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(llvm::StringRef qualified_typename,
53 bool exact_match);
54
55 void RemoveMismatchedTypes(llvm::StringRef type_scope,
56 llvm::StringRef type_basename,
57 lldb::TypeClass type_class, bool exact_match);
58
59 void RemoveMismatchedTypes(lldb::TypeClass type_class);
60
61private:
62 typedef collection::iterator iterator;
63 typedef collection::const_iterator const_iterator;
64
66
67 TypeList(const TypeList &) = delete;
68 const TypeList &operator=(const TypeList &) = delete;
69};
70
71} // namespace lldb_private
72
73#endif // LLDB_SYMBOL_TYPELIST_H
A uniqued constant string class.
Definition: ConstString.h:40
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
std::vector< lldb::TypeSP > collection
Definition: TypeList.h:41
uint32_t GetSize() const
Definition: TypeList.cpp:60
TypeList FindTypes(ConstString name)
collection::const_iterator const_iterator
Definition: TypeList.h:63
bool Empty() const
Definition: TypeList.h:37
AdaptedIterable< collection, lldb::TypeSP, vector_adapter > TypeIterable
Definition: TypeList.h:43
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition: TypeList.cpp:78
TypeIterable Types()
Definition: TypeList.h:45
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeList.cpp:66
collection m_types
Definition: TypeList.h:65
collection::iterator iterator
Definition: TypeList.h:62
void Dump(Stream *s, bool show_context)
Definition: TypeList.cpp:94
void Insert(const lldb::TypeSP &type)
Definition: TypeList.cpp:27
void RemoveMismatchedTypes(lldb::TypeClass type_class)
TypeList(const TypeList &)=delete
void RemoveMismatchedTypes(llvm::StringRef qualified_typename, bool exact_match)
Definition: TypeList.cpp:100
const TypeList & operator=(const TypeList &)=delete
void RemoveMismatchedTypes(llvm::StringRef type_scope, llvm::StringRef type_basename, lldb::TypeClass type_class, bool exact_match)
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::Type > TypeSP
Definition: lldb-forward.h:449