2019-01-16 02:18:06 +00:00
|
|
|
//* Copyright 2019 The Dawn Authors
|
|
|
|
//*
|
|
|
|
//* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
//* you may not use this file except in compliance with the License.
|
|
|
|
//* You may obtain a copy of the License at
|
|
|
|
//*
|
|
|
|
//* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//*
|
|
|
|
//* Unless required by applicable law or agreed to in writing, software
|
|
|
|
//* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
//* See the License for the specific language governing permissions and
|
|
|
|
//* limitations under the License.
|
|
|
|
|
|
|
|
#ifndef DAWNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_
|
|
|
|
#define DAWNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_
|
|
|
|
|
2022-02-04 12:51:25 +00:00
|
|
|
#include "dawn/wire/ObjectType_autogen.h"
|
|
|
|
#include "dawn/wire/client/ObjectBase.h"
|
2020-11-11 19:46:18 +00:00
|
|
|
|
2022-01-11 09:57:33 +00:00
|
|
|
namespace dawn::wire::client {
|
2020-06-30 18:39:50 +00:00
|
|
|
|
2020-11-11 19:46:18 +00:00
|
|
|
template <typename T>
|
2020-11-20 09:38:56 +00:00
|
|
|
struct ObjectTypeToTypeEnum {
|
|
|
|
static constexpr ObjectType value = static_cast<ObjectType>(-1);
|
|
|
|
};
|
2020-11-11 19:46:18 +00:00
|
|
|
|
2020-06-30 18:39:50 +00:00
|
|
|
{% for type in by_category["object"] %}
|
|
|
|
{% set Type = type.name.CamelCase() %}
|
|
|
|
{% if type.name.CamelCase() in client_special_objects %}
|
|
|
|
class {{Type}};
|
|
|
|
{% else %}
|
2020-11-11 21:01:18 +00:00
|
|
|
struct {{type.name.CamelCase()}} final : ObjectBase {
|
2020-06-30 18:39:50 +00:00
|
|
|
using ObjectBase::ObjectBase;
|
|
|
|
};
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
inline {{Type}}* FromAPI(WGPU{{Type}} obj) {
|
|
|
|
return reinterpret_cast<{{Type}}*>(obj);
|
|
|
|
}
|
|
|
|
inline WGPU{{Type}} ToAPI({{Type}}* obj) {
|
|
|
|
return reinterpret_cast<WGPU{{Type}}>(obj);
|
|
|
|
}
|
|
|
|
|
2020-11-11 19:46:18 +00:00
|
|
|
template <>
|
2020-11-20 09:38:56 +00:00
|
|
|
struct ObjectTypeToTypeEnum<{{Type}}> {
|
|
|
|
static constexpr ObjectType value = ObjectType::{{Type}};
|
|
|
|
};
|
2020-11-11 19:46:18 +00:00
|
|
|
|
2019-01-16 02:18:06 +00:00
|
|
|
{% endfor %}
|
2022-01-11 09:57:33 +00:00
|
|
|
} // namespace dawn::wire::client
|
2019-01-16 02:18:06 +00:00
|
|
|
|
|
|
|
#endif // DAWNWIRE_CLIENT_APIOBJECTS_AUTOGEN_H_
|