RCFProto
 All Classes Functions Typedefs
AsioFwd.hpp
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 2.0
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18 
19 #ifndef INCLUDE_RCF_ASIOFWD_HPP
20 #define INCLUDE_RCF_ASIOFWD_HPP
21 
22 #include <RCF/Config.hpp>
23 
24 #include <boost/shared_ptr.hpp>
25 
26 #if defined(__CYGWIN__) && !defined(RCF_USE_BOOST_ASIO)
27 #error RCF_USE_BOOST_ASIO must be defined when building on Cygwin.
28 #endif
29 
30 
31 namespace boost {
32  namespace posix_time {
33  class ptime;
34  }
35 }
36 
37 #ifdef RCF_USE_BOOST_ASIO
38 
39 //------------------------------------------------------------------------------
40 // Use Boost.Asio
41 
42 #define ASIO_NS boost::asio
43 
44 namespace boost {
45 namespace asio {
46 
47  class io_service;
48 
49  namespace windows {
50  template<typename T> class basic_stream_handle;
51 
52  class stream_handle_service;
53  typedef basic_stream_handle<stream_handle_service> stream_handle;
54  }
55 
56 }
57 namespace system {
58  class error_code;
59 }
60 }
61 namespace RCF {
62  typedef boost::system::error_code AsioErrorCode;
63 };
64 
65 //------------------------------------------------------------------------------
66 
67 #else
68 
69 //------------------------------------------------------------------------------
70 // Use internal Asio
71 
72 #define ASIO_NS asio
73 
74 namespace asio {
75 
76  class io_service;
77  class error_code;
78 
79  namespace windows {
80  template<typename T> class basic_stream_handle;
81 
82  class stream_handle_service;
83  typedef basic_stream_handle<stream_handle_service> stream_handle;
84  }
85 
86 }
87 namespace RCF {
88  typedef asio::error_code AsioErrorCode;
89 };
90 
91 //------------------------------------------------------------------------------
92 
93 #endif
94 
95 namespace RCF {
96 
97  typedef ASIO_NS::io_service AsioIoService;
98  typedef boost::shared_ptr<AsioIoService> AsioIoServicePtr;
99 
100  typedef ASIO_NS::windows::stream_handle AsioPipeHandle;
101  typedef boost::shared_ptr<AsioPipeHandle> AsioPipeHandlePtr;
102 
103  class AsioTimer;
104  typedef boost::shared_ptr<AsioTimer> AsioTimerPtr;
105 
106  class AsioBuffers;
107  typedef boost::shared_ptr<AsioBuffers> AsioBuffersPtr;
108 
109 } // namespace RCF
110 
111 #endif // ! INCLUDE_RCF_ASIOFWD_HPP