cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
server_config.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 <string_view>
23
25
26namespace msgpack_rpc::config {
27
29
31 uris_.push_back(uri);
32 return *this;
33}
34
35ServerConfig& ServerConfig::add_uri(std::string_view uri) {
36 return add_uri(addresses::URI::parse(uri));
37}
38
39const std::vector<addresses::URI>& ServerConfig::uris() const noexcept {
40 return uris_;
41}
42
46
48 return message_parser_;
49}
50
52
53const ExecutorConfig& ServerConfig::executor() const noexcept {
54 return executor_;
55}
56
57} // namespace msgpack_rpc::config
Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.
Definition uri.h:38
static URI parse(std::string_view uri_string)
Parse a string to create a URI.
Definition uri.cpp:54
Class of configuration of executors.
Class of configuration of parsers of messages.
ExecutorConfig & executor() noexcept
Get the configuration of executors.
ExecutorConfig executor_
Configuration of executors.
MessageParserConfig message_parser_
Configuration of parsers of messages.
std::vector< addresses::URI > uris_
URIs.
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.
ServerConfig & add_uri(const addresses::URI &uri)
Add a URI of the server.
Namespace of configurations.
Definition of ServerConfig class.
Definition of URI class.