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
31 void Insert(const lldb::TypeSP &type);
32
33 uint32_t GetSize() const;
34
35 bool Empty() const { return !GetSize(); }
36
37 lldb::TypeSP GetTypeAtIndex(uint32_t idx);
38
39 typedef std::vector<lldb::TypeSP> collection;
40 typedef llvm::iterator_range<collection::const_iterator> TypeIterable;
41
43
44 void ForEach(
45 std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
46
47 void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
48
49private:
50 typedef collection::iterator iterator;
51 typedef collection::const_iterator const_iterator;
52
54
55 TypeList(const TypeList &) = delete;
56 const TypeList &operator=(const TypeList &) = delete;
57};
58
59} // namespace lldb_private
60
61#endif // LLDB_SYMBOL_TYPELIST_H
A stream class that can stream formatted output to a file.
Definition Stream.h:28
std::vector< lldb::TypeSP > collection
Definition TypeList.h:39
uint32_t GetSize() const
Definition TypeList.cpp:36
collection::const_iterator const_iterator
Definition TypeList.h:51
bool Empty() const
Definition TypeList.h:35
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition TypeList.cpp:54
TypeIterable Types()
Definition TypeList.h:42
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition TypeList.cpp:42
collection::iterator iterator
Definition TypeList.h:50
void Dump(Stream *s, bool show_context)
Definition TypeList.cpp:70
llvm::iterator_range< collection::const_iterator > TypeIterable
Definition TypeList.h:40
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