Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / protocols / ace / INet / StreamInterceptor.h
blob1df803c1142bdc2199f8a8fdfa861a57e9beba76
1 /**
2 * @file StreamInterceptor.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_IOS_STREAM_INTERCEPTOR_H
8 #define ACE_IOS_STREAM_INTERCEPTOR_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/INet/INet_Export.h"
19 #include <iosfwd>
20 #include <ios>
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 namespace ACE
26 namespace IOS
28 /**
29 * @class ACE_IOS_StreamInterceptorBase
31 * @brief Abstract base for stream interceptors.
34 template <class ACE_CHAR_T, class TR = std::char_traits<ACE_CHAR_T> >
35 class StreamInterceptorBase
37 public:
38 typedef std::basic_ios<ACE_CHAR_T, TR> ios_type;
39 typedef ACE_CHAR_T char_type;
40 typedef typename ios_type::openmode openmode;
42 virtual ~StreamInterceptorBase ();
43 protected:
44 StreamInterceptorBase ();
46 public:
47 virtual void before_write (const char_type* buffer,
48 std::streamsize length_to_write);
49 virtual void after_write (int length_written);
50 virtual void before_read (std::streamsize length_to_read);
51 virtual void after_read (const char_type* buffer,
52 int length_read);
53 virtual void on_eof ();
56 typedef StreamInterceptorBase<char> StreamInterceptor;
60 ACE_END_VERSIONED_NAMESPACE_DECL
62 #include "ace/INet/StreamInterceptor.cpp"
64 #include /**/ "ace/post.h"
65 #endif /* ACE_IOS_STREAM_INTERCEPTOR_H */