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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_BASE_REC_NODE_H 16 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_BASE_REC_NODE_H 17 18 #include <string> 19 #include <vector> 20 21 #include "base/memory/ace_type.h" 22 #include "base/memory/referenced.h" 23 24 namespace OHOS::Ace::NG { 25 class ACE_FORCE_EXPORT RecNode : public virtual AceType { 26 DECLARE_ACE_TYPE(RecNode, AceType); 27 28 public: GetSelfId()29 inline uint64_t GetSelfId() 30 { 31 return selfId_; 32 } SetSelfId(uint64_t selfId)33 inline void SetSelfId(uint64_t selfId) 34 { 35 selfId_ = selfId; 36 } GetNodeId()37 inline int32_t GetNodeId() 38 { 39 return nodeId_; 40 } SetNodeId(int32_t id)41 inline void SetNodeId(int32_t id) 42 { 43 nodeId_ = id; 44 } GetName()45 inline const std::string& GetName() 46 { 47 return name_; 48 } SetName(const std::string & name)49 inline void SetName(const std::string& name) 50 { 51 name_ = name; 52 } GetDebugLine()53 inline const std::string& GetDebugLine() 54 { 55 return debugLine_; 56 } SetDebugLine(const std::string & debugline)57 inline void SetDebugLine(const std::string& debugline) 58 { 59 debugLine_ = debugline; 60 } GetParentId()61 inline int32_t GetParentId() 62 { 63 return parentId_; 64 } SetParentId(int32_t id)65 inline void SetParentId(int32_t id) 66 { 67 parentId_ = id; 68 } 69 70 private: 71 uint64_t selfId_ = 0; 72 int32_t nodeId_ = 0; 73 std::string name_; 74 std::string debugLine_; 75 int32_t parentId_ = -1; 76 }; 77 } // namespace OHOS::Ace::NG 78 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_BASE_REC_NODE_H