GComm  0.2.3
protostack.hpp
1 /*
2  * Copyright (C) 2009 Codership Oy <info@codership.com>
3  */
4 
5 #ifndef GCOMM_PROTOSTACK_HPP
6 #define GCOMM_PROTOSTACK_HPP
7 
8 #include "gcomm/protolay.hpp"
9 
10 #include "gu_lock.hpp"
11 
12 #include <deque>
13 
14 namespace gcomm
15 {
16  class Socket;
17  class Acceptor;
18  class Protostack;
19  class Protonet;
20  class BoostProtonet;
21 }
22 
23 
25 {
26 public:
27  Protostack() : protos_(), mutex_() { }
28  void push_proto(Protolay* p);
29  void pop_proto(Protolay* p);
30  gu::datetime::Date handle_timers();
31  void dispatch(const void* id, const Datagram& dg,
32  const ProtoUpMeta& um);
33  bool set_param(const std::string&, const std::string&);
34  void enter() { mutex_.lock(); }
35  void leave() { mutex_.unlock(); }
36 private:
37  friend class Protonet;
38  std::deque<Protolay*> protos_;
39  gu::Mutex mutex_;
40 };
41 
42 
43 #endif // GCOMM_PROTOSTACK_HPP
Definition: protostack.hpp:24
Definition: protonet.hpp:37
Definition: protolay.hpp:192
Protocol layer interface definitions.
Definition: protolay.hpp:77
Datagram container.
Definition: datagram.hpp:151