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 DISTRIBUTED_RDB_RDB_TYPES_UTIL_H 17 #define DISTRIBUTED_RDB_RDB_TYPES_UTIL_H 18 19 #include "itypes_util.h" 20 #include "rdb_service.h" 21 #include "rdb_types.h" 22 #include "rdb_visibility.h" 23 #include "value_object.h" 24 #include "values_bucket.h" 25 26 namespace OHOS::ITypesUtil { 27 using SubOption = DistributedRdb::SubscribeOption; 28 using SyncerParam = DistributedRdb::RdbSyncerParam; 29 using Option = DistributedRdb::RdbService::Option; 30 using RdbPredicates = DistributedRdb::PredicatesMemo; 31 using RdbOperation = DistributedRdb::RdbPredicateOperation; 32 using ValueObject = NativeRdb::ValueObject; 33 using ValuesBucket = NativeRdb::ValuesBucket; 34 using Asset = NativeRdb::AssetValue; 35 using ProgressDetail = DistributedRdb::ProgressDetail; 36 using TableDetail = DistributedRdb::TableDetail; 37 using Statistic = DistributedRdb::Statistic; 38 using Observer = DistributedRdb::RdbStoreObserver; 39 using Origin = DistributedRdb::Origin; 40 using ChangeInfo = Observer::ChangeInfo; 41 using PrimaryKey = Observer::PrimaryKey; 42 using PrimaryKeys = std::vector<PrimaryKey>[Observer::CHG_TYPE_BUTT]; 43 template<> 44 API_EXPORT bool Marshalling(const SyncerParam &input, MessageParcel &data); 45 template<> 46 API_EXPORT bool Unmarshalling(SyncerParam &output, MessageParcel &data); 47 template<> 48 API_EXPORT bool Marshalling(const Option &input, MessageParcel &data); 49 template<> 50 API_EXPORT bool Unmarshalling(Option &output, MessageParcel &data); 51 template<> 52 API_EXPORT bool Marshalling(const RdbPredicates &input, MessageParcel &data); 53 template<> 54 API_EXPORT bool Unmarshalling(RdbPredicates &output, MessageParcel &data); 55 template<> 56 API_EXPORT bool Marshalling(const RdbOperation &input, MessageParcel &data); 57 template<> 58 API_EXPORT bool Unmarshalling(RdbOperation &output, MessageParcel &data); 59 template<> 60 API_EXPORT bool Marshalling(const SubOption &input, MessageParcel &data); 61 template<> 62 API_EXPORT bool Unmarshalling(SubOption &output, MessageParcel &data); 63 template<> 64 API_EXPORT bool Marshalling(const ValueObject &input, MessageParcel &data); 65 template<> 66 API_EXPORT bool Unmarshalling(ValueObject &output, MessageParcel &data); 67 template<> 68 API_EXPORT bool Marshalling(const ValuesBucket &input, MessageParcel &data); 69 template<> 70 API_EXPORT bool Unmarshalling(ValuesBucket &output, MessageParcel &data); 71 template<> 72 API_EXPORT bool Marshalling(const Asset &input, MessageParcel &data); 73 template<> 74 API_EXPORT bool Unmarshalling(Asset &output, MessageParcel &data); 75 template<> 76 API_EXPORT bool Marshalling(const SubOption &input, MessageParcel &data); 77 template<> 78 API_EXPORT bool Unmarshalling(SubOption &output, MessageParcel &data); 79 template<> 80 API_EXPORT bool Marshalling(const ProgressDetail &input, MessageParcel &data); 81 template<> 82 API_EXPORT bool Unmarshalling(ProgressDetail &output, MessageParcel &data); 83 template<> 84 API_EXPORT bool Marshalling(const TableDetail &input, MessageParcel &data); 85 template<> 86 API_EXPORT bool Unmarshalling(TableDetail &output, MessageParcel &data); 87 template<> 88 API_EXPORT bool Marshalling(const Statistic &input, MessageParcel &data); 89 template<> 90 API_EXPORT bool Unmarshalling(Statistic &output, MessageParcel &data); 91 template<> 92 API_EXPORT bool Marshalling(const PrimaryKeys &input, MessageParcel &data); 93 template<> 94 API_EXPORT bool Unmarshalling(PrimaryKeys &output, MessageParcel &data); 95 template<> 96 API_EXPORT bool Marshalling(const Origin &input, MessageParcel &data); 97 template<> 98 API_EXPORT bool Unmarshalling(Origin &output, MessageParcel &data); 99 } 100 #endif // DISTRIBUTED_RDB_RDB_TYPES_UTIL_H 101