1 | |
---|---|
2 | // vim:sw=2:ai |
3 | |
4 | /* |
5 | * Copyright (C) 2010 DeNA Co.,Ltd.. All rights reserved. |
6 | * See COPYRIGHT.txt for details. |
7 | */ |
8 | |
9 | #ifndef DENA_HSTCPSVR_WORKER_HPP |
10 | #define DENA_HSTCPSVR_WORKER_HPP |
11 | |
12 | #include "hstcpsvr.hpp" |
13 | |
14 | namespace dena { |
15 | |
16 | struct hstcpsvr_worker_i; |
17 | typedef std::auto_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr; |
18 | |
19 | struct hstcpsvr_worker_arg { |
20 | const hstcpsvr_shared_c *cshared; |
21 | volatile hstcpsvr_shared_v *vshared; |
22 | long worker_id; |
23 | hstcpsvr_worker_arg() : cshared(0), vshared(0), worker_id(0) { } |
24 | }; |
25 | |
26 | struct hstcpsvr_worker_i { |
27 | virtual ~hstcpsvr_worker_i() { } |
28 | virtual void run() = 0; |
29 | static hstcpsvr_worker_ptr create(const hstcpsvr_worker_arg& arg); |
30 | }; |
31 | |
32 | }; |
33 | |
34 | #endif |
35 | |
36 |