1 /** 2 * Copyright (c) 2022 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 MERGE_ABC_META_H 17 #define MERGE_ABC_META_H 18 19 #include "annotationProto.h" 20 #include "arena_allocator.h" 21 #include "assembly-program.h" 22 #include "assemblyTypeProto.h" 23 #include "meta.pb.h" 24 25 namespace panda::proto { 26 class RecordMetadata { 27 public: 28 static void Serialize(const panda::pandasm::RecordMetadata &meta, protoPanda::RecordMetadata &protoMeta); 29 static void Deserialize(const protoPanda::RecordMetadata &protoMeta, 30 std::unique_ptr<panda::pandasm::RecordMetadata> &meta, 31 panda::ArenaAllocator *allocator); 32 }; 33 34 class FunctionMetadata { 35 public: 36 static void Serialize(const panda::pandasm::FunctionMetadata &meta, 37 protoPanda::FunctionMetadata &protoMeta); 38 static void Deserialize(const protoPanda::FunctionMetadata &protoMeta, 39 std::unique_ptr<panda::pandasm::FunctionMetadata> &meta, 40 panda::ArenaAllocator *allocator); 41 }; 42 43 class FieldMetadata { 44 public: 45 static void Serialize(const panda::pandasm::FieldMetadata &meta, protoPanda::FieldMetadata &protoMeta); 46 static void Deserialize(const protoPanda::FieldMetadata &protoMeta, 47 std::unique_ptr<panda::pandasm::FieldMetadata> &meta, 48 panda::ArenaAllocator *allocator); 49 }; 50 51 class ParamMetadata { 52 public: 53 static void Serialize(const panda::pandasm::ParamMetadata &meta, protoPanda::ParamMetadata &protoMeta); 54 static void Deserialize(const protoPanda::ParamMetadata &protoMeta, 55 std::unique_ptr<panda::pandasm::ParamMetadata> &meta, 56 panda::ArenaAllocator *allocator); 57 }; 58 59 class ItemMetadata { 60 public: 61 static void Serialize(const panda::pandasm::ItemMetadata &meta, protoPanda::ItemMetadata &protoMeta); 62 static void Deserialize(const protoPanda::ItemMetadata &protoMeta, panda::pandasm::ItemMetadata &meta); 63 }; 64 65 class AnnotationMetadata { 66 public: 67 static void Serialize(const panda::pandasm::AnnotationMetadata &meta, 68 protoPanda::AnnotationMetadata &protoMeta); 69 static void Deserialize(const protoPanda::AnnotationMetadata &protoMeta, panda::pandasm::AnnotationMetadata &meta, 70 panda::ArenaAllocator *allocator); 71 }; 72 73 class Metadata { 74 public: 75 static void Serialize(const panda::pandasm::Metadata &meta, protoPanda::Metadata &protoMeta); 76 static void Deserialize(const protoPanda::Metadata &protoMeta, panda::pandasm::Metadata &meta); 77 }; 78 } // panda::proto 79 #endif 80