70 const std::shared_ptr<logging::Logger>& logger =
72 :
impl_(
impl::create_default_builder_impl(server_config, logger)) {}
81 impl_->listen_to(std::move(uri));
104 std::string_view host, std::uint16_t port_number) {
118 impl_->add_method(std::move(method));
135 template <
typename Signature,
typename Function>
139 std::forward<Function>(function),
impl_->logger()));
151 std::unique_ptr<impl::IServerBuilderImpl>
impl_;
Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.
static URI parse(std::string_view uri_string)
Parse a string to create a URI.
Class of configurations of servers.
static std::shared_ptr< Logger > create(const config::LoggingConfig &config=config::LoggingConfig())
Create a logger.
ServerBuilder(const std::shared_ptr< logging::Logger > &logger)
Constructor.
ServerBuilder & add_method(std::unique_ptr< methods::IMethod > method)
Add a method.
ServerBuilder(const config::ServerConfig &server_config, const std::shared_ptr< logging::Logger > &logger=logging::Logger::create())
Constructor.
ServerBuilder()
Constructor.
ServerBuilder & add_method(messages::MethodName name, Function &&function)
Add a method implemented by a function object.
Server build()
Build a server.
ServerBuilder & listen_to(std::string_view uri)
Add a URI to listen to.
ServerBuilder & listen_to_tcp(std::string_view host, std::uint16_t port_number)
Add a TCP address to listen to.
std::unique_ptr< impl::IServerBuilderImpl > impl_
Internal implementation.
ServerBuilder & listen_to(addresses::URI uri)
Add a URI to listen to.
Definition of FunctionalMethod class.
Definition of IMethod class.
Definition of IServerBuilderImpl class.
Definition of Logger class.
Definition of MethodName class.
constexpr std::string_view TCP_SCHEME
Scheme of TCP.
Namespace of configurations.
std::unique_ptr< FunctionalMethod< Signature, Function > > create_functional_method(messages::MethodName name, Function &&function, std::shared_ptr< logging::Logger > logger)
Create a method implemented by a function object.
Namespace of internal implementation.
Definition of constants of schemes.
Definition of Server class.
Definition of ServerConfig class.