1 /* 2 * Copyright (C) 2025 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 OHOS_RPC_TESST_SERVICE_BASE_H 17 #define OHOS_RPC_TESST_SERVICE_BASE_H 18 19 #include "iremote_broker.h" 20 #include "iremote_object.h" 21 #include "iremote_proxy.h" 22 #include "iremote_stub.h" 23 #include "message_parcel.h" 24 25 namespace OHOS { 26 class IRpcTestService : public IRemoteBroker { 27 public: 28 enum { 29 GET_SERVICE_NAME = 0, 30 GET_TOKENID = 1, 31 TEST_SYNC_ADD = 2, 32 }; GetServiceName()33 std::string GetServiceName() 34 { 35 return serviceName_; 36 } 37 virtual int32_t TestGetServiceName(MessageParcel &data, MessageParcel &reply, MessageOption &option) = 0; 38 virtual int32_t TestAccessToken(MessageParcel &data, MessageParcel &reply, MessageOption &option) = 0; 39 virtual int32_t TestSyncAdd(MessageParcel &data, MessageParcel &reply, MessageOption &option) = 0; 40 DECLARE_INTERFACE_DESCRIPTOR(u"test.rpc.IRpcTestService"); 41 private: 42 std::string serviceName_ = "IRpcTestService"; 43 }; 44 } // namespace OHOS 45 #endif // OHOS_RPC_TESST_SERVICE_BASE_H 46 47