TDME2
1.9.200
src
tdme
network
udpserver
ServerWorkerThread.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <stdint.h>
4
5
#include <
tdme/tdme.h
>
6
#include <
tdme/network/udpserver/ServerWorkerThreadPool.h
>
7
#include <
tdme/os/threading/Barrier.h
>
8
#include <
tdme/os/threading/Thread.h
>
9
10
using
tdme::os::threading::Barrier
;
11
using
tdme::os::threading::Thread
;
12
13
namespace
tdme
{
14
namespace
network {
15
namespace
udpserver {
16
17
class
ServerWorkerThreadPool;
18
19
/**
20
* @brief Server worker thread
21
* @author Andreas Drewke
22
*/
23
class
ServerWorkerThread
final:
public
Thread
{
24
public
:
25
// forbid class copy
26
FORBID_CLASS_COPY
(
ServerWorkerThread
)
27
28
/**
29
* @brief Public constructor
30
* @param id id
31
* @param threadPool thread pool
32
* @param startUpBarrier start up barrier
33
*/
34
ServerWorkerThread
(
const
unsigned
int
id
,
ServerWorkerThreadPool
*
threadPool
,
Barrier
*
startUpBarrier
);
35
36
/**
37
* @brief Public destructor
38
*/
39
virtual
~ServerWorkerThread
();
40
41
private
:
42
unsigned
int
id
;
43
ServerWorkerThreadPool
*
threadPool
;
44
Barrier
*
startUpBarrier
;
45
46
/**
47
* @brief Thread run method
48
*/
49
void
run
();
50
51
};
52
53
};
54
};
55
};
Barrier.h
ServerWorkerThreadPool.h
Thread.h
tdme::network::udpserver::ServerWorkerThreadPool
Simple server worker thread pool class.
Definition:
ServerWorkerThreadPool.h:28
tdme::network::udpserver::ServerWorkerThread
Server worker thread.
Definition:
ServerWorkerThread.h:23
tdme::network::udpserver::ServerWorkerThread::run
void run()
Thread run method.
Definition:
ServerWorkerThread.cpp:42
tdme::network::udpserver::ServerWorkerThread::threadPool
ServerWorkerThreadPool * threadPool
Definition:
ServerWorkerThread.h:43
tdme::network::udpserver::ServerWorkerThread::id
unsigned int id
Definition:
ServerWorkerThread.h:42
tdme::network::udpserver::ServerWorkerThread::ServerWorkerThread
ServerWorkerThread(const unsigned int id, ServerWorkerThreadPool *threadPool, Barrier *startUpBarrier)
Public constructor.
Definition:
ServerWorkerThread.cpp:31
tdme::network::udpserver::ServerWorkerThread::~ServerWorkerThread
virtual ~ServerWorkerThread()
Public destructor.
Definition:
ServerWorkerThread.cpp:39
tdme::network::udpserver::ServerWorkerThread::startUpBarrier
Barrier * startUpBarrier
Definition:
ServerWorkerThread.h:44
tdme::os::threading::Barrier
Barrier implementation.
Definition:
Barrier.h:21
tdme::os::threading::Thread
Base class for threads.
Definition:
Thread.h:20
tdme
Definition:
fwd-tdme.h:4
tdme.h
FORBID_CLASS_COPY
#define FORBID_CLASS_COPY(CLASS)
Definition:
tdme.h:6
Generated by
1.9.1