cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
i_method.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 MusicScience37 (Kenta Kabashima)
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
20
#pragma once
21
22
#include "
msgpack_rpc/messages/method_name_view.h
"
23
#include "
msgpack_rpc/messages/parsed_notification.h
"
24
#include "
msgpack_rpc/messages/parsed_request.h
"
25
#include "
msgpack_rpc/messages/serialized_message.h
"
26
27
namespace
msgpack_rpc::methods
{
28
32
class
IMethod {
33
public
:
39
[[nodiscard]]
virtual
messages::MethodNameView
name
() const noexcept = 0;
40
47
[[nodiscard]] virtual
messages
::SerializedMessage
call
(
48
const
messages
::ParsedRequest& request) = 0;
49
55
virtual
void
notify
(const
messages
::ParsedNotification& notification) = 0;
56
57
IMethod(const IMethod&) = delete;
58
IMethod(IMethod&&) = delete;
59
IMethod& operator=(const IMethod&) = delete;
60
IMethod& operator=(IMethod&&) = delete;
61
63
virtual ~IMethod() noexcept = default;
64
65
protected:
67
IMethod() noexcept = default;
68
};
69
70
}
// namespace msgpack_rpc::methods
msgpack_rpc::messages::MethodNameView
Class of method names.
Definition
method_name_view.h:39
msgpack_rpc::methods::IMethod::name
virtual messages::MethodNameView name() const noexcept=0
Get the method name.
msgpack_rpc::methods::IMethod::notify
virtual void notify(const messages::ParsedNotification ¬ification)=0
Notify this method.
msgpack_rpc::methods::IMethod::call
virtual messages::SerializedMessage call(const messages::ParsedRequest &request)=0
Call this method.
method_name_view.h
Definition of MethodNameView class.
msgpack_rpc::messages
Namespace of messages.
Definition
buffer_view.h:24
msgpack_rpc::methods
Namespace of methods in MessagePack-RPC.
Definition
functional_method.h:41
parsed_notification.h
Definition of ParsedNotification class.
parsed_request.h
Definition of ParsedRequest class.
serialized_message.h
Definition of SerializedMessage class.
include
msgpack_rpc
methods
i_method.h
Generated on
for cpp-msgpack-rpc by
1.18.0