ZeroEQ  0.8.0
ZeroEQ - Zero Event Queue
types.h
1 
2 /* Copyright (c) 2014-2017, Human Brain Project
3  * Daniel Nachbaur <daniel.nachbaur@epfl.ch>
4  * Juan Hernando <jhernando@fi.upm.es>
5  */
6 
7 #ifndef ZEROEQ_TYPES_H
8 #define ZEROEQ_TYPES_H
9 
10 #include <functional>
11 #include <memory>
12 #include <servus/types.h>
13 #include <servus/uint128_t.h>
14 #include <zeroeq/defines.h>
15 
16 #ifdef _WIN32
17 #define NOMINMAX
18 #include <winsock2.h> // SOCKET
19 #endif
20 
37 namespace zeroeq
38 {
39 using servus::uint128_t;
40 class Publisher;
41 class Subscriber;
42 class URI;
43 
45 typedef std::function<void()> EventFunc;
46 
48 typedef std::function<void(const void*, size_t)> EventPayloadFunc;
49 
50 #ifdef WIN32
51 typedef SOCKET SocketDescriptor;
52 #else
53 typedef int SocketDescriptor;
54 #endif
55 
57 // Attn: identical to Win32 INFINITE!
58 static const uint32_t TIMEOUT_INDEFINITE = 0xffffffffu;
59 
60 using servus::make_uint128;
61 
62 static const std::string DEFAULT_SESSION = "__zeroeq";
63 static const std::string NULL_SESSION = "__null_session";
64 
65 namespace detail
66 {
67 struct Socket;
68 }
69 }
70 
71 #endif
Enhances servus::URI to guarantee the existance of a schema and to allow construction of [host][:port...
Definition: uri.h:19
std::function< void(const void *, size_t)> EventPayloadFunc
Callback for receival of subscribed event w/ payload.
Definition: types.h:48
static const uint32_t TIMEOUT_INDEFINITE
Constant defining &#39;wait forever&#39; in methods with wait parameters.
Definition: types.h:58
std::function< void()> EventFunc
Callback for receival of subscribed event w/o payload.
Definition: types.h:42
Includes compile-time defines of ZeroEQ.
Publish-subscribe classes for typed events.
Definition: broker.h:12