00001 // $Id: HTTP_StreamPolicyBase.h 91118 2010-07-17 10:29:57Z mcorino $ 00002 00003 /** 00004 * @file HTTP_StreamPolicyBase.h 00005 * 00006 * @author Martin Corino <mcorino@remedy.nl> 00007 */ 00008 00009 #ifndef ACE_HTTP_STREAM_POLICY_BASE_H 00010 #define ACE_HTTP_STREAM_POLICY_BASE_H 00011 00012 #include /**/ "ace/pre.h" 00013 00014 #include "ace/INet/INet_Export.h" 00015 #include "ace/INet/BufferedStreamBuffer.h" 00016 00017 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00018 00019 namespace ACE 00020 { 00021 namespace HTTP 00022 { 00023 /** 00024 * @class ACE_IOS_StreamPolicyBase 00025 * 00026 * @brief Abstract base for HTTP stream policies. 00027 * 00028 */ 00029 template <class STREAM_BUFFER> 00030 class StreamPolicyBase 00031 { 00032 public: 00033 StreamPolicyBase (); 00034 virtual ~StreamPolicyBase (); 00035 00036 typedef typename STREAM_BUFFER::char_type char_type; 00037 00038 virtual int read_from_stream (char_type* buffer, std::streamsize length) = 0; 00039 00040 virtual int write_to_stream (const char_type* buffer, std::streamsize length) = 0; 00041 00042 void set_stream_buffer (STREAM_BUFFER* streambuf); 00043 00044 protected: 00045 int read_from_stream_i (char_type* buffer, std::streamsize length); 00046 00047 int write_to_stream_i (const char_type* buffer, std::streamsize length); 00048 00049 private: 00050 STREAM_BUFFER* streambuf_; 00051 }; 00052 } 00053 } 00054 00055 ACE_END_VERSIONED_NAMESPACE_DECL 00056 00057 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00058 #include "ace/INet/HTTP_StreamPolicyBase.cpp" 00059 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00060 00061 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00062 #pragma implementation ("HTTP_StreamPolicyBase.cpp") 00063 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00064 00065 #include /**/ "ace/post.h" 00066 #endif /* ACE_HTTP_STREAM_POLICY_BASE_H */