1 /*
2  * Copyright (c) 2021 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 UTILS_INCLUDE_BUFFER_HANDLE_PARCEL_H
17 #define UTILS_INCLUDE_BUFFER_HANDLE_PARCEL_H
18 
19 #ifdef __cplusplus
20 #include "buffer_handle.h"
21 #include "message_parcel.h"
22 namespace OHOS {
23 /* *
24  * @Description: Write BufferHanedle to MessageParcel
25  * @param parcel which the buffer handle will write to
26  * @param handle Buffer handle which will wtite to parcel
27  * @return  Returns true if the operation is successful; returns <b>false</b> otherwise.
28  */
29 bool WriteBufferHandle(MessageParcel &parcel, const BufferHandle &handle);
30 
31 /* *
32  * @Description: Read BufferHanedle from MessageParcel
33  * @param parcel message parcel which should has a buffer handle
34  * @return  Returns pointer to buffer handle if the operation is successful; returns <b>nullptr</b> otherwise.
35  */
36 BufferHandle *ReadBufferHandle(MessageParcel &parcel);
37 } // namespace OHO
38 #endif // __cplusplus
39 
40 #endif // UTILS_INCLUDE_BUFFER_HANDLE_PARCEL_H
41