cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
i_backend.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
#include <string_view>
24
25
#include "
msgpack_rpc/transport/i_acceptor_factory.h
"
26
#include "
msgpack_rpc/transport/i_connector.h
"
27
28
namespace
msgpack_rpc::transport
{
29
35
class
IBackend {
36
public
:
42
[[nodiscard]]
virtual
std::string_view
scheme
() const noexcept = 0;
43
49
[[nodiscard]] virtual
std
::shared_ptr<
IAcceptorFactory
>
50
create_acceptor_factory
() = 0;
51
57
[[nodiscard]] virtual
std
::shared_ptr<
IConnector
>
create_connector
() = 0;
58
59
IBackend(const IBackend&) = delete;
60
IBackend(IBackend&&) = delete;
61
IBackend& operator=(const IBackend&) = delete;
62
IBackend& operator=(IBackend&&) = delete;
63
65
virtual ~IBackend() noexcept = default;
66
67
protected:
69
IBackend() noexcept = default;
70
};
71
72
}
// namespace msgpack_rpc::transport
msgpack_rpc::transport::IAcceptorFactory
Interface of factories to create acceptors.
Definition
i_acceptor_factory.h:33
msgpack_rpc::transport::IBackend::scheme
virtual std::string_view scheme() const noexcept=0
Get the scheme.
msgpack_rpc::transport::IBackend::create_acceptor_factory
virtual std::shared_ptr< IAcceptorFactory > create_acceptor_factory()=0
Create a factory to create acceptors.
msgpack_rpc::transport::IBackend::create_connector
virtual std::shared_ptr< IConnector > create_connector()=0
Create a connector to connect to endpoints of acceptors.
msgpack_rpc::transport::IConnector
Interface of connectors to connect to endpoints of acceptors.
Definition
i_connector.h:34
i_acceptor_factory.h
Definition of IAcceptorFactory class.
i_connector.h
Definition of IConnector class.
msgpack_rpc::transport
Namespace of transport of messages.
Definition
backends.h:31
std
STL namespace.
include
msgpack_rpc
transport
i_backend.h
Generated on
for cpp-msgpack-rpc by
1.18.0