cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
i_server_builder_impl.cpp
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
#include "
msgpack_rpc/servers/impl/i_server_builder_impl.h
"
21
22
#include <memory>
23
#include <utility>
24
#include <vector>
25
26
#include "
msgpack_rpc/addresses/uri.h
"
27
#include "
msgpack_rpc/servers/impl/server_builder_impl.h
"
28
#include "
msgpack_rpc/transport/backend_list.h
"
29
#include "
msgpack_rpc/transport/create_default_backend_list.h
"
30
31
namespace
msgpack_rpc::servers::impl
{
32
33
std::unique_ptr<IServerBuilderImpl>
create_empty_server_builder_impl
(
34
std::shared_ptr<executors::IAsyncExecutor> executor,
35
std::shared_ptr<logging::Logger> logger) {
36
return
std::make_unique<ServerBuilderImpl>(std::move(executor),
37
std::move(logger),
transport::BackendList
(),
38
std::vector<addresses::URI>{});
39
}
40
41
std::unique_ptr<IServerBuilderImpl>
create_default_builder_impl
(
42
const
config::ServerConfig
& server_config,
43
const
std::shared_ptr<logging::Logger>& logger) {
44
const
auto
executor =
45
executors::create_executor
(logger, server_config.
executor
());
46
47
auto
builder = std::make_unique<ServerBuilderImpl>(executor, logger,
48
transport::create_default_backend_list
(
49
executor, server_config.
message_parser
(), logger),
50
server_config.
uris
());
51
52
return
builder;
53
}
54
55
}
// namespace msgpack_rpc::servers::impl
backend_list.h
Definition of BackendList class.
msgpack_rpc::config::ServerConfig
Class of configurations of servers.
Definition
server_config.h:35
msgpack_rpc::config::ServerConfig::executor
ExecutorConfig & executor() noexcept
Get the configuration of executors.
Definition
server_config.cpp:51
msgpack_rpc::config::ServerConfig::uris
const std::vector< addresses::URI > & uris() const noexcept
Get the URIs of the server.
Definition
server_config.cpp:39
msgpack_rpc::config::ServerConfig::message_parser
MessageParserConfig & message_parser() noexcept
Get the configuration of parsers of messages.
Definition
server_config.cpp:43
msgpack_rpc::transport::BackendList
Class of lists of backends of protocols.
Definition
backend_list.h:39
create_default_backend_list.h
Definition of create_default_backend_list function.
i_server_builder_impl.h
Definition of IServerBuilderImpl class.
msgpack_rpc::executors::create_executor
std::shared_ptr< IAsyncExecutor > create_executor(std::shared_ptr< logging::Logger > logger, const config::ExecutorConfig &config)
Create an executor.
Definition
general_executor.cpp:309
msgpack_rpc::servers::impl
Namespace of internal implementation.
Definition
i_server_builder_impl.h:33
msgpack_rpc::servers::impl::create_empty_server_builder_impl
std::unique_ptr< IServerBuilderImpl > create_empty_server_builder_impl(std::shared_ptr< executors::IAsyncExecutor > executor, std::shared_ptr< logging::Logger > logger)
Create an empty IServerBuilderImpl object.
Definition
i_server_builder_impl.cpp:33
msgpack_rpc::servers::impl::create_default_builder_impl
std::unique_ptr< IServerBuilderImpl > create_default_builder_impl(const config::ServerConfig &server_config, const std::shared_ptr< logging::Logger > &logger)
Create an IServerBuilderImpl object with default protocols.
Definition
i_server_builder_impl.cpp:41
msgpack_rpc::transport::create_default_backend_list
BackendList create_default_backend_list(const std::shared_ptr< executors::IExecutor > &executor, const config::MessageParserConfig &message_parser_config, const std::shared_ptr< logging::Logger > &logger)
Create a list of backends with default backends of protocols.
Definition
create_default_backend_list.h:41
server_builder_impl.h
Definition of ServerBuilderImpl class.
uri.h
Definition of URI class.
src
msgpack_rpc
servers
impl
i_server_builder_impl.cpp
Generated on
for cpp-msgpack-rpc by
1.18.0