Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
router.hh
Go to the documentation of this file.
1 #pragma once
2 #include "../network/netobserver.hh"
3 #include <functional>
4 #include <map>
5 
6 namespace eclipse {
7 using namespace eclipse::network;
8 
20 class Router: public NetObserver {
21  public:
22  Router() = default;
23  virtual ~Router() = default;
24 
25  virtual void on_read(messages::Message*, Channel*) = 0;
26 
27  protected:
28  std::map<std::string, std::function<void(messages::Message*, Channel*)>> routing_table;
29 };
30 
31 } /* eclipse */
Definition: netobserver.hh:9
Definition: message.hh:15
std::map< std::string, std::function< void(messages::Message *, Channel *)> > routing_table
Definition: router.hh:28
Definition: router.hh:20
Definition: channel.hh:10