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;
42 typedef llvm::iterator_range<collection::const_iterator> TypeIterable;
43
45
46 void ForEach(
47 std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
48
49 void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
50
51private:
52 typedef collection::iterator iterator;
53 typedef collection::const_iterator const_iterator;
54
56
57 TypeList(const TypeList &) = delete;
58 const TypeList &operator=(const TypeList &) = delete;
59};
60
61} // namespace lldb_private
62
63#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:53
bool Empty() const
Definition TypeList.h:37
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition TypeList.cpp:78
TypeIterable Types()
Definition TypeList.h:44
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition TypeList.cpp:66
collection::iterator iterator
Definition TypeList.h:52
void Dump(Stream *s, bool show_context)
Definition TypeList.cpp:94
llvm::iterator_range< collection::const_iterator > TypeIterable
Definition TypeList.h:42
void Insert(const lldb::TypeSP &type)
Definition TypeList.cpp:27
TypeList(const TypeList &)=delete
const TypeList & operator=(const TypeList &)=delete
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Type > TypeSP