1 /* 2 * Copyright (c) 2024 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 API_CORE_PROPERTY_TOOLS_PROPERTY_MACROS_H 17 #define API_CORE_PROPERTY_TOOLS_PROPERTY_MACROS_H 18 19 #ifndef NO_MEMBERS 20 // Include actual macros, with the core property metadatas. 21 #include <core/property_tools/core_metadata.inl> 22 #endif 23 24 #ifdef IMPLEMENT_MANAGER 25 // Override the component declaration macros for "inline include" metadata definitions. 26 #undef BEGIN_COMPONENT 27 #undef ARRAY_VALUE 28 #undef VALUE 29 #undef DEFINE_PROPERTY 30 #undef DEFINE_BITFIELD_PROPERTY 31 #undef DEFINE_ARRAY_PROPERTY 32 #undef BEGIN_COMPONENT_MANAGER 33 #undef END_COMPONENT_MANAGER 34 #undef END_COMPONENT 35 #undef END_COMPONENT_EXT 36 #undef END_COMPONENT2 37 38 // Helpers which can be used when defining a component manager with the help of component_struct_macros.h. 39 #define BEGIN_COMPONENT(a, b) 40 #define ARRAY_VALUE(...) 41 #define VALUE(val) 42 #define DEFINE_PROPERTY(type, name, displayname, flags, value) MEMBER_PROPERTY(name, displayname, flags), 43 #define DEFINE_BITFIELD_PROPERTY(type, name, displayname, flags, value, enumeration) \ 44 BITFIELD_MEMBER_PROPERTY(name, displayname, flags, enumeration), 45 #define DEFINE_ARRAY_PROPERTY(type, count, name, displayname, flags, value) MEMBER_PROPERTY(name, displayname, flags), 46 #define BEGIN_COMPONENT_MANAGER(a, b, c) 47 #define END_COMPONENT_MANAGER(a, b, c) 48 #define END_COMPONENT(a, b, c) 49 #define END_COMPONENT_EXT(a, b, c, d) 50 #define BEGIN_PROPERTY(dataType, storageName) \ 51 using COMPTYPE = dataType; \ 52 static constexpr CORE_NS::Property storageName[] = { 53 #define END_PROPERTY() } 54 #endif 55 56 #endif // API_CORE_PROPERTY_TOOLS_PROPERTY_MACROS_H 57