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"
13 #include "lldb/Utility/Iterable.h"
14 #include "lldb/lldb-private.h"
15 #include <functional>
16 #include <map>
17 
18 namespace lldb_private {
19 
20 class TypeMap {
21 public:
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  typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection;
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 
56  void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match);
57 
58  void RemoveMismatchedTypes(const std::string &type_scope,
59  const std::string &type_basename,
60  lldb::TypeClass type_class, bool exact_match);
61 
62  void RemoveMismatchedTypes(lldb::TypeClass type_class);
63 
64 private:
65  typedef collection::iterator iterator;
66  typedef collection::const_iterator const_iterator;
67 
69 
70  TypeMap(const TypeMap &) = delete;
71  const TypeMap &operator=(const TypeMap &) = delete;
72 };
73 
74 } // namespace lldb_private
75 
76 #endif // LLDB_SYMBOL_TYPEMAP_H
lldb_private::TypeMap::~TypeMap
virtual ~TypeMap()
lldb_private::TypeMap::GetTypeAtIndex
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeMap.cpp:83
lldb_private::TypeMap::Types
TypeIterable Types()
Definition: TypeMap.h:47
lldb_private::TypeMap::Clear
void Clear()
Definition: TypeMap.cpp:73
lldb_private::AdaptedIterable
Definition: Iterable.h:153
lldb_private::TypeMap::RemoveMismatchedTypes
void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match)
Definition: TypeMap.cpp:130
lldb_private::Stream
Definition: Stream.h:28
lldb_private::TypeMap::GetSize
uint32_t GetSize() const
Definition: TypeMap.cpp:75
lldb_private::TypeMap::FindTypes
TypeMap FindTypes(ConstString name)
lldb_private::TypeMap::iterator
collection::iterator iterator
Definition: TypeMap.h:65
lldb_private::TypeMap::Empty
bool Empty() const
Definition: TypeMap.cpp:77
Type.h
lldb_private::TypeMap::const_iterator
collection::const_iterator const_iterator
Definition: TypeMap.h:66
lldb_private::ConstString
Definition: ConstString.h:40
lldb::eDescriptionLevelFull
@ eDescriptionLevelFull
Definition: lldb-enumerations.h:209
lldb_private::TypeMap::m_types
collection m_types
Definition: TypeMap.h:68
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::TypeMap::TypeIterable
AdaptedIterable< collection, lldb::TypeSP, map_adapter > TypeIterable
Definition: TypeMap.h:45
lldb_private::TypeMap::operator=
const TypeMap & operator=(const TypeMap &)=delete
lldb_private::TypeMap
Definition: TypeMap.h:20
lldb-private.h
Iterable.h
lldb_private::TypeMap::InsertUnique
bool InsertUnique(const lldb::TypeSP &type)
Definition: TypeMap.cpp:34
uint32_t
lldb_private::TypeMap::Dump
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
Definition: TypeMap.cpp:124
lldb_private::TypeMap::ForEach
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
Definition: TypeMap.cpp:94
lldb_private::TypeMap::TypeMap
TypeMap()
Definition: TypeMap.cpp:22
lldb_private::TypeMap::Insert
void Insert(const lldb::TypeSP &type)
Definition: TypeMap.cpp:27
lldb_private::TypeMap::Remove
bool Remove(const lldb::TypeSP &type_sp)
Definition: TypeMap.cpp:110
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::TypeMap::collection
std::multimap< lldb::user_id_t, lldb::TypeSP > collection
Definition: TypeMap.h:44
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207