LLDB mainline
TypeMap.h
Go to the documentation of this file.
1//===-- TypeMap.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_TYPEMAP_H
10#define LLDB_SYMBOL_TYPEMAP_H
11
12#include "lldb/Symbol/Type.h"
14#include "lldb/lldb-private.h"
15#include <functional>
16#include <map>
17
18namespace lldb_private {
19
20class TypeMap {
21public:
22 // Constructors and Destructors
23 TypeMap();
24
25 virtual ~TypeMap();
26
27 void Clear();
28
29 void Dump(Stream *s, bool show_context,
31
33
34 void Insert(const lldb::TypeSP &type);
35
36 bool Empty() const;
37
38 bool InsertUnique(const lldb::TypeSP &type);
39
40 uint32_t GetSize() const;
41
42 lldb::TypeSP GetTypeAtIndex(uint32_t idx);
43
44 lldb::TypeSP FirstType() const;
45
46 typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection;
47 typedef llvm::iterator_range<ValueMapIterator<collection::const_iterator>>
49
51
52 void ForEach(
53 std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
54
55 void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
56
57 bool Remove(const lldb::TypeSP &type_sp);
58
59private:
60 typedef collection::iterator iterator;
61 typedef collection::const_iterator const_iterator;
62
64
65 TypeMap(const TypeMap &) = delete;
66 const TypeMap &operator=(const TypeMap &) = delete;
67};
68
69} // namespace lldb_private
70
71#endif // LLDB_SYMBOL_TYPEMAP_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
TypeIterable Types() const
Definition TypeMap.h:50
llvm::iterator_range< ValueMapIterator< collection::const_iterator > > TypeIterable
Definition TypeMap.h:48
const TypeMap & operator=(const TypeMap &)=delete
lldb::TypeSP FirstType() const
Definition TypeMap.cpp:94
uint32_t GetSize() const
Definition TypeMap.cpp:75
void Insert(const lldb::TypeSP &type)
Definition TypeMap.cpp:27
bool Empty() const
Definition TypeMap.cpp:77
bool Remove(const lldb::TypeSP &type_sp)
Definition TypeMap.cpp:116
collection::const_iterator const_iterator
Definition TypeMap.h:61
TypeMap(const TypeMap &)=delete
bool InsertUnique(const lldb::TypeSP &type)
Definition TypeMap.cpp:34
TypeMap FindTypes(ConstString name)
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition TypeMap.cpp:100
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) const
Definition TypeMap.cpp:130
std::multimap< lldb::user_id_t, lldb::TypeSP > collection
Definition TypeMap.h:46
collection::iterator iterator
Definition TypeMap.h:60
collection m_types
Definition TypeMap.h:63
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition TypeMap.cpp:83
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelFull
std::shared_ptr< lldb_private::Type > TypeSP