bpp-core3  3.0.0
bpp::StlOutputStream Class Reference

STL output stream. More...

#include <Bpp/Io/OutputStream.h>

+ Inheritance diagram for bpp::StlOutputStream:
+ Collaboration diagram for bpp::StlOutputStream:

Public Member Functions

 StlOutputStream (std::unique_ptr< std::ostream > stream)
 
 StlOutputStream (const StlOutputStream &stlos)
 
StlOutputStreamoperator= (const StlOutputStream &stlos)
 
StlOutputStreamoperator<< (const std::string &message)
 
StlOutputStreamoperator<< (const char *message)
 
StlOutputStreamoperator<< (const char &message)
 
StlOutputStreamoperator<< (const int &message)
 
StlOutputStreamoperator<< (const unsigned int &message)
 
StlOutputStreamoperator<< (const long int &message)
 
StlOutputStreamoperator<< (const unsigned long int &message)
 
StlOutputStreamoperator<< (const double &message)
 
StlOutputStreamoperator<< (const long double &message)
 
StlOutputStreamoperator<< (const bool &message)
 
StlOutputStreamendLine ()
 
StlOutputStreamflush ()
 
StlOutputStreamclone () const
 Create a copy of this object and send a pointer to it. More...
 
OutputStreamsetPrecision (int digit)
 
int getPrecision () const
 
virtual OutputStreamenableScientificNotation (bool yn)
 
virtual bool isScientificNotationEnabled () const
 

Private Attributes

std::unique_ptr< std::ostream > stream_
 

Detailed Description

STL output stream.

This class wraps the std::ostream class. It takes as input a pointer toward an existing stream that will then be owned by the wrapper, as a smart pointer. Any copy of this class will then result in an inactivation of the original version (in other word, you can't have two wrappers for the same stream).

Definition at line 119 of file OutputStream.h.

Constructor & Destructor Documentation

◆ StlOutputStream() [1/2]

bpp::StlOutputStream::StlOutputStream ( std::unique_ptr< std::ostream >  stream)
inline

Definition at line 126 of file OutputStream.h.

◆ StlOutputStream() [2/2]

bpp::StlOutputStream::StlOutputStream ( const StlOutputStream stlos)
inline

Definition at line 127 of file OutputStream.h.

References stream_.

Member Function Documentation

◆ clone()

StlOutputStream* bpp::StlOutputStream::clone ( ) const
inlinevirtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Implements bpp::OutputStream.

Definition at line 158 of file OutputStream.h.

◆ enableScientificNotation()

virtual OutputStream& bpp::AbstractOutputStream::enableScientificNotation ( bool  yn)
inlinevirtualinherited

Implements bpp::OutputStream.

Definition at line 81 of file OutputStream.h.

◆ endLine()

StlOutputStream& bpp::StlOutputStream::endLine ( )
inlinevirtual

Implements bpp::OutputStream.

Definition at line 155 of file OutputStream.h.

◆ flush()

StlOutputStream& bpp::StlOutputStream::flush ( )
inlinevirtual

Implements bpp::OutputStream.

Definition at line 156 of file OutputStream.h.

◆ getPrecision()

int bpp::AbstractOutputStream::getPrecision ( ) const
inlinevirtualinherited

Implements bpp::OutputStream.

Definition at line 79 of file OutputStream.h.

◆ isScientificNotationEnabled()

virtual bool bpp::AbstractOutputStream::isScientificNotationEnabled ( ) const
inlinevirtualinherited

Implements bpp::OutputStream.

Definition at line 82 of file OutputStream.h.

◆ operator<<() [1/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const std::string &  message)
inlinevirtual

Implements bpp::OutputStream.

Definition at line 135 of file OutputStream.h.

◆ operator<<() [2/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const char *  message)
inlinevirtual

Implements bpp::OutputStream.

Definition at line 136 of file OutputStream.h.

◆ operator<<() [3/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const char &  message)
inlinevirtual

Implements bpp::OutputStream.

Definition at line 137 of file OutputStream.h.

◆ operator<<() [4/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const int &  message)
inlinevirtual

Implements bpp::OutputStream.

Definition at line 138 of file OutputStream.h.

◆ operator<<() [5/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const unsigned int &  message)
inlinevirtual

Implements bpp::OutputStream.

Definition at line 139 of file OutputStream.h.

◆ operator<<() [6/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const long int &  message)
inlinevirtual

Implements bpp::OutputStream.

Definition at line 140 of file OutputStream.h.

◆ operator<<() [7/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const unsigned long int &  message)
inlinevirtual

Implements bpp::OutputStream.

Definition at line 141 of file OutputStream.h.

◆ operator<<() [8/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const double &  message)
inlinevirtual

◆ operator<<() [9/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const long double &  message)
inlinevirtual

◆ operator<<() [10/10]

StlOutputStream& bpp::StlOutputStream::operator<< ( const bool &  message)
inlinevirtual

Implements bpp::OutputStream.

Definition at line 154 of file OutputStream.h.

◆ operator=()

StlOutputStream& bpp::StlOutputStream::operator= ( const StlOutputStream stlos)
inline

Definition at line 128 of file OutputStream.h.

References stream_.

◆ setPrecision()

OutputStream& bpp::AbstractOutputStream::setPrecision ( int  digit)
inlinevirtualinherited

Implements bpp::OutputStream.

Definition at line 74 of file OutputStream.h.

Member Data Documentation

◆ stream_

std::unique_ptr<std::ostream> bpp::StlOutputStream::stream_
mutableprivate

Definition at line 123 of file OutputStream.h.

Referenced by operator=(), and StlOutputStream().


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