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::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_
 
int precision_
 
bool scienceNotation_
 

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 155 of file OutputStream.h.

Constructor & Destructor Documentation

◆ StlOutputStream() [1/2]

bpp::StlOutputStream::StlOutputStream ( std::ostream *  stream)
inline

Definition at line 162 of file OutputStream.h.

Referenced by clone().

◆ StlOutputStream() [2/2]

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

Definition at line 163 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 194 of file OutputStream.h.

References StlOutputStream().

◆ enableScientificNotation()

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

Implements bpp::OutputStream.

Definition at line 117 of file OutputStream.h.

References bpp::AbstractOutputStream::scienceNotation_.

◆ endLine()

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

Implements bpp::OutputStream.

Definition at line 191 of file OutputStream.h.

References stream_.

◆ flush()

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

Implements bpp::OutputStream.

Definition at line 192 of file OutputStream.h.

References stream_.

◆ getPrecision()

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

◆ isScientificNotationEnabled()

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

◆ operator<<() [1/10]

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

Implements bpp::OutputStream.

Definition at line 190 of file OutputStream.h.

References stream_.

◆ operator<<() [2/10]

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

Implements bpp::OutputStream.

Definition at line 173 of file OutputStream.h.

References stream_.

◆ operator<<() [3/10]

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

Implements bpp::OutputStream.

Definition at line 172 of file OutputStream.h.

References stream_.

◆ operator<<() [4/10]

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

◆ operator<<() [5/10]

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

Implements bpp::OutputStream.

Definition at line 174 of file OutputStream.h.

References stream_.

◆ operator<<() [6/10]

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

◆ operator<<() [7/10]

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

Implements bpp::OutputStream.

Definition at line 176 of file OutputStream.h.

References stream_.

◆ operator<<() [8/10]

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

Implements bpp::OutputStream.

Definition at line 171 of file OutputStream.h.

References stream_.

◆ operator<<() [9/10]

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

Implements bpp::OutputStream.

Definition at line 175 of file OutputStream.h.

References stream_.

◆ operator<<() [10/10]

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

Implements bpp::OutputStream.

Definition at line 177 of file OutputStream.h.

References stream_.

◆ operator=()

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

Definition at line 164 of file OutputStream.h.

References stream_.

◆ setPrecision()

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

Implements bpp::OutputStream.

Definition at line 110 of file OutputStream.h.

References bpp::AbstractOutputStream::precision_.

Member Data Documentation

◆ precision_

int bpp::AbstractOutputStream::precision_
privateinherited

◆ scienceNotation_

bool bpp::AbstractOutputStream::scienceNotation_
privateinherited

◆ stream_

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

Definition at line 159 of file OutputStream.h.

Referenced by endLine(), flush(), operator<<(), operator=(), and StlOutputStream().


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