/* * 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. */ #ifndef META_EXT_MINIMAL_OBJECT_H #define META_EXT_MINIMAL_OBJECT_H #include #include #include #include #include #include META_BEGIN_NAMESPACE() template class MinimalObject : public IntroduceInterfaces { public: MinimalObject() : flags_(ObjectFlagBits::DEFAULT_FLAGS) {} MinimalObject(const ObjectFlagBitsValue& value) : flags_(value) {} ObjectId GetClassId() const override { return ClassInfo.Id(); } BASE_NS::string_view GetClassName() const override { return ClassInfo.Name(); } BASE_NS::string GetName() const override { return GetClassId().ToString(); } BASE_NS::vector GetInterfaces() const override { return IntroduceInterfaces::GetInterfacesVector(); } ObjectFlagBitsValue GetObjectFlags() const override { return flags_; } void SetObjectFlags(const ObjectFlagBitsValue& value) override { flags_ = value; } ObjectFlagBitsValue GetObjectDefaultFlags() const override { return ObjectFlagBits::DEFAULT_FLAGS; } private: ObjectFlagBitsValue flags_ {}; }; META_END_NAMESPACE() #endif