cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
server_config.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 <string_view>
23#include <vector>
24
28#include "msgpack_rpc/impl/msgpack_rpc_export.h"
29
30namespace msgpack_rpc::config {
31
35class MSGPACK_RPC_EXPORT ServerConfig {
36public:
44
52
59 ServerConfig& add_uri(std::string_view uri);
60
66 [[nodiscard]] const std::vector<addresses::URI>& uris() const noexcept;
67
73 [[nodiscard]] MessageParserConfig& message_parser() noexcept;
74
80 [[nodiscard]] const MessageParserConfig& message_parser() const noexcept;
81
87 [[nodiscard]] ExecutorConfig& executor() noexcept;
88
94 [[nodiscard]] const ExecutorConfig& executor() const noexcept;
95
96private:
98 std::vector<addresses::URI> uris_;
99
102
105};
106
107} // namespace msgpack_rpc::config
Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.
Definition uri.h:38
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.
Definition of ExecutorConfig class.
Definition of MessageParserConfig class.
Namespace of addresses.
Definition i_address.h:26
Namespace of configurations.
STL namespace.
Definition of URI class.