• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
49     using IMetadata::GetProperty;
50     IProperty::Ptr GetProperty(BASE_NS::string_view name, MetadataQuery) override;
51     IProperty::ConstPtr GetProperty(BASE_NS::string_view name, MetadataQuery) const override;
52 
53     using IMetadata::GetFunction;
54     IFunction::Ptr GetFunction(BASE_NS::string_view name, MetadataQuery) override;
55     IFunction::ConstPtr GetFunction(BASE_NS::string_view name, MetadataQuery) const override;
56 
57     using IMetadata::GetEvent;
58     IEvent::ConstPtr GetEvent(BASE_NS::string_view name, MetadataQuery) const override;
59     IEvent::Ptr GetEvent(BASE_NS::string_view name, MetadataQuery) override;
60 };
61 
62 } // namespace Internal
63 
64 META_END_NAMESPACE()
65 
66 #endif
67