OGLplus  (0.59.0) a C++ wrapper for rendering APIs

acceptor.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_MESSAGE_BUS_ACCEPTOR_HPP
10 #define EAGINE_MESSAGE_BUS_ACCEPTOR_HPP
11 
12 #include "connection.hpp"
13 
14 namespace eagine::msgbus {
15 //------------------------------------------------------------------------------
21 
23  using accept_handler = callable_ref<void(std::unique_ptr<connection>)>;
24 
26  virtual auto update() -> bool {
27  return false;
28  }
29 
31  virtual auto process_accepted(const accept_handler& handler) -> bool = 0;
32 };
33 //------------------------------------------------------------------------------
38 struct acceptor_user : interface<acceptor_user> {
39 
42  virtual auto add_acceptor(std::shared_ptr<acceptor> an_acceptor)
43  -> bool = 0;
44 };
45 //------------------------------------------------------------------------------
46 } // namespace eagine::msgbus
47 
48 #endif // EAGINE_MESSAGE_BUS_ACCEPTOR_HPP
virtual auto process_accepted(const accept_handler &handler) -> bool=0
Lets the handler process the pending accepted connections.
Declaration of class template storing a reference to a callable object.
Definition: callable_ref.hpp:24
virtual auto update() -> bool
Updates the internal state of the acceptor (called repeatedly).
Definition: acceptor.hpp:26
Interface for message bus connection acceptors.
Definition: acceptor.hpp:20
Base template for abstract interfaces, implements common functionality.
Definition: interface.hpp:18
Interface for classes that can use message bus connection acceptors.
Definition: acceptor.hpp:38
virtual auto add_acceptor(std::shared_ptr< acceptor > an_acceptor) -> bool=0
Adds the specified message bus connection acceptor. Result indicates if the acceptor was used or disc...
Message bus code is placed in this namespace.
Definition: eagine.hpp:58
Basic interface for retrieving message bus connection information.
Definition: connection.hpp:98
callable_ref< void(std::unique_ptr< connection >)> accept_handler
Alias for accepted connection handler callable reference type.
Definition: acceptor.hpp:23

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).