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
52private:
53 typedef collection::iterator iterator;
54 typedef collection::const_iterator const_iterator;
55
57
58 TypeList(const TypeList &) = delete;
59 const TypeList &operator=(const TypeList &) = delete;
60};
61
62} // namespace lldb_private
63
64#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:54
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:56
collection::iterator iterator
Definition: TypeList.h:53
void Dump(Stream *s, bool show_context)
Definition: TypeList.cpp:94
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
Definition: lldb-forward.h:457