TypeList.h revision 314564
1254721Semaste//===-- TypeList.h ----------------------------------------------*- C++ -*-===//
2254721Semaste//
3254721Semaste//                     The LLVM Compiler Infrastructure
4254721Semaste//
5254721Semaste// This file is distributed under the University of Illinois Open Source
6254721Semaste// License. See LICENSE.TXT for details.
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#ifndef liblldb_TypeList_h_
11254721Semaste#define liblldb_TypeList_h_
12254721Semaste
13254721Semaste#include "lldb/Symbol/Type.h"
14258884Semaste#include "lldb/Utility/Iterable.h"
15314564Sdim#include "lldb/lldb-private.h"
16314564Sdim#include <functional>
17296417Sdim#include <vector>
18254721Semaste
19254721Semastenamespace lldb_private {
20254721Semaste
21314564Sdimclass TypeList {
22254721Semastepublic:
23314564Sdim  //------------------------------------------------------------------
24314564Sdim  // Constructors and Destructors
25314564Sdim  //------------------------------------------------------------------
26314564Sdim  TypeList();
27254721Semaste
28314564Sdim  virtual ~TypeList();
29254721Semaste
30314564Sdim  void Clear();
31254721Semaste
32314564Sdim  void Dump(Stream *s, bool show_context);
33254721Semaste
34314564Sdim  //    lldb::TypeSP
35314564Sdim  //    FindType(lldb::user_id_t uid);
36254721Semaste
37314564Sdim  TypeList FindTypes(const ConstString &name);
38254721Semaste
39314564Sdim  void Insert(const lldb::TypeSP &type);
40254721Semaste
41314564Sdim  uint32_t GetSize() const;
42254721Semaste
43314564Sdim  lldb::TypeSP GetTypeAtIndex(uint32_t idx);
44254721Semaste
45314564Sdim  typedef std::vector<lldb::TypeSP> collection;
46314564Sdim  typedef AdaptedIterable<collection, lldb::TypeSP, vector_adapter>
47314564Sdim      TypeIterable;
48254721Semaste
49314564Sdim  TypeIterable Types() { return TypeIterable(m_types); }
50254721Semaste
51314564Sdim  void ForEach(
52314564Sdim      std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
53254721Semaste
54314564Sdim  void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
55254721Semaste
56314564Sdim  void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match);
57254721Semaste
58314564Sdim  void RemoveMismatchedTypes(const std::string &type_scope,
59314564Sdim                             const std::string &type_basename,
60314564Sdim                             lldb::TypeClass type_class, bool exact_match);
61254721Semaste
62314564Sdim  void RemoveMismatchedTypes(lldb::TypeClass type_class);
63314564Sdim
64254721Semasteprivate:
65314564Sdim  typedef collection::iterator iterator;
66314564Sdim  typedef collection::const_iterator const_iterator;
67254721Semaste
68314564Sdim  collection m_types;
69254721Semaste
70314564Sdim  DISALLOW_COPY_AND_ASSIGN(TypeList);
71254721Semaste};
72254721Semaste
73254721Semaste} // namespace lldb_private
74254721Semaste
75314564Sdim#endif // liblldb_TypeList_h_
76