1 /** 2 * Copyright (c) 2025 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 PANDA_PLUGINS_ETS_RUNTIME_TYPES_ETS_ABC_FILE_H 17 #define PANDA_PLUGINS_ETS_RUNTIME_TYPES_ETS_ABC_FILE_H 18 19 #include "plugins/ets/runtime/types/ets_object.h" 20 #include "plugins/ets/runtime/types/ets_primitives.h" 21 22 namespace ark::ets { 23 24 namespace test { 25 class EtsAbcRuntimeLinkerTest; 26 } // namespace test 27 28 class EtsAbcFile : public EtsObject { 29 public: 30 EtsAbcFile() = delete; 31 ~EtsAbcFile() = delete; 32 33 NO_COPY_SEMANTIC(EtsAbcFile); 34 NO_MOVE_SEMANTIC(EtsAbcFile); 35 FromEtsObject(EtsObject * obj)36 static EtsAbcFile *FromEtsObject(EtsObject *obj) 37 { 38 return reinterpret_cast<EtsAbcFile *>(obj); 39 } 40 AsObject()41 EtsObject *AsObject() 42 { 43 return this; 44 } 45 GetPandaFile()46 panda_file::File *GetPandaFile() 47 { 48 return reinterpret_cast<panda_file::File *>(fileHandlePtr_); 49 } 50 SetPandaFile(const panda_file::File * file)51 void SetPandaFile(const panda_file::File *file) 52 { 53 fileHandlePtr_ = reinterpret_cast<EtsLong>(file); 54 } 55 56 private: 57 // ets.AbcFile fields BEGIN 58 EtsLong fileHandlePtr_; 59 // ets.AbcFile fields END 60 61 friend class test::EtsAbcRuntimeLinkerTest; 62 }; 63 64 } // namespace ark::ets 65 66 #endif // PANDA_PLUGINS_ETS_RUNTIME_TYPES_ETS_ABC_FILE_H 67