LLVM  8.0.1
DIAEnumFrameData.cpp
Go to the documentation of this file.
1 //==- DIAEnumFrameData.cpp ---------------------------------------*- 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 
13 
14 using namespace llvm::pdb;
15 
16 DIAEnumFrameData::DIAEnumFrameData(CComPtr<IDiaEnumFrameData> DiaEnumerator)
17  : Enumerator(DiaEnumerator) {}
18 
20  LONG Count = 0;
21  return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
22 }
23 
24 std::unique_ptr<IPDBFrameData>
26  CComPtr<IDiaFrameData> Item;
27  if (S_OK != Enumerator->Item(Index, &Item))
28  return nullptr;
29 
30  return std::unique_ptr<IPDBFrameData>(new DIAFrameData(Item));
31 }
32 
33 std::unique_ptr<IPDBFrameData> DIAEnumFrameData::getNext() {
34  CComPtr<IDiaFrameData> Item;
35  ULONG NumFetched = 0;
36  if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
37  return nullptr;
38 
39  return std::unique_ptr<IPDBFrameData>(new DIAFrameData(Item));
40 }
41 
42 void DIAEnumFrameData::reset() { Enumerator->Reset(); }
DIAEnumFrameData(CComPtr< IDiaEnumFrameData > DiaEnumerator)
uint32_t getChildCount() const override
ChildTypePtr getChildAtIndex(uint32_t Index) const override
ChildTypePtr getNext() override