]> git.tdb.fi Git - libs/core.git/blob - source/io/handle.cpp
Use vectors for storage in Poller
[libs/core.git] / source / io / handle.cpp
1 #include "handle.h"
2 #include "handle_private.h"
3
4 namespace Msp {
5 namespace IO {
6
7 Handle::Handle():
8         priv(new Private)
9 { }
10
11 Handle::Handle(const Handle &other):
12         priv(new Private)
13 {
14         priv->handle = other.priv->handle;
15 }
16
17 Handle &Handle::operator=(const Handle &other)
18 {
19         priv->handle = other.priv->handle;
20         return *this;
21 }
22
23 Handle::~Handle()
24 {
25         delete priv;
26 }
27
28 Handle::operator const void *() const
29 {
30         return priv->handle!=INVALID_HANDLE_VALUE ? this : 0;
31 }
32
33
34 Handle::Private::Private():
35         handle(INVALID_HANDLE_VALUE)
36 { }
37
38 Handle::Private &Handle::Private::operator=(PlatformHandle h)
39 {
40         handle = h;
41         return *this;
42 }
43
44 } // namespace IO
45 } // namespace Msp