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 #ifndef META_SRC_OBJECT_DATA_CONTAINER_H
16 #define META_SRC_OBJECT_DATA_CONTAINER_H
17
18 #include <meta/interface/intf_metadata.h>
19
20 #include "attachment_container.h"
21
META_BEGIN_NAMESPACE()22 META_BEGIN_NAMESPACE()
23
24 namespace Internal {
25
26 class ObjectDataContainer : public IntroduceInterfaces<AttachmentContainer, IMetadata> {
27 using Super = IntroduceInterfaces;
28 META_IMPLEMENT_OBJECT_TYPE_INTERFACE(ClassId::ObjectDataContainer)
29
30 public: // IMetadata
31 bool AddFunction(const IFunction::Ptr&) override;
32 bool RemoveFunction(const IFunction::Ptr&) override;
33
34 bool AddProperty(const IProperty::Ptr&) override;
35 bool RemoveProperty(const IProperty::Ptr&) override;
36
37 bool AddEvent(const IEvent::Ptr&) override;
38 bool RemoveEvent(const IEvent::Ptr&) override;
39
40 BASE_NS::vector<IProperty::Ptr> GetProperties() override;
41 BASE_NS::vector<IProperty::ConstPtr> GetProperties() const override;
42 BASE_NS::vector<IFunction::Ptr> GetFunctions() override;
43 BASE_NS::vector<IFunction::ConstPtr> GetFunctions() const override;
44 BASE_NS::vector<IEvent::Ptr> GetEvents() override;
45 BASE_NS::vector<IEvent::ConstPtr> GetEvents() const override;
46
47 BASE_NS::vector<MetadataInfo> GetAllMetadatas(MetadataType types) const override;
48 MetadataInfo GetMetadata(MetadataType type, BASE_NS::string_view name) const override;
49
50 using IMetadata::GetProperty;
51 IProperty::Ptr GetProperty(BASE_NS::string_view name, MetadataQuery) override;
52 IProperty::ConstPtr GetProperty(BASE_NS::string_view name, MetadataQuery) const override;
53
54 using IMetadata::GetFunction;
55 IFunction::Ptr GetFunction(BASE_NS::string_view name, MetadataQuery) override;
56 IFunction::ConstPtr GetFunction(BASE_NS::string_view name, MetadataQuery) const override;
57
58 using IMetadata::GetEvent;
59 IEvent::ConstPtr GetEvent(BASE_NS::string_view name, MetadataQuery) const override;
60 IEvent::Ptr GetEvent(BASE_NS::string_view name, MetadataQuery) override;
61 };
62
63 } // namespace Internal
64
65 META_END_NAMESPACE()
66
67 #endif
68