1f8af9c48Sopenharmony_ci/*
2f8af9c48Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
3f8af9c48Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4f8af9c48Sopenharmony_ci * you may not use this file except in compliance with the License.
5f8af9c48Sopenharmony_ci * You may obtain a copy of the License at
6f8af9c48Sopenharmony_ci *
7f8af9c48Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8f8af9c48Sopenharmony_ci *
9f8af9c48Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10f8af9c48Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11f8af9c48Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12f8af9c48Sopenharmony_ci * See the License for the specific language governing permissions and
13f8af9c48Sopenharmony_ci * limitations under the License.
14f8af9c48Sopenharmony_ci */
15f8af9c48Sopenharmony_ci
16f8af9c48Sopenharmony_ci#ifndef OHOS_DP_IPC_SERIALIZATION_UTILS_H
17f8af9c48Sopenharmony_ci#define OHOS_DP_IPC_SERIALIZATION_UTILS_H
18f8af9c48Sopenharmony_ci
19f8af9c48Sopenharmony_ci#include <string>
20f8af9c48Sopenharmony_ci#include <vector>
21f8af9c48Sopenharmony_ci#include <map>
22f8af9c48Sopenharmony_ci#include "trust_device_profile.h"
23f8af9c48Sopenharmony_ci#include "access_control_profile.h"
24f8af9c48Sopenharmony_ci#include "accesser.h"
25f8af9c48Sopenharmony_ci#include "accessee.h"
26f8af9c48Sopenharmony_ci#include "device_profile.h"
27f8af9c48Sopenharmony_ci#include "service_profile.h"
28f8af9c48Sopenharmony_ci#include "characteristic_profile.h"
29f8af9c48Sopenharmony_ci#include "distributed_device_profile_errors.h"
30f8af9c48Sopenharmony_ci#include "distributed_device_profile_constants.h"
31f8af9c48Sopenharmony_ci#include "distributed_device_profile_log.h"
32f8af9c48Sopenharmony_ci#include "parcel.h"
33f8af9c48Sopenharmony_ci#include "message_parcel.h"
34f8af9c48Sopenharmony_ci#include "dp_subscribe_info.h"
35f8af9c48Sopenharmony_ci
36f8af9c48Sopenharmony_cinamespace OHOS {
37f8af9c48Sopenharmony_cinamespace DistributedDeviceProfile {
38f8af9c48Sopenharmony_ciclass IpcUtils {
39f8af9c48Sopenharmony_cipublic:
40f8af9c48Sopenharmony_ci    static bool Marshalling(MessageParcel& parcel, const std::vector<TrustDeviceProfile>& trustDeviceProfiles);
41f8af9c48Sopenharmony_ci    static bool Marshalling(MessageParcel& parcel, const std::vector<AccessControlProfile>& aclProfiles);
42f8af9c48Sopenharmony_ci    static bool Marshalling(MessageParcel& parcel, const std::vector<ServiceProfile>& serviceProfiles);
43f8af9c48Sopenharmony_ci    static bool Marshalling(MessageParcel& parcel, const std::vector<CharacteristicProfile>& charProfiles);
44f8af9c48Sopenharmony_ci    static bool Marshalling(MessageParcel& parcel, const std::map<std::string, std::string>& params);
45f8af9c48Sopenharmony_ci    static bool Marshalling(MessageParcel& parcel, const std::map<std::string,
46f8af9c48Sopenharmony_ci        OHOS::DistributedDeviceProfile::SubscribeInfo>& listenerMap);
47f8af9c48Sopenharmony_ci    static bool Marshalling(MessageParcel& parcel, const std::unordered_set<ProfileChangeType>& changeTypes);
48f8af9c48Sopenharmony_ci    static bool UnMarshalling(MessageParcel& parcel, std::vector<TrustDeviceProfile>& trustDeviceProfiles);
49f8af9c48Sopenharmony_ci    static bool UnMarshalling(MessageParcel& parcel, std::vector<AccessControlProfile>& aclProfiles);
50f8af9c48Sopenharmony_ci    static bool UnMarshalling(MessageParcel& parcel, std::vector<ServiceProfile>& serviceProfiles);
51f8af9c48Sopenharmony_ci    static bool UnMarshalling(MessageParcel& parcel, std::vector<CharacteristicProfile>& charProfiles);
52f8af9c48Sopenharmony_ci    static bool UnMarshalling(MessageParcel& parcel, std::map<std::string, std::string>& params);
53f8af9c48Sopenharmony_ci    static bool UnMarshalling(MessageParcel& parcel, std::map<std::string,
54f8af9c48Sopenharmony_ci        OHOS::DistributedDeviceProfile::SubscribeInfo>& listenerMap);
55f8af9c48Sopenharmony_ci    static bool UnMarshalling(MessageParcel& parcel, std::unordered_set<ProfileChangeType>& changeTypes);
56f8af9c48Sopenharmony_ci};
57f8af9c48Sopenharmony_ci} // namespace DistributedDeviceProfile
58f8af9c48Sopenharmony_ci} // namespace OHOS
59f8af9c48Sopenharmony_ci#endif // OHOS_DP_IPC_SERIALIZATION_UTILS_H
60