1 /* 2 * Copyright (c) 2022 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 TEST_WUKONG_ABILITY_TREE_H 17 #define TEST_WUKONG_ABILITY_TREE_H 18 19 #include "page_tree.h" 20 #include "wukong_define.h" 21 #include "wukong_tree.h" 22 23 namespace OHOS { 24 namespace WuKong { 25 class AbilityTree : public WuKongTree { 26 public: AbilityTree()27 AbilityTree() 28 : WuKongTree(), 29 deviceId_(""), 30 bundleName_(""), 31 abilityName_(""), 32 moduleName_(""), 33 allComponentCount_(0) 34 { 35 } ~AbilityTree()36 virtual ~AbilityTree() 37 { 38 TRACK_LOG_END(); 39 } GetAllComponentCount()40 uint32_t GetAllComponentCount() 41 { 42 return allComponentCount_; 43 } GetBundleName()44 const std::string& GetBundleName() 45 { 46 return bundleName_; 47 } GetAbilityName()48 const std::string& GetAbilityName() 49 { 50 return abilityName_; 51 } 52 53 private: 54 friend class TreeManager; 55 virtual bool SetNodeId() override; AddAllComponentCount(uint32_t count)56 void AddAllComponentCount(uint32_t count) 57 { 58 allComponentCount_ += count; 59 DEBUG_LOG_STR("Add count allComponentCount_ (%u), count (%u)", allComponentCount_, count); 60 } 61 std::string deviceId_; 62 std::string bundleName_; 63 std::string abilityName_; 64 std::string moduleName_; 65 uint32_t allComponentCount_; 66 }; 67 } // namespace WuKong 68 } // namespace OHOS 69 #endif // TEST_WUKONG_ABILITY_TREE_H 70