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
13#include "lldb/lldb-private.h"
14#include <functional>
15#include <map>
16
17namespace lldb_private {
18
19class TypeMap {
20public:
21 // Constructors and Destructors
22 TypeMap();
23
24 virtual ~TypeMap();
25
26 void Clear();
27
28 void Dump(Stream *s, bool show_context,
30
31 void Insert(const lldb::TypeSP &type);
32
33 bool Empty() const;
34
35 bool InsertUnique(const lldb::TypeSP &type);
36
37 uint32_t GetSize() const;
38
39 lldb::TypeSP GetTypeAtIndex(uint32_t idx);
40
41 lldb::TypeSP FirstType() const;
42
43 typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection;
44 typedef llvm::iterator_range<ValueMapIterator<collection::const_iterator>>
46
48
49 void ForEach(
50 std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
51
52 void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
53
54 bool Remove(const lldb::TypeSP &type_sp);
55
56private:
57 typedef collection::iterator iterator;
58 typedef collection::const_iterator const_iterator;
59
61
62 TypeMap(const TypeMap &) = delete;
63 const TypeMap &operator=(const TypeMap &) = delete;
64};
65
66} // namespace lldb_private
67
68#endif // LLDB_SYMBOL_TYPEMAP_H
A stream class that can stream formatted output to a file.
Definition Stream.h:28
TypeIterable Types() const
Definition TypeMap.h:47
llvm::iterator_range< ValueMapIterator< collection::const_iterator > > TypeIterable
Definition TypeMap.h:45
const TypeMap & operator=(const TypeMap &)=delete
lldb::TypeSP FirstType() const
Definition TypeMap.cpp:70
uint32_t GetSize() const
Definition TypeMap.cpp:51
void Insert(const lldb::TypeSP &type)
Definition TypeMap.cpp:27
bool Empty() const
Definition TypeMap.cpp:53
bool Remove(const lldb::TypeSP &type_sp)
Definition TypeMap.cpp:92
collection::const_iterator const_iterator
Definition TypeMap.h:58
TypeMap(const TypeMap &)=delete
bool InsertUnique(const lldb::TypeSP &type)
Definition TypeMap.cpp:34
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition TypeMap.cpp:76
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) const
Definition TypeMap.cpp:106
std::multimap< lldb::user_id_t, lldb::TypeSP > collection
Definition TypeMap.h:43
collection::iterator iterator
Definition TypeMap.h:57
collection m_types
Definition TypeMap.h:60
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition TypeMap.cpp:59
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