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

ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER > Class Template Reference

#include <HTTP_StreamPolicy.h>

Inheritance diagram for ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >:
Inheritance graph
[legend]
Collaboration diagram for ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef STREAM_BUFFER::char_type char_type

Public Member Functions

 FixedLengthStreamPolicyBase (std::streamsize length)
virtual ~FixedLengthStreamPolicyBase ()

Protected Member Functions

virtual int read_from_stream (char_type *buffer, std::streamsize length)
virtual int write_to_stream (const char_type *buffer, std::streamsize length)

Private Attributes

std::streamsize length_
std::streamsize count_

Detailed Description

template<class STREAM_BUFFER>
class ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >

Definition at line 33 of file HTTP_StreamPolicy.h.


Member Typedef Documentation

template<class STREAM_BUFFER >
typedef STREAM_BUFFER::char_type ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >::char_type

Reimplemented from ACE::HTTP::StreamPolicyBase< STREAM_BUFFER >.

Definition at line 37 of file HTTP_StreamPolicy.h.


Constructor & Destructor Documentation

template<class STREAM_BUFFER >
ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >::FixedLengthStreamPolicyBase ( std::streamsize  length  ) 

Definition at line 16 of file HTTP_StreamPolicy.cpp.

      : StreamPolicyBase<STREAM_BUFFER> (),
        length_ (length),
        count_ (0)
      {
      }

template<class STREAM_BUFFER >
ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >::~FixedLengthStreamPolicyBase (  )  [virtual]

Definition at line 24 of file HTTP_StreamPolicy.cpp.

      {
      }


Member Function Documentation

template<class STREAM_BUFFER >
int ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >::read_from_stream ( char_type buffer,
std::streamsize  length 
) [protected, virtual]

Implements ACE::HTTP::StreamPolicyBase< STREAM_BUFFER >.

Definition at line 29 of file HTTP_StreamPolicy.cpp.

      {
        int n = 0;
        if (this->count_ < this->length_)
        {
          if (this->count_ + length > this->length_)
            length = this->length_ - this->count_;
          n = this->read_from_stream_i (buf, length);
          if (n > 0) this->count_ += n;
        }
        return n;
      }

template<class STREAM_BUFFER >
int ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >::write_to_stream ( const char_type buffer,
std::streamsize  length 
) [protected, virtual]

Implements ACE::HTTP::StreamPolicyBase< STREAM_BUFFER >.

Definition at line 45 of file HTTP_StreamPolicy.cpp.

      {
        int n = 0;
        if (this->count_ < this->length_)
        {
          if ((this->count_ + length) > this->length_)
            length = this->length_ - this->count_;
          n = this->write_to_stream_i (buf, length);
          if (n > 0) this->count_ += n;
        }
        return n;
      }


Member Data Documentation

template<class STREAM_BUFFER >
std::streamsize ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >::count_ [private]

Definition at line 49 of file HTTP_StreamPolicy.h.

template<class STREAM_BUFFER >
std::streamsize ACE::HTTP::FixedLengthStreamPolicyBase< STREAM_BUFFER >::length_ [private]

Definition at line 48 of file HTTP_StreamPolicy.h.


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