TDME2
1.9.200
src
tdme
os
network
platform
fallback
KernelEventMechanismPSD.h
Go to the documentation of this file.
1
#pragma once
2
3
#if defined(_WIN32)
4
#include <winsock2.h>
5
#else
6
#include <sys/select.h>
7
#endif
8
9
#include <unordered_map>
10
#include <vector>
11
12
#include <
tdme/tdme.h
>
13
#include <
tdme/os/network/fwd-tdme.h
>
14
#include <
tdme/os/network/platform/fallback/fwd-tdme.h
>
15
#include <
tdme/os/network/NIOInterest.h
>
16
17
#include <
tdme/os/threading/Mutex.h
>
18
19
using
std::unordered_map;
20
using
std::vector;
21
22
using
tdme::os::threading::Mutex
;
23
24
/**
25
* Fallback/select kernel event mechanism platform specific data
26
* @author Andreas Drewke
27
*/
28
class
tdme::os::network::platform::fallback::KernelEventMechanismPSD
{
29
friend
class
tdme::os::network::KernelEventMechanism
;
30
31
private
:
32
struct
Event
{
33
Event
(
34
int
descriptor
,
35
NIOInterest
interest
,
36
void
*
cookie
37
):
38
descriptor
(
descriptor
),
39
interest
(
interest
),
40
cookie
(
cookie
)
41
{}
42
int
descriptor
;
43
NIOInterest
interest
;
44
void
*
cookie
;
45
};
46
47
// forbid class copy
48
FORBID_CLASS_COPY
(
KernelEventMechanismPSD
)
49
50
/**
51
* @brief Public constructor
52
*/
53
KernelEventMechanismPSD
() :
54
maxFd
(0),
55
fdsMutex
("kemfallbackpsdfdmutex")
56
{
57
//
58
}
59
60
int
maxFd
;
61
Mutex
fdsMutex
;
62
fd_set
rfds
;
63
fd_set
wfds
;
64
unordered_map<int, void*>
fds
;
65
vector<Event>
events
;
66
};
Mutex.h
NIOInterest.h
tdme::os::network::KernelEventMechanism
Interface to kernel event mechanismns.
Definition:
KernelEventMechanism.h:17
tdme::os::network::platform::fallback::KernelEventMechanismPSD
Fallback/select kernel event mechanism platform specific data.
Definition:
KernelEventMechanismPSD.h:28
tdme::os::network::platform::fallback::KernelEventMechanismPSD::maxFd
int maxFd
Definition:
KernelEventMechanismPSD.h:60
tdme::os::network::platform::fallback::KernelEventMechanismPSD::wfds
fd_set wfds
Definition:
KernelEventMechanismPSD.h:63
tdme::os::network::platform::fallback::KernelEventMechanismPSD::rfds
fd_set rfds
Definition:
KernelEventMechanismPSD.h:62
tdme::os::network::platform::fallback::KernelEventMechanismPSD::fds
unordered_map< int, void * > fds
Definition:
KernelEventMechanismPSD.h:64
tdme::os::network::platform::fallback::KernelEventMechanismPSD::events
vector< Event > events
Definition:
KernelEventMechanismPSD.h:65
tdme::os::network::platform::fallback::KernelEventMechanismPSD::fdsMutex
Mutex fdsMutex
Definition:
KernelEventMechanismPSD.h:61
tdme::os::threading::Mutex
Mutex implementation.
Definition:
Mutex.h:19
tdme::os::network::NIOInterest
uint8_t NIOInterest
type definition for network IO interest
Definition:
NIOInterest.h:10
fwd-tdme.h
fwd-tdme.h
tdme::os::network::platform::fallback::KernelEventMechanismPSD::Event
Definition:
KernelEventMechanismPSD.h:32
tdme::os::network::platform::fallback::KernelEventMechanismPSD::Event::interest
NIOInterest interest
Definition:
KernelEventMechanismPSD.h:43
tdme::os::network::platform::fallback::KernelEventMechanismPSD::Event::cookie
void * cookie
Definition:
KernelEventMechanismPSD.h:44
tdme::os::network::platform::fallback::KernelEventMechanismPSD::Event::Event
Event(int descriptor, NIOInterest interest, void *cookie)
Definition:
KernelEventMechanismPSD.h:33
tdme::os::network::platform::fallback::KernelEventMechanismPSD::Event::descriptor
int descriptor
Definition:
KernelEventMechanismPSD.h:42
tdme.h
FORBID_CLASS_COPY
#define FORBID_CLASS_COPY(CLASS)
Definition:
tdme.h:6
Generated by
1.9.1