summaryrefslogtreecommitdiff
path: root/ACE/protocols/ace/INet/HTTP_StreamPolicyBase.h
blob: 5f2e1b58097d606ab4e5e4e86fbb83b29ff6c014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
 * @file HTTP_StreamPolicyBase.h
 *
 * @author Martin Corino <mcorino@remedy.nl>
 */

#ifndef ACE_HTTP_STREAM_POLICY_BASE_H
#define ACE_HTTP_STREAM_POLICY_BASE_H

#include /**/ "ace/pre.h"

#include "ace/INet/INet_Export.h"
#include "ace/INet/BufferedStreamBuffer.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

namespace ACE
  {
    namespace HTTP
      {
        /**
        * @class ACE_IOS_StreamPolicyBase
        *
        * @brief Abstract base for HTTP stream policies.
        *
        */
        template <class STREAM_BUFFER>
        class StreamPolicyBase
          {
            public:
              StreamPolicyBase ();
              virtual ~StreamPolicyBase ();

              typedef typename STREAM_BUFFER::char_type char_type;

              virtual int read_from_stream (char_type* buffer, std::streamsize length) = 0;

              virtual int write_to_stream (const char_type* buffer, std::streamsize length) = 0;

              void set_stream_buffer (STREAM_BUFFER* streambuf);

            protected:
              int read_from_stream_i (char_type* buffer, std::streamsize length);

              int write_to_stream_i (const char_type* buffer, std::streamsize length);

            private:
              STREAM_BUFFER* streambuf_;
          };
      }
  }

ACE_END_VERSIONED_NAMESPACE_DECL

#include "ace/INet/HTTP_StreamPolicyBase.cpp"

#include /**/ "ace/post.h"
#endif /* ACE_HTTP_STREAM_POLICY_BASE_H */