LLVM  8.0.1
IPDBEnumChildren.h
Go to the documentation of this file.
1 //===- IPDBEnumChildren.h - base interface for child enumerator -*- 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 LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
11 #define LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
12 
13 #include <cassert>
14 #include <cstdint>
15 #include <memory>
16 
17 namespace llvm {
18 namespace pdb {
19 
20 template <typename ChildType> class IPDBEnumChildren {
21 public:
22  using ChildTypePtr = std::unique_ptr<ChildType>;
24 
25  virtual ~IPDBEnumChildren() = default;
26 
27  virtual uint32_t getChildCount() const = 0;
28  virtual ChildTypePtr getChildAtIndex(uint32_t Index) const = 0;
29  virtual ChildTypePtr getNext() = 0;
30  virtual void reset() = 0;
31 };
32 
33 template <typename ChildType>
34 class NullEnumerator : public IPDBEnumChildren<ChildType> {
35  virtual uint32_t getChildCount() const override { return 0; }
36  virtual std::unique_ptr<ChildType>
37  getChildAtIndex(uint32_t Index) const override {
38  return nullptr;
39  }
40  virtual std::unique_ptr<ChildType> getNext() override {
41  return nullptr;
42  }
43  virtual void reset() override {}
44 };
45 
46 } // end namespace pdb
47 } // end namespace llvm
48 
49 #endif // LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
std::unique_ptr< IPDBDataStream > ChildTypePtr
This class represents lattice values for constants.
Definition: AllocatorList.h:24
virtual ChildTypePtr getChildAtIndex(uint32_t Index) const =0
virtual uint32_t getChildCount() const =0
virtual ~IPDBEnumChildren()=default
virtual ChildTypePtr getNext()=0