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 #include "object_container.h" 17 18 #include <algorithm> 19 20 #include <meta/base/interface_utils.h> 21 #include <meta/interface/intf_containable.h> 22 #include <meta/interface/intf_content.h> 23 #include <meta/interface/property/intf_property.h> 24 META_BEGIN_NAMESPACE()25META_BEGIN_NAMESPACE() 26 27 bool ObjectContainer::Build(const IMetadata::Ptr& data) 28 { 29 bool ret = Super::Build(data); 30 if (ret) { 31 parent_ = GetSelf<IContainer>(); 32 SetImplementingIContainer(GetSelf<IObject>().get(), this); 33 } 34 return ret; 35 } 36 Destroy()37void ObjectContainer::Destroy() 38 { 39 InternalRemoveAll(); 40 Super::Destroy(); 41 } 42 43 META_END_NAMESPACE() 44