1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef OHOS_HDI_AST_SMQ_H 10 #define OHOS_HDI_AST_SMQ_H 11 12 #include "ast/ast_type.h" 13 14 namespace OHOS { 15 namespace HDI { 16 class ASTSmqType : public ASTType { 17 public: SetInnerType(const AutoPtr<ASTType> & innerType)18 inline void SetInnerType(const AutoPtr<ASTType>& innerType) 19 { 20 innerType_ = innerType; 21 } 22 23 bool IsSmqType() override; 24 25 String ToString() override; 26 27 TypeKind GetTypeKind() override; 28 29 String EmitCppType(TypeMode mode = TypeMode::NO_MODE) const override; 30 31 void EmitCppWriteVar(const String& parcelName, const String& name, StringBuilder& sb, 32 const String& prefix, unsigned int innerLevel = 0) const override; 33 34 void EmitCppReadVar(const String& parcelName, const String& name, StringBuilder& sb, 35 const String& prefix, bool initVariable, unsigned int innerLevel = 0) const override; 36 37 private: 38 AutoPtr<ASTType> innerType_; 39 }; 40 } // namespace HDI 41 } // namespace OHOS 42 43 #endif // OHOS_HDI_AST_SMQ_H