diff options
Diffstat (limited to 'fnet/src/tests/frt/rpc/invoke.cpp')
-rw-r--r-- | fnet/src/tests/frt/rpc/invoke.cpp | 126 |
1 files changed, 64 insertions, 62 deletions
diff --git a/fnet/src/tests/frt/rpc/invoke.cpp b/fnet/src/tests/frt/rpc/invoke.cpp index e69513aa980..38f260dd202 100644 --- a/fnet/src/tests/frt/rpc/invoke.cpp +++ b/fnet/src/tests/frt/rpc/invoke.cpp @@ -90,69 +90,11 @@ private: vespalib::Stash _echo_stash; FRT_Values _echo_args; - EchoTest(const EchoTest &); - EchoTest &operator=(const EchoTest &); - public: - EchoTest(FRT_Supervisor *supervisor) - : _echo_stash(), - _echo_args(_echo_stash) - { - FRT_ReflectionBuilder rb(supervisor); - rb.DefineMethod("echo", "*", "*", - FRT_METHOD(EchoTest::RPC_Echo), this); - - FRT_Values *args = &_echo_args; - args->EnsureFree(16); - - args->AddInt8(8); - uint8_t *pt_int8 = args->AddInt8Array(3); - pt_int8[0] = 1; - pt_int8[1] = 2; - pt_int8[2] = 3; - - args->AddInt16(16); - uint16_t *pt_int16 = args->AddInt16Array(3); - pt_int16[0] = 2; - pt_int16[1] = 4; - pt_int16[2] = 6; - - args->AddInt32(32); - uint32_t *pt_int32 = args->AddInt32Array(3); - pt_int32[0] = 4; - pt_int32[1] = 8; - pt_int32[2] = 12; - - args->AddInt64(64); - uint64_t *pt_int64 = args->AddInt64Array(3); - pt_int64[0] = 8; - pt_int64[1] = 16; - pt_int64[2] = 24; - - args->AddFloat(32.5); - float *pt_float = args->AddFloatArray(3); - pt_float[0] = 0.25; - pt_float[1] = 0.5; - pt_float[2] = 0.75; - - args->AddDouble(64.5); - double *pt_double = args->AddDoubleArray(3); - pt_double[0] = 0.1; - pt_double[1] = 0.2; - pt_double[2] = 0.3; - - args->AddString("string"); - FRT_StringValue *pt_string = args->AddStringArray(3); - args->SetString(&pt_string[0], "str1"); - args->SetString(&pt_string[1], "str2"); - args->SetString(&pt_string[2], "str3"); - - args->AddData("data", 4); - FRT_DataValue *pt_data = args->AddDataArray(3); - args->SetData(&pt_data[0], "dat1", 4); - args->SetData(&pt_data[1], "dat2", 4); - args->SetData(&pt_data[2], "dat3", 4); - } + EchoTest(const EchoTest &) = delete; + EchoTest &operator=(const EchoTest &) = delete; + EchoTest(FRT_Supervisor *supervisor); + ~EchoTest() override; bool prepare_params(FRT_RPCRequest &req) { @@ -178,6 +120,66 @@ public: } }; +EchoTest::~EchoTest() = default; + +EchoTest::EchoTest(FRT_Supervisor *supervisor) + : _echo_stash(), + _echo_args(_echo_stash) +{ + FRT_ReflectionBuilder rb(supervisor); + rb.DefineMethod("echo", "*", "*", FRT_METHOD(EchoTest::RPC_Echo), this); + + FRT_Values *args = &_echo_args; + args->EnsureFree(16); + + args->AddInt8(8); + uint8_t *pt_int8 = args->AddInt8Array(3); + pt_int8[0] = 1; + pt_int8[1] = 2; + pt_int8[2] = 3; + + args->AddInt16(16); + uint16_t *pt_int16 = args->AddInt16Array(3); + pt_int16[0] = 2; + pt_int16[1] = 4; + pt_int16[2] = 6; + + args->AddInt32(32); + uint32_t *pt_int32 = args->AddInt32Array(3); + pt_int32[0] = 4; + pt_int32[1] = 8; + pt_int32[2] = 12; + + args->AddInt64(64); + uint64_t *pt_int64 = args->AddInt64Array(3); + pt_int64[0] = 8; + pt_int64[1] = 16; + pt_int64[2] = 24; + + args->AddFloat(32.5); + float *pt_float = args->AddFloatArray(3); + pt_float[0] = 0.25; + pt_float[1] = 0.5; + pt_float[2] = 0.75; + + args->AddDouble(64.5); + double *pt_double = args->AddDoubleArray(3); + pt_double[0] = 0.1; + pt_double[1] = 0.2; + pt_double[2] = 0.3; + + args->AddString("string"); + FRT_StringValue *pt_string = args->AddStringArray(3); + args->SetString(&pt_string[0], "str1"); + args->SetString(&pt_string[1], "str2"); + args->SetString(&pt_string[2], "str3"); + + args->AddData("data", 4); + FRT_DataValue *pt_data = args->AddDataArray(3); + args->SetData(&pt_data[0], "dat1", 4); + args->SetData(&pt_data[1], "dat2", 4); + args->SetData(&pt_data[2], "dat3", 4); +} //------------------------------------------------------------- struct MyAccessFilter : FRT_RequestAccessFilter { |