1/* 2 * Copyright (c) 2024 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 TEST_IFOO_H 17#define TEST_IFOO_H 18 19#include <cstdint> 20#include <iremote_broker.h> 21#include <string_ex.h> 22#include "myinterface.h" 23#include "myseq.h" 24 25using test::myseq; 26using test::myinterface; 27 28namespace test { 29 30enum class IFooIpcCode { 31 COMMAND_VOID_TEST_FUNC = MIN_TRANSACTION_ID, 32 COMMAND_BOOL_TEST_FUNC, 33 COMMAND_BYTE_TEST_FUNC, 34 COMMAND_SHORT_TEST_FUNC, 35 COMMAND_INT_TEST_FUNC, 36 COMMAND_LONG_TEST_FUNC, 37 COMMAND_STRING_TEST_FUNC, 38 COMMAND_FLOAT_TEST_FUNC, 39 COMMAND_DOUBLE_TEST_FUNC, 40 COMMAND_CHAR_TEST_FUNC, 41 COMMAND_SEQ_TEST_FUNC, 42 COMMAND_INTERFACE_TEST_FUNC, 43}; 44 45class IFoo : public IRemoteBroker { 46public: 47 DECLARE_INTERFACE_DESCRIPTOR(u"test.IFoo"); 48 49 virtual ErrCode void_test_func() = 0; 50 51 virtual ErrCode bool_test_func( 52 bool inParam, 53 bool& outParam, 54 bool& inoutParam, 55 bool& funcResult) = 0; 56 57 virtual ErrCode byte_test_func( 58 int8_t inParam, 59 int8_t& outParam, 60 int8_t& inoutParam, 61 int8_t& funcResult) = 0; 62 63 virtual ErrCode short_test_func( 64 short inParam, 65 short& outParam, 66 short& inoutParam, 67 short& funcResult) = 0; 68 69 virtual ErrCode int_test_func( 70 int32_t inParam, 71 int32_t& outParam, 72 int32_t& inoutParam, 73 int32_t& funcResult) = 0; 74 75 virtual ErrCode long_test_func( 76 int64_t inParam, 77 int64_t& outParam, 78 int64_t& inoutParam, 79 int64_t& funcResult) = 0; 80 81 virtual ErrCode string_test_func( 82 const std::string& inParam, 83 std::string& outParam, 84 std::string& inoutParam, 85 std::string& funcResult) = 0; 86 87 virtual ErrCode float_test_func( 88 float inParam, 89 float& outParam, 90 float& inoutParam, 91 float& funcResult) = 0; 92 93 virtual ErrCode double_test_func( 94 double inParam, 95 double& outParam, 96 double& inoutParam, 97 double& funcResult) = 0; 98 99 virtual ErrCode char_test_func( 100 char inParam, 101 char& outParam, 102 char& inoutParam, 103 char& funcResult) = 0; 104 105 virtual ErrCode seq_test_func( 106 const myseq& inParam, 107 myseq& outParam, 108 myseq& inoutParam, 109 myseq& funcResult) = 0; 110 111 virtual ErrCode interface_test_func( 112 const sptr<myinterface>& inParam, 113 sptr<myinterface>& outParam, 114 sptr<myinterface>& inoutParam, 115 sptr<myinterface>& funcResult) = 0; 116protected: 117 const int VECTOR_MAX_SIZE = 102400; 118 const int LIST_MAX_SIZE = 102400; 119 const int SET_MAX_SIZE = 102400; 120 const int MAP_MAX_SIZE = 102400; 121}; 122} // namespace test 123#endif // TEST_IFOO_H 124 125