Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ACE_IOS_STREAM_INTERCEPTOR_H
00010 #define ACE_IOS_STREAM_INTERCEPTOR_H
00011
00012 #include "ace/pre.h"
00013
00014 #include "ace/config-all.h"
00015
00016 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00017 # pragma once
00018 #endif
00019
00020 #include "ace/INet/INet_Export.h"
00021 #include <iosfwd>
00022 #include <ios>
00023
00024 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00025
00026 namespace ACE
00027 {
00028 namespace IOS
00029 {
00030
00031
00032
00033
00034
00035
00036 template <class ACE_CHAR_T, class TR = std::char_traits<ACE_CHAR_T> >
00037 class StreamInterceptorBase
00038 {
00039 public:
00040 typedef std::basic_ios<ACE_CHAR_T, TR> ios_type;
00041 typedef ACE_CHAR_T char_type;
00042 typedef typename ios_type::openmode openmode;
00043
00044 virtual ~StreamInterceptorBase ();
00045 protected:
00046 StreamInterceptorBase ();
00047
00048 public:
00049 virtual void before_write (const char_type* buffer,
00050 std::streamsize length_to_write);
00051 virtual void after_write (int length_written);
00052 virtual void before_read (std::streamsize length_to_read);
00053 virtual void after_read (const char_type* buffer,
00054 int length_read);
00055 virtual void on_eof (void);
00056 };
00057
00058 typedef StreamInterceptorBase<char> StreamInterceptor;
00059
00060 }
00061 }
00062
00063 ACE_END_VERSIONED_NAMESPACE_DECL
00064
00065 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00066 #include "ace/INet/StreamInterceptor.cpp"
00067 #endif
00068
00069 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00070 #pragma implementation ("StreamInterceptor.cpp")
00071 #endif
00072
00073 #include "ace/post.h"
00074 #endif