Public Types | Public Member Functions | Protected Types | Protected Member Functions | Private Attributes | Friends

ACE::HTTP::StreamBuffer Class Reference

#include <HTTP_IOStream.h>

Inheritance diagram for ACE::HTTP::StreamBuffer:
Inheritance graph
[legend]
Collaboration diagram for ACE::HTTP::StreamBuffer:
Collaboration graph
[legend]

List of all members.

Public Types

typedef StreamPolicyBase
< StreamBuffer
policy_type

Public Member Functions

 StreamBuffer (std::iostream &stream, policy_type *policy=0)
virtual ~StreamBuffer ()
virtual int sync ()

Protected Types

enum  { BUFFER_SIZE = 4096 }

Protected Member Functions

virtual int read_from_stream (char *buffer, std::streamsize length)
virtual int write_to_stream (const char *buffer, std::streamsize length)
virtual int read_from_stream_i (char *buffer, std::streamsize length)
virtual int write_to_stream_i (const char *buffer, std::streamsize length)

Private Attributes

std::iostream & stream_
policy_typepolicy_

Friends

class StreamPolicyBase< StreamBuffer >

Detailed Description

Definition at line 39 of file HTTP_IOStream.h.


Member Typedef Documentation

Definition at line 43 of file HTTP_IOStream.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
BUFFER_SIZE 

Definition at line 53 of file HTTP_IOStream.h.

                {
                  BUFFER_SIZE = 4096
                };


Constructor & Destructor Documentation

ACE::HTTP::StreamBuffer::StreamBuffer ( std::iostream &  stream,
StreamBuffer::policy_type policy = 0 
)

Definition at line 21 of file HTTP_IOStream.cpp.

      : ACE::IOS::BufferedStreamBuffer (BUFFER_SIZE,
                                        std::ios::in | std::ios::out),
        stream_ (stream),
        policy_ (policy)
      {
        if (this->policy_)
          this->policy_->set_stream_buffer (this);
      }

ACE::HTTP::StreamBuffer::~StreamBuffer (  )  [virtual]

Definition at line 31 of file HTTP_IOStream.cpp.

      {
        if (this->policy_)
          delete this->policy_;
      }


Member Function Documentation

int ACE::HTTP::StreamBuffer::read_from_stream ( char *  buffer,
std::streamsize  length 
) [protected, virtual]

Definition at line 37 of file HTTP_IOStream.cpp.

      {
        if (this->policy_)
          return this->policy_->read_from_stream (buffer, length);
        else
          return this->read_from_stream_i (buffer, length);
      }

int ACE::HTTP::StreamBuffer::read_from_stream_i ( char *  buffer,
std::streamsize  length 
) [protected, virtual]

Definition at line 45 of file HTTP_IOStream.cpp.

      {
        this->stream_.read (buffer, length);
        return ACE_Utils::truncate_cast<int> (this->stream_.gcount ());
      }

int ACE::HTTP::StreamBuffer::sync ( void   )  [virtual]

Reimplemented from ACE::IOS::BasicBufferedStreamBuffer< ACE_CHAR_T, TR >.

Definition at line 65 of file HTTP_IOStream.cpp.

      {
        if (ACE::IOS::BufferedStreamBuffer::sync () == -1)
          return -1;
        return this->stream_.sync ();
      }

int ACE::HTTP::StreamBuffer::write_to_stream ( const char *  buffer,
std::streamsize  length 
) [protected, virtual]

Definition at line 51 of file HTTP_IOStream.cpp.

      {
        if (this->policy_)
          return this->policy_->write_to_stream (buffer, length);
        else
          return this->write_to_stream_i (buffer, length);
      }

int ACE::HTTP::StreamBuffer::write_to_stream_i ( const char *  buffer,
std::streamsize  length 
) [protected, virtual]

Definition at line 59 of file HTTP_IOStream.cpp.

      {
        this->stream_.write (buffer, length);
        return this->stream_.good () ? ACE_Utils::truncate_cast<int> (length) : -1;
      }


Friends And Related Function Documentation

friend class StreamPolicyBase< StreamBuffer > [friend]

Definition at line 51 of file HTTP_IOStream.h.


Member Data Documentation

Definition at line 68 of file HTTP_IOStream.h.

std::iostream& ACE::HTTP::StreamBuffer::stream_ [private]

Definition at line 67 of file HTTP_IOStream.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines