TypeList.h revision 263363
1//===-- TypeList.h ----------------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef liblldb_TypeList_h_ 11#define liblldb_TypeList_h_ 12 13#include "lldb/lldb-private.h" 14#include "lldb/Symbol/Type.h" 15#include <map> 16#include <functional> 17 18namespace lldb_private { 19 20class TypeList 21{ 22public: 23 //------------------------------------------------------------------ 24 // Constructors and Destructors 25 //------------------------------------------------------------------ 26 TypeList(); 27 28 virtual 29 ~TypeList(); 30 31 void 32 Clear(); 33 34 void 35 Dump(Stream *s, bool show_context); 36 37// lldb::TypeSP 38// FindType(lldb::user_id_t uid); 39 40 TypeList 41 FindTypes(const ConstString &name); 42 43 void 44 Insert (const lldb::TypeSP& type); 45 46 bool 47 InsertUnique (const lldb::TypeSP& type); 48 49 uint32_t 50 GetSize() const; 51 52 lldb::TypeSP 53 GetTypeAtIndex(uint32_t idx); 54 55 void 56 ForEach (std::function <bool(const lldb::TypeSP &type_sp)> const &callback) const; 57 58 void 59 ForEach (std::function <bool(lldb::TypeSP &type_sp)> const &callback); 60 61 bool 62 RemoveTypeWithUID (lldb::user_id_t uid); 63 64 void 65 RemoveMismatchedTypes (const char *qualified_typename, 66 bool exact_match); 67 68 void 69 RemoveMismatchedTypes (const std::string &type_scope, 70 const std::string &type_basename, 71 lldb::TypeClass type_class, 72 bool exact_match); 73 74 void 75 RemoveMismatchedTypes (lldb::TypeClass type_class); 76 77private: 78 typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection; 79 typedef collection::iterator iterator; 80 typedef collection::const_iterator const_iterator; 81 82 collection m_types; 83 84 DISALLOW_COPY_AND_ASSIGN (TypeList); 85}; 86 87} // namespace lldb_private 88 89#endif // liblldb_TypeList_h_ 90