blob: 2000eb3087eaa8a0f3cbfb85e0b273b437b30648 (
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
59
60
61
62
63
64
65
66
|
// $Id$
/**
* @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
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "ace/INet/HTTP_StreamPolicyBase.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
#pragma implementation ("HTTP_StreamPolicyBase.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
#include /**/ "ace/post.h"
#endif /* ACE_HTTP_STREAM_POLICY_BASE_H */
|