HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_BoostAsio.h
Go to the documentation of this file.
1 /*
2  * POPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: NET_BoostAsio.h
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __NET_BOOSTASIO_H__
13 #define __NET_BOOSTASIO_H__
14 
15 #include "NET_API.h"
16 
17 #include <SYS/SYS_Pragma.h>
18 
19 // Enable this if you need to track asio handlers.
20 #if UT_ASSERT_LEVEL > 0
21 //#define BOOST_ASIO_ENABLE_HANDLER_TRACKING
22 #endif
23 
24 // This is required for Windows. We are treating a warning that boost asio
25 // generates as an error which causes the build to fail.
28 
29 #include <hboost/asio.hpp>
30 
32 
33 // This is a poor mans version of handler tracking. When boost gets bumped up
34 // to a version that has handler tracking swap this out for the boost asio
35 // handler tracking macros.
36 #ifdef BOOST_ASIO_ENABLE_HANDLER_TRACKING
37 #define NET_HANDLER_LOCATION \
38  UTdebugFormat("{}", __func__);
39 #else
40 #define NET_HANDLER_LOCATION
41 #endif
42 
43 // TCP type alias
44 using NET_TCPSocket = hboost::asio::ip::tcp::socket;
45 using NET_TCPEndpoint = hboost::asio::ip::tcp::endpoint;
46 using NET_TCPAcceptor = hboost::asio::ip::tcp::acceptor;
47 using NET_TCPResolver = hboost::asio::ip::tcp::resolver;
48 
49 // UDP type alias
50 using NET_UDPSocket = hboost::asio::ip::udp::socket;
51 using NET_UDPEndpoint = hboost::asio::ip::udp::endpoint;
52 using NET_UDPResolver = hboost::asio::ip::udp::resolver;
53 
54 // IP Address alias
56 using NET_IPAddressV4 = hboost::asio::ip::address_v4;
57 using NET_IPAddressV6 = hboost::asio::ip::address_v6;
58 using NET_IPNetworkV4 = hboost::asio::ip::network_v4;
59 using NET_IPNetworkV6 = hboost::asio::ip::network_v6;
60 
61 // Buffers
62 using NET_ConstBuffer = hboost::asio::const_buffer;
63 using NET_MutableBuffer = hboost::asio::mutable_buffer;
64 using NET_StreamBuffer = hboost::asio::streambuf;
65 template <typename T, typename Allocator = std::allocator<T>>
66 using NET_DynamicVectorBuffer = hboost::asio::dynamic_vector_buffer<T, Allocator>;
67 
68 // Timers
69 using NET_DeadlineTimer = hboost::asio::deadline_timer;
70 
71 using NET_IOStrand = hboost::asio::io_context::strand;
72 
73 using NET_IOContext = hboost::asio::io_context;
74 template <typename ExecutorT>
75 using NET_ExecutorWorkGuard = hboost::asio::executor_work_guard<ExecutorT>;
76 
77 // Houdini Main IO context.
79 
80 // Extensions to the boost.asio library (i.e. sendfile support).
81 #include "NET_BoostAsioExt.h"
82 
83 #endif // __NET_BOOSTASIO_H__
84 
#define SYS_PRAGMA_PUSH_WARN()
Definition: SYS_Pragma.h:34
hboost::asio::io_context NET_IOContext
Definition: NET_BoostAsio.h:73
hboost::asio::ip::udp::resolver NET_UDPResolver
Definition: NET_BoostAsio.h:52
#define SYS_PRAGMA_DISABLE_OVERLOADED_VIRTUAL()
Definition: SYS_Pragma.h:59
hboost::asio::ip::tcp::resolver NET_TCPResolver
Definition: NET_BoostAsio.h:47
hboost::asio::ip::address_v6 NET_IPAddressV6
Definition: NET_BoostAsio.h:57
hboost::asio::ip::address NET_IPAddress
Definition: NET_BoostAsio.h:55
hboost::asio::executor_work_guard< ExecutorT > NET_ExecutorWorkGuard
Definition: NET_BoostAsio.h:75
hboost::asio::dynamic_vector_buffer< T, Allocator > NET_DynamicVectorBuffer
Definition: NET_BoostAsio.h:66
hboost::asio::ip::network_v4 NET_IPNetworkV4
Definition: NET_BoostAsio.h:58
#define NET_API
Definition: NET_API.h:9
hboost::asio::mutable_buffer NET_MutableBuffer
Definition: NET_BoostAsio.h:63
hboost::asio::ip::udp::endpoint NET_UDPEndpoint
Definition: NET_BoostAsio.h:51
GLuint GLuint64EXT address
Definition: glew.h:14913
#define SYS_PRAGMA_POP_WARN()
Definition: SYS_Pragma.h:35
hboost::asio::ip::udp::socket NET_UDPSocket
Definition: NET_BoostAsio.h:50
hboost::asio::io_context::strand NET_IOStrand
Definition: NET_BoostAsio.h:71
hboost::asio::ip::tcp::endpoint NET_TCPEndpoint
Definition: NET_BoostAsio.h:45
hboost::asio::streambuf NET_StreamBuffer
Definition: NET_BoostAsio.h:64
hboost::asio::ip::tcp::acceptor NET_TCPAcceptor
Definition: NET_BoostAsio.h:46
hboost::asio::ip::tcp::socket NET_TCPSocket
Definition: NET_BoostAsio.h:44
hboost::asio::ip::address_v4 NET_IPAddressV4
Definition: NET_BoostAsio.h:56
hboost::asio::ip::network_v6 NET_IPNetworkV6
Definition: NET_BoostAsio.h:59
hboost::asio::const_buffer NET_ConstBuffer
Definition: NET_BoostAsio.h:62
hboost::asio::deadline_timer NET_DeadlineTimer
Definition: NET_BoostAsio.h:69
NET_API NET_IOContext & NEThoudiniIOContext()