OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_CPP_VAR_RESOURCE_DEV_H_ |
| 6 #define PPAPI_CPP_VAR_RESOURCE_DEV_H_ |
| 7 |
| 8 #include "ppapi/cpp/resource.h" |
| 9 #include "ppapi/cpp/var.h" |
| 10 |
| 11 /// @file |
| 12 /// This file defines the API for interacting with resource vars. |
| 13 |
| 14 namespace pp { |
| 15 |
| 16 class VarResource_Dev : public Var { |
| 17 public: |
| 18 /// Constructs a <code>VarResource_Dev</code> given a resource. |
| 19 explicit VarResource_Dev(const pp::Resource& resource); |
| 20 |
| 21 /// Constructs a <code>VarResource_Dev</code> given a var for which |
| 22 /// is_resource() is true. This will refer to the same resource var, but allow |
| 23 /// you to access methods specific to resources. |
| 24 /// |
| 25 /// @param[in] var A resource var. |
| 26 explicit VarResource_Dev(const Var& var); |
| 27 |
| 28 /// Constructs a <code>VarResource_Dev</code> given a <code>PP_Var</code> of |
| 29 /// type PP_VARTYPE_RESOURCE. |
| 30 /// |
| 31 /// @param[in] var A <code>PP_Var</code> of type PP_VARTYPE_RESOURCE. |
| 32 explicit VarResource_Dev(const PP_Var& var); |
| 33 |
| 34 /// Copy constructor. |
| 35 VarResource_Dev(const VarResource_Dev& other); |
| 36 |
| 37 virtual ~VarResource_Dev(); |
| 38 |
| 39 /// Assignment operator. |
| 40 VarResource_Dev& operator=(const VarResource_Dev& other); |
| 41 |
| 42 /// The <code>Var</code> assignment operator is overridden here so that we can |
| 43 /// check for assigning a non-resource var to a <code>VarResource_Dev</code>. |
| 44 /// |
| 45 /// @param[in] other The resource var to be assigned. |
| 46 /// |
| 47 /// @return The resulting <code>VarResource_Dev</code> (as a |
| 48 /// <code>Var</code>&). |
| 49 virtual Var& operator=(const Var& other); |
| 50 |
| 51 /// Gets the resource contained in the var. |
| 52 /// |
| 53 /// @return The <code>pp::Resource</code> that is contained in the var. |
| 54 pp::Resource ToResource(); |
| 55 }; |
| 56 |
| 57 } // namespace pp |
| 58 |
| 59 #endif // PPAPI_CPP_VAR_RESOURCE_DEV_H_ |
OLD | NEW |