5 #ifndef PPAPI_CPP_EXTENSIONS_OUTPUT_TRAITS_H_
6 #define PPAPI_CPP_EXTENSIONS_OUTPUT_TRAITS_H_
10 #include "ppapi/c/pp_var.h"
28 PP_DCHECK(pp_var_.type == PP_VARTYPE_UNDEFINED);
35 converter_.Set(pp_var_);
36 pp_var_ = PP_MakeUndefined();
37 return converter_.value();
86 PP_DCHECK(pp_var_.type == PP_VARTYPE_UNDEFINED);
95 pp_var_ = PP_MakeUndefined();
100 output_storage_.reserve(length);
101 for (uint32_t i = 0; i < length; ++i) {
103 output_storage_.push_back(converter.value());
107 return output_storage_;
112 std::vector<T> output_storage_;
142 #endif // PPAPI_CPP_EXTENSIONS_OUTPUT_TRAITS_H_
VarOutputAdapterWithStorage< T > StorageType
ArrayVarOutputAdapterWithStorage< T > StorageType
uint32_t GetLength() const
static void Initialize(StorageType *)
VarOutputAdapterWithStorage()
~ArrayVarOutputAdapterWithStorage()
static T & StorageToPluginArg(StorageType &t)
const PP_Var & pp_var() const
std::vector< T > & output()
static APIArgType StorageToAPIArg(StorageType &t)
ArrayVarOutputAdapterWithStorage()
static std::vector< T > & StorageToPluginArg(StorageType &t)
static APIArgType StorageToAPIArg(StorageType &t)
~VarOutputAdapterWithStorage()
A generic type used for passing data types between the module and the page.
static void Initialize(StorageType *)
Var Get(uint32_t index) const