aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Symbol/TypeList.h
blob: 9c74db6bf1f4a00ba43472bcf3bdad72bb58b4b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//===-- TypeList.h ----------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_TypeList_h_
#define liblldb_TypeList_h_

#include "lldb/lldb-private.h"
#include "lldb/Symbol/Type.h"
#include <map>

namespace lldb_private {

class TypeList
{
public:
    //------------------------------------------------------------------
    // Constructors and Destructors
    //------------------------------------------------------------------
    TypeList();

    virtual
    ~TypeList();

    void
    Clear();

    void
    Dump(Stream *s, bool show_context);

//    lldb::TypeSP
//    FindType(lldb::user_id_t uid);

    TypeList
    FindTypes(const ConstString &name);

    void
    Insert (const lldb::TypeSP& type);

    bool
    InsertUnique (const lldb::TypeSP& type);

    uint32_t
    GetSize() const;

    lldb::TypeSP
    GetTypeAtIndex(uint32_t idx);

    void
    ForEach (std::function <bool(const lldb::TypeSP &type_sp)> const &callback) const;

    void
    ForEach (std::function <bool(lldb::TypeSP &type_sp)> const &callback);

    bool
    RemoveTypeWithUID (lldb::user_id_t uid);

    void
    RemoveMismatchedTypes (const char *qualified_typename,
                           bool exact_match);

    void
    RemoveMismatchedTypes (const std::string &type_scope,
                           const std::string &type_basename,
                           lldb::TypeClass type_class,
                           bool exact_match);

    void
    RemoveMismatchedTypes (lldb::TypeClass type_class);

private:
    typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection;
    typedef collection::iterator iterator;
    typedef collection::const_iterator const_iterator;

    collection m_types;

    DISALLOW_COPY_AND_ASSIGN (TypeList);
};

} // namespace lldb_private

#endif  // liblldb_TypeList_h_