Design Patterns
tcp_state.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef OPERATIONAL_STATE_TCP_STATE_H_
7 #define OPERATIONAL_STATE_TCP_STATE_H_
8 
9 #include "tcp_connection.h"
10 
11 namespace operational
12 {
13 namespace state
14 {
15 class TcpState
16 {
17  public:
18  virtual ~TcpState() {}
19 
20  virtual void Transmit(TcpConnection*, TcpOctetStream*);
21  virtual void ActiveOpen(TcpConnection*);
22  virtual void PassiveOpen(TcpConnection*);
23  virtual void Close(TcpConnection*);
24  virtual void Synchronize(TcpConnection*);
25  virtual void Acknowledge(TcpConnection*);
26  virtual void Send(TcpConnection*);
27 
28  virtual std::string Info() const = 0;
29 
30  protected:
31  static void ChangeState(TcpConnection*, TcpState*);
32 };
33 }
34 }
35 
36 #endif
37 
Definition: application.cc:10
virtual void PassiveOpen(TcpConnection *)
Definition: tcp_state.cc:16
Definition: tcp_octet_stream.h:13
static void ChangeState(TcpConnection *, TcpState *)
Definition: tcp_state.cc:26
Definition: tcp_state.h:15
virtual void Synchronize(TcpConnection *)
Definition: tcp_state.cc:20
virtual void ActiveOpen(TcpConnection *)
Definition: tcp_state.cc:14
virtual void Acknowledge(TcpConnection *)
Definition: tcp_state.cc:22
virtual ~TcpState()
Definition: tcp_state.h:18
virtual std::string Info() const =0
virtual void Transmit(TcpConnection *, TcpOctetStream *)
Definition: tcp_state.cc:12
Definition: tcp_connection.h:17
virtual void Send(TcpConnection *)
Definition: tcp_state.cc:24
virtual void Close(TcpConnection *)
Definition: tcp_state.cc:18