1 /* 2 * Copyright (c) 2021 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_ASTFLOATTYPE_H 10 #define OHOS_HDI_ASTFLOATTYPE_H 11 12 #include "ast/ast_type.h" 13 14 namespace OHOS { 15 namespace HDI { 16 class ASTFloatType : public ASTType { 17 public: 18 bool IsFloatType() override; 19 20 String ToString() override; 21 22 TypeKind GetTypeKind() override; 23 24 String EmitCType(TypeMode mode = TypeMode::NO_MODE) const override; 25 26 String EmitCppType(TypeMode mode = TypeMode::NO_MODE) const override; 27 28 String EmitJavaType(TypeMode mode, bool isInnerType = false) const override; 29 30 void EmitCWriteVar(const String& parcelName, const String& name, const String& ecName, 31 const String& gotoLabel, StringBuilder& sb, const String& prefix) const override; 32 33 void EmitCProxyReadVar(const String& parcelName, const String& name, bool isInnerType, const String& ecName, 34 const String& gotoLabel, StringBuilder& sb, const String& prefix) const override; 35 36 void EmitCStubReadVar(const String& parcelName, const String& name, const String& ecName, 37 const String& gotoLabel, StringBuilder& sb, const String& prefix) const override; 38 39 void EmitCppWriteVar(const String& parcelName, const String& name, StringBuilder& sb, 40 const String& prefix, unsigned int innerLevel = 0) const override; 41 42 void EmitCppReadVar(const String& parcelName, const String& name, StringBuilder& sb, 43 const String& prefix, bool initVariable, unsigned int innerLevel = 0) const override; 44 45 void EmitCMarshalling(const String& name, StringBuilder& sb, const String& prefix) const override; 46 47 void EmitCUnMarshalling(const String& name, const String& gotoLabel, StringBuilder& sb, const String& prefix, 48 std::vector<String>& freeObjStatements) const override; 49 50 void EmitCppMarshalling(const String& parcelName, const String& name, StringBuilder& sb, 51 const String& prefix, unsigned int innerLevel = 0) const override; 52 53 void EmitCppUnMarshalling(const String& parcelName, const String& name, StringBuilder& sb, 54 const String& prefix, bool emitType, unsigned int innerLevel = 0) const override; 55 56 void EmitJavaWriteVar(const String& parcelName, const String& name, StringBuilder& sb, 57 const String& prefix) const override; 58 59 void EmitJavaReadVar(const String& parcelName, const String& name, StringBuilder& sb, 60 const String& prefix) const override; 61 62 void EmitJavaReadInnerVar(const String& parcelName, const String& name, bool isInner, StringBuilder& sb, 63 const String& prefix) const override; 64 }; 65 } // namespace HDI 66 } // namespace OHOS 67 68 #endif // OHOS_HDI_ASTFLOATTYPE_H