OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_WIN_ENUM_VARIANT_H_ | 5 #ifndef BASE_WIN_ENUM_VARIANT_H_ |
6 #define BASE_WIN_ENUM_VARIANT_H_ | 6 #define BASE_WIN_ENUM_VARIANT_H_ |
7 | 7 |
8 #include <unknwn.h> | 8 #include <unknwn.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include <memory> |
| 11 |
11 #include "base/win/iunknown_impl.h" | 12 #include "base/win/iunknown_impl.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 namespace win { | 15 namespace win { |
15 | 16 |
16 // A simple implementation of IEnumVARIANT. | 17 // A simple implementation of IEnumVARIANT. |
17 class BASE_EXPORT EnumVariant | 18 class BASE_EXPORT EnumVariant |
18 : public IEnumVARIANT, | 19 : public IEnumVARIANT, |
19 public IUnknownImpl { | 20 public IUnknownImpl { |
20 public: | 21 public: |
(...skipping 13 matching lines...) Expand all Loading... |
34 STDMETHODIMP Next(ULONG requested_count, | 35 STDMETHODIMP Next(ULONG requested_count, |
35 VARIANT* out_elements, | 36 VARIANT* out_elements, |
36 ULONG* out_elements_received) override; | 37 ULONG* out_elements_received) override; |
37 STDMETHODIMP Skip(ULONG skip_count) override; | 38 STDMETHODIMP Skip(ULONG skip_count) override; |
38 STDMETHODIMP Reset() override; | 39 STDMETHODIMP Reset() override; |
39 STDMETHODIMP Clone(IEnumVARIANT** out_cloned_object) override; | 40 STDMETHODIMP Clone(IEnumVARIANT** out_cloned_object) override; |
40 | 41 |
41 private: | 42 private: |
42 ~EnumVariant() override; | 43 ~EnumVariant() override; |
43 | 44 |
44 scoped_ptr<VARIANT[]> items_; | 45 std::unique_ptr<VARIANT[]> items_; |
45 unsigned long count_; | 46 unsigned long count_; |
46 unsigned long current_index_; | 47 unsigned long current_index_; |
47 }; | 48 }; |
48 | 49 |
49 } // namespace win | 50 } // namespace win |
50 } // namespace base | 51 } // namespace base |
51 | 52 |
52 #endif // BASE_WIN_ENUM_VARIANT_H_ | 53 #endif // BASE_WIN_ENUM_VARIANT_H_ |
OLD | NEW |