cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
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
27
28namespace msgpack_rpc::transport {
29
35class IBackend {
36public:
42 [[nodiscard]] virtual std::string_view scheme() const noexcept = 0;
43
49 [[nodiscard]] virtual std::shared_ptr<IAcceptorFactory>
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
67protected:
69 IBackend() noexcept = default;
70};
71
72} // namespace msgpack_rpc::transport
Interface of factories to create acceptors.
virtual std::string_view scheme() const noexcept=0
Get the scheme.
virtual std::shared_ptr< IAcceptorFactory > create_acceptor_factory()=0
Create a factory to create acceptors.
virtual std::shared_ptr< IConnector > create_connector()=0
Create a connector to connect to endpoints of acceptors.
Interface of connectors to connect to endpoints of acceptors.
Definition i_connector.h:34
Definition of IAcceptorFactory class.
Definition of IConnector class.
Namespace of transport of messages.
Definition backends.h:31
STL namespace.