LLVM  10.0.0svn
DIAEnumFrameData.cpp
Go to the documentation of this file.
1 //==- DIAEnumFrameData.cpp ---------------------------------------*- C++ -*-==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
12 
13 using namespace llvm::pdb;
14 
15 DIAEnumFrameData::DIAEnumFrameData(CComPtr<IDiaEnumFrameData> DiaEnumerator)
16  : Enumerator(DiaEnumerator) {}
17 
19  LONG Count = 0;
20  return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
21 }
22 
23 std::unique_ptr<IPDBFrameData>
25  CComPtr<IDiaFrameData> Item;
26  if (S_OK != Enumerator->Item(Index, &Item))
27  return nullptr;
28 
29  return std::unique_ptr<IPDBFrameData>(new DIAFrameData(Item));
30 }
31 
32 std::unique_ptr<IPDBFrameData> DIAEnumFrameData::getNext() {
33  CComPtr<IDiaFrameData> Item;
34  ULONG NumFetched = 0;
35  if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
36  return nullptr;
37 
38  return std::unique_ptr<IPDBFrameData>(new DIAFrameData(Item));
39 }
40 
41 void DIAEnumFrameData::reset() { Enumerator->Reset(); }
DIAEnumFrameData(CComPtr< IDiaEnumFrameData > DiaEnumerator)
uint32_t getChildCount() const override
ChildTypePtr getChildAtIndex(uint32_t Index) const override
ChildTypePtr getNext() override