1 /** 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef PANDA_PLUGINS_ETS_RUNTIME_ANI_ANI_TYPE_INFO_H 17 #define PANDA_PLUGINS_ETS_RUNTIME_ANI_ANI_TYPE_INFO_H 18 19 #include "plugins/ets/runtime/ani/ani.h" 20 #include "plugins/ets/runtime/types/ets_type.h" 21 22 namespace ark::ets::ani { 23 24 template <typename T> 25 struct AniTypeInfo; 26 27 template <> 28 struct AniTypeInfo<ani_boolean> { 29 static constexpr EtsType ETS_TYPE_VALUE = EtsType::BOOLEAN; 30 }; 31 32 template <> 33 struct AniTypeInfo<ani_char> { 34 static constexpr EtsType ETS_TYPE_VALUE = EtsType::CHAR; 35 }; 36 37 template <> 38 struct AniTypeInfo<ani_byte> { 39 static constexpr EtsType ETS_TYPE_VALUE = EtsType::BYTE; 40 }; 41 42 template <> 43 struct AniTypeInfo<ani_short> { 44 static constexpr EtsType ETS_TYPE_VALUE = EtsType::SHORT; 45 }; 46 47 template <> 48 struct AniTypeInfo<ani_int> { 49 static constexpr EtsType ETS_TYPE_VALUE = EtsType::INT; 50 }; 51 52 template <> 53 struct AniTypeInfo<ani_long> { 54 static constexpr EtsType ETS_TYPE_VALUE = EtsType::LONG; 55 }; 56 57 template <> 58 struct AniTypeInfo<ani_float> { 59 static constexpr EtsType ETS_TYPE_VALUE = EtsType::FLOAT; 60 }; 61 62 template <> 63 struct AniTypeInfo<ani_double> { 64 static constexpr EtsType ETS_TYPE_VALUE = EtsType::DOUBLE; 65 }; 66 67 template <> 68 struct AniTypeInfo<ani_ref> { 69 static constexpr EtsType ETS_TYPE_VALUE = EtsType::OBJECT; 70 }; 71 72 } // namespace ark::ets::ani 73 74 #endif // PANDA_PLUGINS_ETS_RUNTIME_ANI_ANI_TYPE_INFO_H 75