1 /* 2 * Copyright (c) 2021 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 OHOS_SYSTEM_TEST_STOPERATORTREE_H 16 #define OHOS_SYSTEM_TEST_STOPERATORTREE_H 17 18 #include <cstring> 19 #include <string> 20 #include <memory> 21 #include <vector> 22 23 namespace OHOS { 24 namespace STtools { 25 using std::string; 26 27 class StOperator { 28 private: 29 std::vector<std::shared_ptr<StOperator>> g_childOperator; 30 std::shared_ptr<StOperator> g_parentOperator; 31 string g_abilityType; 32 string g_bundleName; 33 string g_abilityName; 34 string g_operatorName; // data ability 35 string g_message; 36 /* data */ 37 static int countChild; 38 39 public: 40 StOperator(); 41 StOperator(const string &type, const string &bundle, const string &ability, const string &operatorName = "", 42 const string &message = "r"); 43 ~StOperator(); 44 static int GetCountChild(); 45 string GetAbilityType(); 46 StOperator &SetAbilityType(const string &type); 47 string GetBundleName(); 48 StOperator &SetBundleName(const string &bundleName); 49 string GetAbilityName(); 50 StOperator &SetAbilityName(const string &abilityName); 51 string GetOperatorName(); 52 StOperator &SetOperatorName(const string &operatorName); 53 string GetMessage(); 54 StOperator &SetMessage(const string &message); 55 StOperator &AddChildOperator(std::shared_ptr<StOperator> childOperator); 56 std::vector<std::shared_ptr<StOperator>> GetChildOperator(); 57 }; 58 } // namespace STtools 59 } // namespace OHOS 60 #endif // OHOS_SYSTEM_TEST_STOPERATORTREE_H