#include <enum_variant.h>
Definition at line 19 of file enum_variant.h.
◆ EnumVariant()
base::win::EnumVariant::EnumVariant |
( |
ULONG |
count | ) |
|
|
explicit |
Definition at line 16 of file enum_variant.cc.
16 : current_index_(0) {
19}
static const VARIANT kEmptyVariant
◆ Clone()
HRESULT base::win::EnumVariant::Clone |
( |
IEnumVARIANT ** |
out_cloned_object | ) |
|
|
override |
Definition at line 66 of file enum_variant.cc.
66 {
67 if (!out_cloned_object)
68 return E_INVALIDARG;
69
70 size_t count = items_.size();
71 Microsoft::WRL::ComPtr<EnumVariant> other =
72 Microsoft::WRL::Make<EnumVariant>(
static_cast<ULONG>(
count));
74 other->items_[
i] =
static_cast<const VARIANT&
>(items_[
i]);
75
76 other->Skip(current_index_);
77 return other.CopyTo(IID_PPV_ARGS(out_cloned_object));
78}
◆ ItemAt()
VARIANT * base::win::EnumVariant::ItemAt |
( |
ULONG |
index | ) |
|
Definition at line 23 of file enum_variant.cc.
23 {
25
26
27
28 return items_[index].AsInput();
29}
#define BASE_DCHECK(condition)
◆ Next()
HRESULT base::win::EnumVariant::Next |
( |
ULONG |
requested_count, |
|
|
VARIANT * |
out_elements, |
|
|
ULONG * |
out_elements_received |
|
) |
| |
|
override |
Definition at line 31 of file enum_variant.cc.
33 {
34 if (!out_elements)
35 return E_INVALIDARG;
36
38 ULONG available_count =
static_cast<ULONG>(items_.size()) - current_index_;
41 out_elements[
i] = items_[current_index_ +
i].Copy();
42 current_index_ +=
count;
43
44
45
46 if (out_elements_received)
47 *out_elements_received =
count;
48
49 return (
count == requested_count ? S_OK : S_FALSE);
50}
static float min(float r, float g, float b)
◆ Reset()
HRESULT base::win::EnumVariant::Reset |
( |
| ) |
|
|
override |
Definition at line 61 of file enum_variant.cc.
61 {
62 current_index_ = 0;
63 return S_OK;
64}
◆ Skip()
HRESULT base::win::EnumVariant::Skip |
( |
ULONG |
skip_count | ) |
|
|
override |
Definition at line 52 of file enum_variant.cc.
52 {
54 if (current_index_ +
count >
static_cast<ULONG>(items_.size()))
55 count =
static_cast<ULONG>(items_.size()) - current_index_;
56
57 current_index_ +=
count;
58 return (
count == skip_count ? S_OK : S_FALSE);
59}
The documentation for this class was generated from the following files: