Fastcgipp::Fcgistream< charT, traits >::Fcgibuf Class Reference

Stream buffer class for output of client data through FastCGI. More...

List of all members.

Public Member Functions

 Fcgibuf ()
void set (Protocol::FullId id_, Transceiver &transceiver_, Protocol::RecordType type_)
 After construction constructor.
virtual ~Fcgibuf ()
void dump (char *data, size_t size)
 Dumps raw data directly into the FastCGI protocol.

Private Types

typedef std::basic_streambuf
< charT, traits >::int_type 
int_type
typedef std::basic_streambuf
< charT, traits >::traits_type 
traits_type
typedef std::basic_streambuf
< charT, traits >::char_type 
char_type

Private Member Functions

int_type overflow (int_type c=traits_type::eof())
int sync ()
std::streamsize xsputn (const char_type *s, std::streamsize n)
int emptyBuffer ()
 Code converts, packages and transmits all data in the stream buffer along with the dump data.

Private Attributes

char * dumpPtr
 Pointer to the data that needs to be transmitted upon flush.
size_t dumpSize
 Size of the data pointed to be dumpPtr.
Transceivertransceiver
 Transceiver object to use for transmissio.
char_type buffer [buffSize]
 The buffer.
Protocol::FullId id
 Complete ID associated with the request.
Protocol::RecordType type
 Type of output stream (ERR or OUT).

Static Private Attributes

static const int buffSize = 8192
 Size of the internal stream buffer.


Detailed Description

template<class charT, class traits>
class Fastcgipp::Fcgistream< charT, traits >::Fcgibuf

Stream buffer class for output of client data through FastCGI.

This class is derived from std::basic_streambuf<charT, traits>. It acts just the same as any stream buffer does with the added feature of the dump() function.

Template Parameters:
charT Character type (char or wchar_t)
traits Character traits

Definition at line 78 of file fcgistream.hpp.


Member Typedef Documentation

template<class charT , class traits >
typedef std::basic_streambuf<charT, traits>::char_type Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::char_type [private]

Definition at line 113 of file fcgistream.hpp.

template<class charT , class traits >
typedef std::basic_streambuf<charT, traits>::int_type Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::int_type [private]

Definition at line 111 of file fcgistream.hpp.

template<class charT , class traits >
typedef std::basic_streambuf<charT, traits>::traits_type Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::traits_type [private]

Definition at line 112 of file fcgistream.hpp.


Constructor & Destructor Documentation

template<class charT , class traits >
Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::Fcgibuf (  )  [inline]

template<class charT , class traits >
virtual Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::~Fcgibuf (  )  [inline, virtual]


Member Function Documentation

template<class charT , class traits >
void Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::dump ( char *  data,
size_t  size 
) [inline]

Dumps raw data directly into the FastCGI protocol.

This function exists as a mechanism to dump raw data out the stream bypassing the stream buffer or any code conversion mechanisms. If the user has any binary data to send, this is the function to do it with.

Parameters:
[in] data Pointer to first byte of data to send
[in] size Size in bytes of data to be sent

Definition at line 108 of file fcgistream.hpp.

References Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::dumpPtr, Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::dumpSize, and Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::sync().

Referenced by Fastcgipp::Fcgistream< charT, std::char_traits< charT > >::dump().

template<class charT , class traits >
int Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::emptyBuffer (  )  [inline, private]

template<class charT , class traits >
int_type Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::overflow ( int_type  c = traits_type::eof()  )  [private]

template<class charT , class traits >
void Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::set ( Protocol::FullId  id_,
Transceiver transceiver_,
Protocol::RecordType  type_ 
) [inline]

After construction constructor.

Sets FastCGI related member data necessary for operation of the stream buffer.

Parameters:
[in] id_ Complete ID associated with the request
[in] transceiver_ Transceiver object to use for transmission
[in] type_ Type of output stream (ERR or OUT)

Definition at line 91 of file fcgistream.hpp.

References Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::transceiver, and Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::type.

Referenced by Fastcgipp::Fcgistream< charT, std::char_traits< charT > >::set().

template<class charT , class traits >
int Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::sync (  )  [inline, private]

template<class charT , class traits >
std::streamsize Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::xsputn ( const char_type s,
std::streamsize  n 
) [inline, private]


Member Data Documentation

template<class charT , class traits >
char_type Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::buffer[buffSize] [private]

The buffer.

Definition at line 133 of file fcgistream.hpp.

Referenced by Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::Fcgibuf().

template<class charT , class traits >
const int Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::buffSize = 8192 [static, private]

Size of the internal stream buffer.

Definition at line 131 of file fcgistream.hpp.

Referenced by Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::Fcgibuf().

template<class charT , class traits >
char* Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::dumpPtr [private]

Pointer to the data that needs to be transmitted upon flush.

Definition at line 122 of file fcgistream.hpp.

Referenced by Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::dump(), and Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::emptyBuffer().

template<class charT , class traits >
size_t Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::dumpSize [private]

Size of the data pointed to be dumpPtr.

Definition at line 124 of file fcgistream.hpp.

Referenced by Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::dump(), and Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::emptyBuffer().

template<class charT , class traits >
Protocol::FullId Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::id [private]

Complete ID associated with the request.

Definition at line 135 of file fcgistream.hpp.

Referenced by Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::emptyBuffer().

template<class charT , class traits >
Transceiver* Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::transceiver [private]

template<class charT , class traits >
Protocol::RecordType Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::type [private]

Type of output stream (ERR or OUT).

Definition at line 138 of file fcgistream.hpp.

Referenced by Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::emptyBuffer(), and Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::set().


The documentation for this class was generated from the following files:

Generated on Thu Dec 11 01:47:28 2008 for fastcgi++ by  doxygen 1.5.7.1