/* * Copyright (c) 2024 Huawei Device Co., Ltd. * 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. */ #include #include #include #include #include #include META_BEGIN_NAMESPACE() // clang-format off using SingleAndArrayTypes = TypeList< bool, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, float, double, #ifdef __APPLE__ size_t, #endif BASE_NS::Math::Vec2, BASE_NS::Math::Vec3, BASE_NS::Math::Vec4, BASE_NS::Math::UVec2, BASE_NS::Math::UVec3, BASE_NS::Math::UVec4, BASE_NS::Math::IVec2, BASE_NS::Math::IVec3, BASE_NS::Math::IVec4, BASE_NS::Math::Quat, BASE_NS::Math::Mat3X3, BASE_NS::Math::Mat4X4, BASE_NS::Uid, CORE_NS::Entity, CORE_NS::EntityReference, BASE_NS::string, CORE_NS::IPropertyHandle* >; using VectorTypes = TypeList< BASE_NS::vector, BASE_NS::vector, BASE_NS::vector >; // clang-format on namespace Internal { namespace { template void RegisterBasicEngineTypes(IEngineData& d, TypeList) { (d.RegisterInternalValueAccess(MetaType::coreType, CreateShared>()), ...); if constexpr (ArrayTypes) { (d.RegisterInternalValueAccess( MetaType::coreType, CreateShared>()), ...); } } template void UnRegisterBasicEngineTypes(IEngineData& d, TypeList) { (d.UnregisterInternalValueAccess(MetaType::coreType), ...); if constexpr (ArrayTypes) { (d.UnregisterInternalValueAccess(MetaType::coreType), ...); } } } // namespace void RegisterEngineTypes(IObjectRegistry& registry) { auto& pr = registry.GetEngineData(); RegisterBasicEngineTypes(pr, SingleAndArrayTypes {}); RegisterBasicEngineTypes(pr, VectorTypes {}); } void UnRegisterEngineTypes(IObjectRegistry& registry) { auto& pr = registry.GetEngineData(); UnRegisterBasicEngineTypes(pr, VectorTypes {}); UnRegisterBasicEngineTypes(pr, SingleAndArrayTypes {}); } } // namespace Internal META_END_NAMESPACE()