cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
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 */
21
22#include <memory>
23#include <utility>
24#include <vector>
25
30
32
33std::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
41std::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,
49 executor, server_config.message_parser(), logger),
50 server_config.uris());
51
52 return builder;
53}
54
55} // namespace msgpack_rpc::servers::impl
Definition of BackendList class.
Class of configurations of servers.
ExecutorConfig & executor() noexcept
Get the configuration of executors.
const std::vector< addresses::URI > & uris() const noexcept
Get the URIs of the server.
MessageParserConfig & message_parser() noexcept
Get the configuration of parsers of messages.
Class of lists of backends of protocols.
Definition of create_default_backend_list function.
Definition of IServerBuilderImpl class.
std::shared_ptr< IAsyncExecutor > create_executor(std::shared_ptr< logging::Logger > logger, const config::ExecutorConfig &config)
Create an executor.
Namespace of internal implementation.
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.
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.
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 of ServerBuilderImpl class.
Definition of URI class.