A library for working with phylogenetic and population genetic data.
v0.27.0
BaseOutputTarget Class Referenceabstract

#include <genesis/utils/io/base_output_target.hpp>

Inherited by FileOutputTarget, GzipBlockOutputTarget, GzipOutputTarget, StreamOutputTarget, and StringOutputTarget.

Detailed Description

Abstract base class for writing data to an output target.

Definition at line 48 of file base_output_target.hpp.

Public Member Functions

 BaseOutputTarget ()=default
 
 BaseOutputTarget (BaseOutputTarget &&)=default
 
 BaseOutputTarget (BaseOutputTarget const &)=default
 
virtual ~BaseOutputTarget ()
 
template<typename T >
BaseOutputTargetoperator<< (T const &content)
 Output stream operator template that simply forwards to the underlying ostream() object. More...
 
BaseOutputTargetoperator= (BaseOutputTarget &&)=default
 
BaseOutputTargetoperator= (BaseOutputTarget const &)=default
 
std::ostream & ostream ()
 Get the underlying output stream that is used for writing. More...
 
std::string target_name () const
 Get a name of the output target. This is intended for user output. More...
 
std::string target_string () const
 Get a string representing the output target. This is intended for the writer classes, which for example might want to examine the output file name. More...
 

Constructor & Destructor Documentation

◆ BaseOutputTarget() [1/3]

BaseOutputTarget ( )
default

◆ BaseOutputTarget() [2/3]

BaseOutputTarget ( BaseOutputTarget const &  )
default

◆ BaseOutputTarget() [3/3]

◆ ~BaseOutputTarget()

virtual ~BaseOutputTarget ( )
inlinevirtual

Definition at line 64 of file base_output_target.hpp.

Member Function Documentation

◆ operator<<()

BaseOutputTarget& operator<< ( T const &  content)
inline

Output stream operator template that simply forwards to the underlying ostream() object.

This is the main function used to write output. This way, nothing has to be changed in code that wants to write some output, comared to standard write-to-stream functions. The only change necessary is the initial setup of the output object: Instead of an std::ostream, one has to initialize this class. From then on, usage is identical.

Definition at line 80 of file base_output_target.hpp.

◆ operator=() [1/2]

BaseOutputTarget& operator= ( BaseOutputTarget &&  )
default

◆ operator=() [2/2]

BaseOutputTarget& operator= ( BaseOutputTarget const &  )
default

◆ ostream()

std::ostream& ostream ( )
inline

Get the underlying output stream that is used for writing.

Definition at line 89 of file base_output_target.hpp.

◆ target_name()

std::string target_name ( ) const
inline

Get a name of the output target. This is intended for user output.

Definition at line 98 of file base_output_target.hpp.

◆ target_string()

std::string target_string ( ) const
inline

Get a string representing the output target. This is intended for the writer classes, which for example might want to examine the output file name.

Definition at line 108 of file base_output_target.hpp.


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