cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
i_client_builder_impl.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/addresses/uri.h
"
25
#include "
msgpack_rpc/clients/impl/i_client_impl.h
"
26
#include "
msgpack_rpc/config/client_config.h
"
27
#include "
msgpack_rpc/executors/i_async_executor.h
"
28
#include "msgpack_rpc/impl/msgpack_rpc_export.h"
29
#include "
msgpack_rpc/logging/logger.h
"
30
#include "
msgpack_rpc/transport/i_backend.h
"
31
32
namespace
msgpack_rpc::clients::impl
{
33
37
class
IClientBuilderImpl {
38
public
:
44
virtual
void
register_protocol
(
45
std::shared_ptr<transport::IBackend> backend) = 0;
46
52
virtual
void
connect_to
(
addresses::URI
uri) = 0;
53
59
[[nodiscard]]
virtual
std::shared_ptr<clients::impl::IClientImpl>
60
build
() = 0;
61
62
IClientBuilderImpl
(
const
IClientBuilderImpl&) =
delete
;
63
IClientBuilderImpl
(IClientBuilderImpl&&) =
delete
;
64
IClientBuilderImpl& operator=(
const
IClientBuilderImpl&) =
delete
;
65
IClientBuilderImpl& operator=(IClientBuilderImpl&&) =
delete
;
66
68
virtual
~IClientBuilderImpl
() noexcept = default;
69
70
protected:
72
IClientBuilderImpl() noexcept = default;
73
};
74
83
[[nodiscard]] MSGPACK_RPC_EXPORT
std
::unique_ptr<IClientBuilderImpl>
84
create_empty_client_builder_impl
(
85
std
::shared_ptr<
executors
::IAsyncExecutor> executor,
86
std
::shared_ptr<
logging
::Logger> logger,
config
::ClientConfig
config
);
87
95
[[nodiscard]] MSGPACK_RPC_EXPORT
std
::unique_ptr<IClientBuilderImpl>
96
create_default_client_builder_impl
(
config
::ClientConfig
config
,
97
const
std
::shared_ptr<
logging
::Logger>& logger);
98
99
};
// namespace msgpack_rpc::clients::impl
msgpack_rpc::addresses::URI
Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.
Definition
uri.h:38
msgpack_rpc::clients::impl::IClientBuilderImpl::build
virtual std::shared_ptr< clients::impl::IClientImpl > build()=0
Build a client.
msgpack_rpc::clients::impl::IClientBuilderImpl::IClientBuilderImpl
IClientBuilderImpl() noexcept=default
Constructor.
msgpack_rpc::clients::impl::IClientBuilderImpl::register_protocol
virtual void register_protocol(std::shared_ptr< transport::IBackend > backend)=0
Register a protocol.
msgpack_rpc::clients::impl::IClientBuilderImpl::~IClientBuilderImpl
virtual ~IClientBuilderImpl() noexcept=default
Destructor.
msgpack_rpc::clients::impl::IClientBuilderImpl::connect_to
virtual void connect_to(addresses::URI uri)=0
Add a URI to connect to.
client_config.h
Definition of ClientConfig class.
i_async_executor.h
Definition of IAsyncExecutor class.
i_backend.h
Definition of IBackend class.
i_client_impl.h
Definition of IClientImpl class.
logger.h
Definition of Logger class.
msgpack_rpc::clients::impl
Namespace of internal implementations.
Definition
i_call_future_impl.h:26
msgpack_rpc::clients::impl::create_empty_client_builder_impl
std::unique_ptr< IClientBuilderImpl > create_empty_client_builder_impl(std::shared_ptr< executors::IAsyncExecutor > executor, std::shared_ptr< logging::Logger > logger, config::ClientConfig config)
Create an empty IClientBuilderImpl object.
Definition
client_builder_impl.cpp:30
msgpack_rpc::clients::impl::create_default_client_builder_impl
std::unique_ptr< IClientBuilderImpl > create_default_client_builder_impl(config::ClientConfig config, const std::shared_ptr< logging::Logger > &logger)
Create an IClientBuilderImpl object with default protocols.
Definition
client_builder_impl.cpp:37
msgpack_rpc::config
Namespace of configurations.
Definition
client_config.h:32
msgpack_rpc::executors
Namespace of executors to process asynchronous tasks.
Definition
asio_context_type.h:24
msgpack_rpc::logging
Namespace of logging.
Definition
i_log_sink.h:27
std
STL namespace.
uri.h
Definition of URI class.
include
msgpack_rpc
clients
impl
i_client_builder_impl.h
Generated on
for cpp-msgpack-rpc by
1.18.0