lestes::std::ostream_wrapper Class Reference

Wrapper for ostream. More...

#include <ostream_wrapper.hh>

Inheritance diagram for lestes::std::ostream_wrapper:

Inheritance graph
[legend]
List of all members.

Public Types

typedef ::std::ostream * stream_type

Public Member Functions

virtual ~ostream_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< ostream_wrappercreate (stream_type a_stream, bool a_owned)
 Returns the wrapper.

Protected Member Functions

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

Private Member Functions

 ostream_wrapper (const ostream_wrapper &)
 Hides copy constructor.
ostream_wrapperoperator= (const ostream_wrapper &)
 Hides assignment operator.

Private Attributes

stream_type stream
 The wrapped ostream.
bool owned
 Ownership flag.

Detailed Description

Wrapper for ostream.

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


Member Typedef Documentation

typedef ::std::ostream* lestes::std::ostream_wrapper::stream_type


Constructor & Destructor Documentation

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

Finalizes the object.

Finalizes the object. Releases the stream if owned.

lestes::std::ostream_wrapper::ostream_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::ostream_wrapper::ostream_wrapper ( const ostream_wrapper  )  [private]

Hides copy constructor.


Member Function Documentation

void lestes::std::ostream_wrapper::release ( void   ) 

Releases the stream.

Releases the stream if it was owned.

Postcondition:
stream_get() == NULL

ostream_wrapper::stream_type lestes::std::ostream_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::ostream_wrapper::owned_get ( void   )  const

Returns the ownership flag.

Returns the ownership.

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

ptr< ostream_wrapper > lestes::std::ostream_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.

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

Hides assignment operator.


Member Data Documentation

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

The wrapped ostream.

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

Ownership flag.


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