lestes::std::istream_wrapper Class Reference

Wrapper for istream. More...

#include <istream_wrapper.hh>

Inheritance diagram for lestes::std::istream_wrapper:

Inheritance graph
[legend]
List of all members.

Public Types

typedef ::std::istream * stream_type

Public Member Functions

virtual ~istream_wrapper (void)
 Finalizes the object.
void release (void)
 Releases the stream.
stream_type stream_get (void) const
 Returns underlying stream.
bool owned_get (void) const
 Returns the ownership flag.

Static Public Member Functions

static ptr< istream_wrappercreate (stream_type a_stream, bool a_owned)
 Returns the wrapper.

Protected Member Functions

 istream_wrapper (stream_type a_stream, bool owned)
 Creates the wrapper.

Private Member Functions

 istream_wrapper (const istream_wrapper &)
 Hides copy constructor.
istream_wrapperoperator= (const istream_wrapper &)
 Hides assignment operator.

Private Attributes

stream_type stream
 The wrapped istream.
bool owned
 Ownership flag.

Detailed Description

Wrapper for istream.

Represents output stream wrapper, with ownership policy of the stream.


Member Typedef Documentation

typedef ::std::istream* lestes::std::istream_wrapper::stream_type


Constructor & Destructor Documentation

lestes::std::istream_wrapper::~istream_wrapper ( void   )  [virtual]

Finalizes the object.

Finalizes the object. Releases the stream if owned.

lestes::std::istream_wrapper::istream_wrapper ( stream_type  a_stream,
bool  a_owned 
) [protected]

Creates the wrapper.

Creates the wrapper.

Precondition:
a_stream != NULL
Parameters:
a_stream The stream to wrap.
a_owned The ownership flag.

lestes::std::istream_wrapper::istream_wrapper ( const istream_wrapper  )  [private]

Hides copy constructor.


Member Function Documentation

void lestes::std::istream_wrapper::release ( void   ) 

Releases the stream.

Releases the stream if it was owned.

Postcondition:
stream_get() == NULL

istream_wrapper::stream_type lestes::std::istream_wrapper::stream_get ( void   )  const

Returns underlying stream.

Returns the wrapped stream.

Precondition:
release() was not called (stream_get() != NULL)
Returns:
The stream.

bool lestes::std::istream_wrapper::owned_get ( void   )  const

Returns the ownership flag.

Returns the ownership.

Returns:
true If the stream is owned by the wrapper.

ptr< istream_wrapper > lestes::std::istream_wrapper::create ( stream_type  a_stream,
bool  a_owned 
) [static]

Returns the wrapper.

Creates the wrapper.

Precondition:
a_stream != NULL

a_stream is allocated via new when a_owned is true

Parameters:
a_stream The stream to wrap.
a_owned The ownership flag.
Returns:
The new wrapper of a_stream.

istream_wrapper& lestes::std::istream_wrapper::operator= ( const istream_wrapper  )  [private]

Hides assignment operator.


Member Data Documentation

stream_type lestes::std::istream_wrapper::stream [private]

The wrapped istream.

bool lestes::std::istream_wrapper::owned [private]

Ownership flag.


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:49:48 2007 for lestes by doxygen 1.5.1-20070107