1 //===-- TypeMap.h ----------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_TypeMap_h_
11 #define liblldb_TypeMap_h_
13 #include "lldb/Symbol/Type.h"
14 #include "lldb/Utility/Iterable.h"
15 #include "lldb/lldb-private.h"
19 namespace lldb_private {
23 //------------------------------------------------------------------
24 // Constructors and Destructors
25 //------------------------------------------------------------------
32 void Dump(Stream *s, bool show_context);
34 TypeMap FindTypes(const ConstString &name);
36 void Insert(const lldb::TypeSP &type);
40 bool InsertUnique(const lldb::TypeSP &type);
42 uint32_t GetSize() const;
44 lldb::TypeSP GetTypeAtIndex(uint32_t idx);
46 typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection;
47 typedef AdaptedIterable<collection, lldb::TypeSP, map_adapter> TypeIterable;
49 TypeIterable Types() { return TypeIterable(m_types); }
52 std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
54 void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
56 bool Remove(const lldb::TypeSP &type_sp);
58 void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match);
60 void RemoveMismatchedTypes(const std::string &type_scope,
61 const std::string &type_basename,
62 lldb::TypeClass type_class, bool exact_match);
64 void RemoveMismatchedTypes(lldb::TypeClass type_class);
67 typedef collection::iterator iterator;
68 typedef collection::const_iterator const_iterator;
72 DISALLOW_COPY_AND_ASSIGN(TypeMap);
75 } // namespace lldb_private
77 #endif // liblldb_TypeMap_h_