Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / protocols / ace / INet / SSLSock_IOStream.h
blob92d719136364b7475935b66e930b4cdb711b463a
1 /**
2 * @file SSLSock_IOStream.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_IOS_SSLSOCK_IOSTREAM_H
8 #define ACE_IOS_SSLSOCK_IOSTREAM_H
10 #include /**/ "ace/pre.h"
12 #include /**/ "ace/config-all.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "ace/SSL/SSL_SOCK_Stream.h"
19 #include "ace/INet/BidirStreamBuffer.h"
20 #include "ace/INet/StreamHandler.h"
21 #include "ace/INet/StreamInterceptor.h"
22 #include <istream>
23 #include <ostream>
25 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 namespace ACE
29 namespace IOS
31 /**
32 * @class ACE_IOS_SSLSock_StreamBuffer
34 * @brief
37 template <ACE_SYNCH_DECL>
38 class SSLSock_StreamBufferBase
39 : public BidirStreamBuffer<StreamHandler<ACE_SSL_SOCK_Stream, ACE_SYNCH_USE> >
41 public:
42 typedef StreamHandler<ACE_SSL_SOCK_Stream, ACE_SYNCH_USE> stream_type;
44 SSLSock_StreamBufferBase (stream_type* stream);
45 virtual ~SSLSock_StreamBufferBase ();
47 private:
48 enum
50 BUFFER_SIZE = 1024
54 /**
55 * @class ACE_IOS_SSLSock_IOS
57 * @brief
60 template <ACE_SYNCH_DECL>
61 class SSLSock_IOSBase
62 : public virtual std::ios
64 public:
65 typedef SSLSock_StreamBufferBase<ACE_SYNCH_USE> buffer_type;
66 typedef typename buffer_type::stream_type stream_type;
68 SSLSock_IOSBase (stream_type* stream);
69 ~SSLSock_IOSBase ();
71 buffer_type* rdbuf ();
73 void close ();
75 const stream_type& stream () const;
77 protected:
78 buffer_type streambuf_;
81 /**
82 * @class ACE_IOS_SSLSock_OStream
84 * @brief
87 template <ACE_SYNCH_DECL>
88 class SSLSock_OStreamBase
89 : public SSLSock_IOSBase<ACE_SYNCH_USE>, public std::ostream
91 public:
92 typedef SSLSock_IOSBase<ACE_SYNCH_USE> ios_base;
93 typedef typename ios_base::stream_type stream_type;
94 typedef SSLSock_StreamBufferBase<ACE_SYNCH_USE> buffer_type;
96 explicit SSLSock_OStreamBase(stream_type* stream);
98 buffer_type* rdbuf ()
99 { return ios_base::rdbuf (); }
101 ~SSLSock_OStreamBase();
103 void set_interceptor (typename buffer_type::interceptor_type& interceptor);
107 * @class ACE_IOS_SSLSock_IStream
109 * @brief
112 template <ACE_SYNCH_DECL>
113 class SSLSock_IStreamBase
114 : public SSLSock_IOSBase<ACE_SYNCH_USE>, public std::istream
116 public:
117 typedef SSLSock_IOSBase<ACE_SYNCH_USE> ios_base;
118 typedef typename ios_base::stream_type stream_type;
119 typedef SSLSock_StreamBufferBase<ACE_SYNCH_USE> buffer_type;
121 explicit SSLSock_IStreamBase(stream_type* stream);
123 buffer_type* rdbuf ()
124 { return ios_base::rdbuf (); }
126 ~SSLSock_IStreamBase();
128 void set_interceptor (typename buffer_type::interceptor_type& interceptor);
132 * @class ACE_IOS_SSLSock_IOStream
134 * @brief
137 template <ACE_SYNCH_DECL>
138 class SSLSock_IOStreamBase
139 : public SSLSock_IOSBase<ACE_SYNCH_USE>, public std::iostream
141 public:
142 typedef SSLSock_IOSBase<ACE_SYNCH_USE> ios_base;
143 typedef typename ios_base::stream_type stream_type;
144 typedef SSLSock_StreamBufferBase<ACE_SYNCH_USE> buffer_type;
146 explicit SSLSock_IOStreamBase(stream_type* stream);
148 buffer_type* rdbuf ()
149 { return ios_base::rdbuf (); }
151 ~SSLSock_IOStreamBase();
153 void set_interceptor (typename buffer_type::interceptor_type& interceptor);
156 typedef SSLSock_StreamBufferBase<ACE_NULL_SYNCH> SSLSock_StreamBuffer;
157 typedef SSLSock_IOSBase<ACE_NULL_SYNCH> SSLSock_IOS;
158 typedef SSLSock_IStreamBase<ACE_NULL_SYNCH> SSLSock_IStream;
159 typedef SSLSock_OStreamBase<ACE_NULL_SYNCH> SSLSock_OStream;
160 typedef SSLSock_IOStreamBase<ACE_NULL_SYNCH> SSLSock_IOStream;
164 ACE_END_VERSIONED_NAMESPACE_DECL
166 #include "ace/INet/SSLSock_IOStream.cpp"
168 #include /**/ "ace/post.h"
169 #endif /* ACE_IOS_SSLSOCK_IOSTREAM_H */