Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:52

0001 //===-- TypeList.h ----------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_SYMBOL_TYPELIST_H
0010 #define LLDB_SYMBOL_TYPELIST_H
0011 
0012 #include "lldb/Symbol/Type.h"
0013 #include "lldb/Utility/Iterable.h"
0014 #include "lldb/lldb-private.h"
0015 #include <functional>
0016 #include <vector>
0017 
0018 namespace lldb_private {
0019 
0020 class TypeList {
0021 public:
0022   // Constructors and Destructors
0023   TypeList();
0024 
0025   virtual ~TypeList();
0026 
0027   void Clear();
0028 
0029   void Dump(Stream *s, bool show_context);
0030 
0031   TypeList FindTypes(ConstString name);
0032 
0033   void Insert(const lldb::TypeSP &type);
0034 
0035   uint32_t GetSize() const;
0036 
0037   bool Empty() const { return !GetSize(); }
0038 
0039   lldb::TypeSP GetTypeAtIndex(uint32_t idx);
0040 
0041   typedef std::vector<lldb::TypeSP> collection;
0042   typedef AdaptedIterable<collection, lldb::TypeSP, vector_adapter>
0043       TypeIterable;
0044 
0045   TypeIterable Types() { return TypeIterable(m_types); }
0046 
0047   void ForEach(
0048       std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
0049 
0050   void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
0051 
0052 private:
0053   typedef collection::iterator iterator;
0054   typedef collection::const_iterator const_iterator;
0055 
0056   collection m_types;
0057 
0058   TypeList(const TypeList &) = delete;
0059   const TypeList &operator=(const TypeList &) = delete;
0060 };
0061 
0062 } // namespace lldb_private
0063 
0064 #endif // LLDB_SYMBOL_TYPELIST_H