bpp-seq  2.2.0
bpp::AbstractOSequence Class Referenceabstract

Partial implementation of the OSequence and OAlignment interfaces. More...

#include <Bpp/Seq/Io/AbstractOSequence.h>

+ Inheritance diagram for bpp::AbstractOSequence:
+ Collaboration diagram for bpp::AbstractOSequence:

Public Member Functions

 AbstractOSequence ()
 
virtual ~AbstractOSequence ()
 
const std::string getDataType () const
 
OSequence methods:
void writeSequences (std::ostream &output, const SequenceContainer &sc) const =0 throw (Exception)
 Write a container to a stream. More...
 
void writeSequences (const std::string &path, const SequenceContainer &sc, bool overwrite=true) const throw (Exception)
 Write a container to a file. More...
 
OAlignment methods:

As a SiteContainer is a specialization of SequenceContainer, it is assumed that a OSequence object can write aligned sequence just like a OAlignment object. Therefore it implements the OAlignment interface by down-casting the SiteContainer to a SequenceContainer.

void writeAlignment (std::ostream &output, const SiteContainer &sc) const throw (Exception)
 Write a container to a stream. More...
 
void writeAlignment (const std::string &path, const SiteContainer &sc, bool overwrite=true) const throw (Exception)
 Write a container to a file. More...
 

Detailed Description

Partial implementation of the OSequence and OAlignment interfaces.

Definition at line 57 of file AbstractOSequence.h.

Constructor & Destructor Documentation

◆ AbstractOSequence()

bpp::AbstractOSequence::AbstractOSequence ( )
inline

Definition at line 63 of file AbstractOSequence.h.

◆ ~AbstractOSequence()

virtual bpp::AbstractOSequence::~AbstractOSequence ( )
inlinevirtual

Definition at line 64 of file AbstractOSequence.h.

Member Function Documentation

◆ getDataType()

const std::string bpp::IOSequence::getDataType ( ) const
inlineinherited

Definition at line 65 of file IoSequence.h.

◆ writeAlignment() [1/2]

void bpp::AbstractOSequence::writeAlignment ( std::ostream &  output,
const SiteContainer sc 
) const
throw (Exception
)
inlinevirtual

Write a container to a stream.

Parameters
outputThe output stream where to write.
scThe container to write.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::OAlignment.

Definition at line 92 of file AbstractOSequence.h.

References writeSequences().

◆ writeAlignment() [2/2]

void bpp::AbstractOSequence::writeAlignment ( const std::string &  path,
const SiteContainer sc,
bool  overwrite = true 
) const
throw (Exception
)
inlinevirtual

Write a container to a file.

Parameters
pathThe path to the file to write.
scThe container to write.
overwriteIf true the sequences are written at the beginning of the file instead of being appended. Any previous content will be lost.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::OAlignment.

Definition at line 96 of file AbstractOSequence.h.

References writeSequences().

◆ writeSequences() [1/2]

void bpp::AbstractOSequence::writeSequences ( std::ostream &  output,
const SequenceContainer sc 
) const
throw (Exception
)
pure virtual

Write a container to a stream.

Parameters
outputThe output stream where to write.
scThe container to write.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::OSequence.

Implemented in bpp::Mase, and bpp::Fasta.

Referenced by writeAlignment(), writeSequences(), bpp::Fasta::writeSequences(), and bpp::Mase::writeSequences().

◆ writeSequences() [2/2]

void bpp::AbstractOSequence::writeSequences ( const std::string &  path,
const SequenceContainer sc,
bool  overwrite = true 
) const
throw (Exception
)
inlinevirtual

Write a container to a file.

Parameters
pathThe path to the file to write.
scThe container to write.
overwriteIf true the sequences are written at the beginning of the file instead of being appended. Any previous content will be lost.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::OSequence.

Reimplemented in bpp::Mase, and bpp::Fasta.

Definition at line 74 of file AbstractOSequence.h.

References writeSequences().


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