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 NotifyConfig = DistributedRdb::RdbNotifyConfig;
30 using Option = DistributedRdb::RdbService::Option;
31 using RdbPredicates = DistributedRdb::PredicatesMemo;
32 using RdbOperation = DistributedRdb::RdbPredicateOperation;
33 using ValueObject = NativeRdb::ValueObject;
34 using ValuesBucket = NativeRdb::ValuesBucket;
35 using Asset = NativeRdb::AssetValue;
36 using ProgressDetail = DistributedRdb::ProgressDetail;
37 using TableDetail = DistributedRdb::TableDetail;
38 using Statistic = DistributedRdb::Statistic;
39 using Observer = DistributedRdb::RdbStoreObserver;
40 using Origin = DistributedRdb::Origin;
41 using ChangeInfo = Observer::ChangeInfo;
42 using PrimaryKey = Observer::PrimaryKey;
43 using PrimaryKeys = std::vector<PrimaryKey>[Observer::CHG_TYPE_BUTT];
44 using RdbChangedData = DistributedRdb::RdbChangedData;
45 using RdbProperties = DistributedRdb::RdbChangeProperties;
46 using Reference = DistributedRdb::Reference;
47 using BigInt = NativeRdb::BigInteger;
48 using DebugInfo = DistributedRdb::RdbDebugInfo;;
49 template<>
50 API_EXPORT bool Marshalling(const SyncerParam &input, MessageParcel &data);
51 template<>
52 API_EXPORT bool Unmarshalling(SyncerParam &output, MessageParcel &data);
53 template<>
54 API_EXPORT bool Marshalling(const NotifyConfig &input, MessageParcel &data);
55 template<>
56 API_EXPORT bool Unmarshalling(NotifyConfig &output, MessageParcel &data);
57 template<>
58 API_EXPORT bool Marshalling(const Option &input, MessageParcel &data);
59 template<>
60 API_EXPORT bool Unmarshalling(Option &output, MessageParcel &data);
61 template<>
62 API_EXPORT bool Marshalling(const RdbPredicates &input, MessageParcel &data);
63 template<>
64 API_EXPORT bool Unmarshalling(RdbPredicates &output, MessageParcel &data);
65 template<>
66 API_EXPORT bool Marshalling(const RdbOperation &input, MessageParcel &data);
67 template<>
68 API_EXPORT bool Unmarshalling(RdbOperation &output, MessageParcel &data);
69 template<>
70 API_EXPORT bool Marshalling(const SubOption &input, MessageParcel &data);
71 template<>
72 API_EXPORT bool Unmarshalling(SubOption &output, MessageParcel &data);
73 template<>
74 API_EXPORT bool Marshalling(const ValueObject &input, MessageParcel &data);
75 template<>
76 API_EXPORT bool Unmarshalling(ValueObject &output, MessageParcel &data);
77 template<>
78 API_EXPORT bool Marshalling(const ValuesBucket &input, MessageParcel &data);
79 template<>
80 API_EXPORT bool Unmarshalling(ValuesBucket &output, MessageParcel &data);
81 template<>
82 API_EXPORT bool Marshalling(const Asset &input, MessageParcel &data);
83 template<>
84 API_EXPORT bool Unmarshalling(Asset &output, MessageParcel &data);
85 template<>
86 API_EXPORT bool Marshalling(const SubOption &input, MessageParcel &data);
87 template<>
88 API_EXPORT bool Unmarshalling(SubOption &output, MessageParcel &data);
89 template<>
90 API_EXPORT bool Marshalling(const ProgressDetail &input, MessageParcel &data);
91 template<>
92 API_EXPORT bool Unmarshalling(ProgressDetail &output, MessageParcel &data);
93 template<>
94 API_EXPORT bool Marshalling(const TableDetail &input, MessageParcel &data);
95 template<>
96 API_EXPORT bool Unmarshalling(TableDetail &output, MessageParcel &data);
97 template<>
98 API_EXPORT bool Marshalling(const Statistic &input, MessageParcel &data);
99 template<>
100 API_EXPORT bool Unmarshalling(Statistic &output, MessageParcel &data);
101 template<>
102 API_EXPORT bool Marshalling(const PrimaryKeys &input, MessageParcel &data);
103 template<>
104 API_EXPORT bool Unmarshalling(PrimaryKeys &output, MessageParcel &data);
105 template<>
106 API_EXPORT bool Marshalling(const Origin &input, MessageParcel &data);
107 template<>
108 API_EXPORT bool Unmarshalling(Origin &output, MessageParcel &data);
109 template<>
110 API_EXPORT bool Marshalling(const RdbChangedData &input, MessageParcel &data);
111 template<>
112 API_EXPORT bool Unmarshalling(RdbChangedData &output, MessageParcel &data);
113 template<>
114 API_EXPORT bool Marshalling(const RdbProperties &input, MessageParcel &data);
115 template<>
116 API_EXPORT bool Unmarshalling(RdbProperties &output, MessageParcel &data);
117 template<>
118 API_EXPORT bool Marshalling(const Reference &input, MessageParcel &data);
119 template<>
120 API_EXPORT bool Unmarshalling(Reference &output, MessageParcel &data);
121 template<>
122 API_EXPORT bool Marshalling(const BigInt &input, MessageParcel &data);
123 template<>
124 API_EXPORT bool Unmarshalling(BigInt &output, MessageParcel &data);
125 template<>
126 API_EXPORT bool Marshalling(const DebugInfo &input, MessageParcel &data);
127 template<>
128 API_EXPORT bool Unmarshalling(DebugInfo &output, MessageParcel &data);
129 }
130 #endif // DISTRIBUTED_RDB_RDB_TYPES_UTIL_H
131