cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
i_method_processor.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 <memory>
23
24
#include "
msgpack_rpc/messages/parsed_notification.h
"
25
#include "
msgpack_rpc/messages/parsed_request.h
"
26
#include "
msgpack_rpc/messages/serialized_message.h
"
27
#include "
msgpack_rpc/methods/i_method.h
"
28
29
namespace
msgpack_rpc::methods
{
30
34
class
IMethodProcessor {
35
public
:
41
virtual
void
append
(std::unique_ptr<IMethod> method) = 0;
42
49
[[nodiscard]]
virtual
messages::SerializedMessage
call
(
50
const
messages::ParsedRequest
& request) = 0;
51
57
virtual
void
notify
(
const
messages::ParsedNotification
& notification) = 0;
58
59
IMethodProcessor
(
const
IMethodProcessor&) =
delete
;
60
IMethodProcessor
(IMethodProcessor&&) =
delete
;
61
IMethodProcessor& operator=(
const
IMethodProcessor&) =
delete
;
62
IMethodProcessor& operator=(IMethodProcessor&&) =
delete
;
63
65
virtual
~IMethodProcessor
() noexcept = default;
66
67
protected:
69
IMethodProcessor() noexcept = default;
70
};
71
72
}
// namespace msgpack_rpc::methods
msgpack_rpc::messages::ParsedNotification
Class of parsed notification.
Definition
parsed_notification.h:32
msgpack_rpc::messages::ParsedRequest
Class of parsed requests.
Definition
parsed_request.h:33
msgpack_rpc::messages::SerializedMessage
Class of serialized message data.
Definition
serialized_message.h:34
msgpack_rpc::methods::IMethodProcessor::~IMethodProcessor
virtual ~IMethodProcessor() noexcept=default
Destructor.
msgpack_rpc::methods::IMethodProcessor::call
virtual messages::SerializedMessage call(const messages::ParsedRequest &request)=0
Call a method.
msgpack_rpc::methods::IMethodProcessor::IMethodProcessor
IMethodProcessor() noexcept=default
Constructor.
msgpack_rpc::methods::IMethodProcessor::append
virtual void append(std::unique_ptr< IMethod > method)=0
Append a method.
msgpack_rpc::methods::IMethodProcessor::notify
virtual void notify(const messages::ParsedNotification ¬ification)=0
Notify a method.
i_method.h
Definition of IMethod class.
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_processor.h
Generated on
for cpp-msgpack-rpc by
1.18.0