mod_servlet
C++Servlets
 All Classes Files Functions Variables Typedefs Macros Pages
servlet::basic_outstream< Sink, Buffering, CharT, Traits > Class Template Reference

Implementation of output stream object. More...

#include <io.h>

Inheritance diagram for servlet::basic_outstream< Sink, Buffering, CharT, Traits >:

Public Types

typedef CharT char_type
 Cacracter type to be used by this stream.
 
typedef Traits traits_type
 Type of character traits class to be used by this stream.
 
typedef traits_type::int_type int_type
 traits_type::int_type
 
typedef traits_type::pos_type pos_type
 traits_type::pos_type
 
typedef traits_type::off_type off_type
 traits_type::off_type
 

Public Member Functions

template<class... Args>
 basic_outstream (Args &&...args)
 Main constructor. More...
 
 basic_outstream (basic_outstream &&other)
 Move constructor. More...
 
basic_outstreamoperator= (basic_outstream &&other)
 Move assignment operator. More...
 
 ~basic_outstream () noexceptoverride
 Destructor.
 
Sink & operator* ()
 Provides access to the reference to the Sink instance associated with this stream. More...
 
Sink * operator-> ()
 Provides access to the pointer to the Sink instance associated with this stream. More...
 
const Sink & operator* () const
 Provides access to the constant reference to the Sink instance associated with this stream. More...
 
const Sink * operator-> () const
 Provides access to the constant pointer to the Sink instance associated with this stream. More...
 

Detailed Description

template<typename Sink, typename Buffering, typename CharT, typename Traits = std::char_traits<CharT>>
class servlet::basic_outstream< Sink, Buffering, CharT, Traits >

Implementation of output stream object.

This class inherits from std::basic_ostream and can be used as one.

This object uses the Sink provided as a template parameter to write data to. The Sink can be either sink or buffer_provider.

Template Parameters
Sinksink object to use to write data.
BufferingBuffer size to be used.
CharTcharacter type for this stream
Traitscahracter traits type to be used in this stream.
See Also
sink
buffer_provider

Constructor & Destructor Documentation

template<typename Sink , typename Buffering , typename CharT , typename Traits = std::char_traits<CharT>>
template<class... Args>
servlet::basic_outstream< Sink, Buffering, CharT, Traits >::basic_outstream ( Args &&...  args)
inlineexplicit

Main constructor.

This generic constructor will pass received arguments to its buffer, which in turn will pass them to Sink. Thus, generally, these arguments should be the ones to create the Sink

Template Parameters
Argstypes of the arguments to forward to Sink constructor
Parameters
argsArguments to be forwarded to construct the Sink
template<typename Sink , typename Buffering , typename CharT , typename Traits = std::char_traits<CharT>>
servlet::basic_outstream< Sink, Buffering, CharT, Traits >::basic_outstream ( basic_outstream< Sink, Buffering, CharT, Traits > &&  other)
inline

Move constructor.

Parameters
otherbasic_outstream which contents and state will be acquired by created object.

Member Function Documentation

template<typename Sink , typename Buffering , typename CharT , typename Traits = std::char_traits<CharT>>
Sink& servlet::basic_outstream< Sink, Buffering, CharT, Traits >::operator* ( )
inline

Provides access to the reference to the Sink instance associated with this stream.

Returns
reference to the Sink instance.
template<typename Sink , typename Buffering , typename CharT , typename Traits = std::char_traits<CharT>>
const Sink& servlet::basic_outstream< Sink, Buffering, CharT, Traits >::operator* ( ) const
inline

Provides access to the constant reference to the Sink instance associated with this stream.

Returns
const reference to the Sink instance.
template<typename Sink , typename Buffering , typename CharT , typename Traits = std::char_traits<CharT>>
Sink* servlet::basic_outstream< Sink, Buffering, CharT, Traits >::operator-> ( )
inline

Provides access to the pointer to the Sink instance associated with this stream.

Returns
pointer to the Sink instance.
template<typename Sink , typename Buffering , typename CharT , typename Traits = std::char_traits<CharT>>
const Sink* servlet::basic_outstream< Sink, Buffering, CharT, Traits >::operator-> ( ) const
inline

Provides access to the constant pointer to the Sink instance associated with this stream.

Returns
const pointer to the Sink instance.
template<typename Sink , typename Buffering , typename CharT , typename Traits = std::char_traits<CharT>>
basic_outstream& servlet::basic_outstream< Sink, Buffering, CharT, Traits >::operator= ( basic_outstream< Sink, Buffering, CharT, Traits > &&  other)
inline

Move assignment operator.

Parameters
otherbasic_outstream which contents and state will be acquired by created object.
Returns
reference to self

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