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_PLUGIN_ICLASS_INFO_H 17 #define API_CORE_PLUGIN_ICLASS_INFO_H 18 19 #include <base/containers/refcnt_ptr.h> 20 #include <base/containers/string_view.h> 21 #include <base/namespace.h> 22 #include <base/util/uid.h> 23 #include <core/namespace.h> 24 #include <core/plugin/intf_interface.h> 25 CORE_BEGIN_NAMESPACE()26CORE_BEGIN_NAMESPACE() 27 /** Interface for checking implementation UID and name. 28 */ 29 class IClassInfo : public IInterface { 30 public: 31 static constexpr BASE_NS::Uid UID { "237773cf-7a76-4e39-a067-f454183b036c" }; 32 33 using Ptr = BASE_NS::refcnt_ptr<IClassInfo>; 34 35 /** Returns the UID of the class which implements this interface. 36 */ 37 virtual BASE_NS::Uid GetClassUid() const = 0; 38 39 /** Returns the name of the class which implements this interface. 40 */ 41 virtual BASE_NS::string_view GetClassName() const = 0; 42 43 protected: 44 IClassInfo() = default; 45 virtual ~IClassInfo() = default; 46 }; 47 CORE_END_NAMESPACE() 48 49 #endif // API_CORE_PLUGIN_ICLASS_INFO_H 50