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 HDI_SAMPLE_SERVICE_STUB_CPP_INF_H 17 #define HDI_SAMPLE_SERVICE_STUB_CPP_INF_H 18 19 #include <message_parcel.h> 20 #include <message_option.h> 21 #include <refbase.h> 22 #include "sample_service.h" 23 24 namespace OHOS { 25 namespace HDI { 26 namespace Sample { 27 namespace V1_0 { 28 class SampleServiceStub { 29 public: SampleServiceStub()30 SampleServiceStub(){} ~SampleServiceStub()31 virtual ~SampleServiceStub(){} 32 33 int32_t SampleStubBooleanTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 34 int32_t SampleStubByteTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 35 int32_t SampleStubShortTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 36 int32_t SampleStubIntTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 37 int32_t SampleStubLongTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 38 int32_t SampleStubFloatTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 39 int32_t SampleStubDoubleTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 40 int32_t SampleStubStringTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 41 int32_t SampleStubUcharTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 42 int32_t SampleStubUshortTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 43 int32_t SampleStubUintTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 44 int32_t SampleStubUlongTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 45 int32_t SampleStubListTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 46 int32_t SampleStubMapTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 47 int32_t SampleStubArrayTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 48 int32_t SampleStubStructTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 49 int32_t SampleStubEnumTypeTest(MessageParcel& data, MessageParcel& reply, MessageOption& option) const; 50 51 int32_t SampleServiceStubOnRemoteRequest(int cmdId, MessageParcel& data, MessageParcel& reply, 52 MessageOption& option) const; 53 private: 54 SampleService service; 55 }; 56 } // namespace V1_0 57 } // namespace Sample 58 } // namespace HDI 59 } // namespace OHOS 60 61 void *SampleStubInstance(); 62 63 void SampleStubRelease(void *obj); 64 65 int32_t SampleServiceOnRemoteRequest(void *stub, int cmdId, struct HdfSBuf& data, struct HdfSBuf& reply); 66 67 #endif // HDI_SAMPLE_SERVICE_STUB_CPP_INF_H