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
17namespace lldb_private {
18
19class TypeList
20{
21public:
22    //------------------------------------------------------------------
23    // Constructors and Destructors
24    //------------------------------------------------------------------
25    TypeList();
26
27    virtual
28    ~TypeList();
29
30    void
31    Clear();
32
33    void
34    Dump(Stream *s, bool show_context);
35
36//    lldb::TypeSP
37//    FindType(lldb::user_id_t uid);
38
39    TypeList
40    FindTypes(const ConstString &name);
41
42    void
43    Insert (const lldb::TypeSP& type);
44
45    bool
46    InsertUnique (const lldb::TypeSP& type);
47
48    uint32_t
49    GetSize() const;
50
51    lldb::TypeSP
52    GetTypeAtIndex(uint32_t idx);
53
54    void
55    ForEach (std::function <bool(const lldb::TypeSP &type_sp)> const &callback) const;
56
57    void
58    ForEach (std::function <bool(lldb::TypeSP &type_sp)> const &callback);
59
60    bool
61    RemoveTypeWithUID (lldb::user_id_t uid);
62
63    void
64    RemoveMismatchedTypes (const char *qualified_typename,
65                           bool exact_match);
66
67    void
68    RemoveMismatchedTypes (const std::string &type_scope,
69                           const std::string &type_basename,
70                           lldb::TypeClass type_class,
71                           bool exact_match);
72
73    void
74    RemoveMismatchedTypes (lldb::TypeClass type_class);
75
76private:
77    typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection;
78    typedef collection::iterator iterator;
79    typedef collection::const_iterator const_iterator;
80
81    collection m_types;
82
83    DISALLOW_COPY_AND_ASSIGN (TypeList);
84};
85
86} // namespace lldb_private
87
88#endif  // liblldb_TypeList_h_
89