NuriKit v0.1.0b2
Loading...
Searching...
No Matches
nuri::MoleculeReader Class Referenceabstract

#include <nuri/fmt/base.h>

Inheritance diagram for nuri::MoleculeReader:

Public Member Functions

 MoleculeReader ()=default
 MoleculeReader (const MoleculeReader &)=delete
MoleculeReaderoperator= (const MoleculeReader &)=delete
 MoleculeReader (MoleculeReader &&) noexcept=default
MoleculeReaderoperator= (MoleculeReader &&) noexcept=default
virtual ~MoleculeReader () noexcept=default
std::vector< std::string > next ()
 Advance the reader to the next molecule.
virtual ABSL_MUST_USE_RESULT bool getnext (std::vector< std::string > &block)=0
 Advance the reader to the next molecule.
virtual Molecule parse (const std::vector< std::string > &block) const =0
 Parse the current block and return the molecule.
virtual bool bond_valid () const =0
 Test whether the reader implementation can provide valid bond information.
MoleculeStream< MoleculeReaderstream ()
 Convert the reader to a stream object.

Constructor & Destructor Documentation

◆ MoleculeReader() [1/3]

nuri::MoleculeReader::MoleculeReader ( )
default

◆ MoleculeReader() [2/3]

nuri::MoleculeReader::MoleculeReader ( const MoleculeReader & )
delete

◆ MoleculeReader() [3/3]

nuri::MoleculeReader::MoleculeReader ( MoleculeReader && )
defaultnoexcept

◆ ~MoleculeReader()

virtual nuri::MoleculeReader::~MoleculeReader ( )
virtualdefaultnoexcept

Member Function Documentation

◆ bond_valid()

virtual bool nuri::MoleculeReader::bond_valid ( ) const
pure virtual

Test whether the reader implementation can provide valid bond information.

Implemented in nuri::MmcifReader, nuri::Mol2Reader, nuri::PDBReader, nuri::SDFReader, and nuri::SmilesReader.

◆ getnext()

virtual ABSL_MUST_USE_RESULT bool nuri::MoleculeReader::getnext ( std::vector< std::string > & block)
pure virtual

Advance the reader to the next molecule.

Parameters
blockThe block containing the next molecule. If true is returned, pre-existing contents of the block are discarded. Otherwise, the block is in a valid but unspecified state.
Returns
true if the reader has successfully advanced to the next molecule, false otherwise.
Note
The name of this method is loosely based on the std::getline() function due to its similar semantics. The name also prevents name collision with the (non-virtual) next() method when subclasses override this method.

Implemented in nuri::MmcifReader, nuri::Mol2Reader, nuri::PDBReader, nuri::SDFReader, and nuri::SmilesReader.

◆ next()

std::vector< std::string > nuri::MoleculeReader::next ( )
inline

Advance the reader to the next molecule.

Returns
The next block containing the next molecule. If the stream is at the end, an empty block is returned.

◆ operator=() [1/2]

MoleculeReader & nuri::MoleculeReader::operator= ( const MoleculeReader & )
delete

◆ operator=() [2/2]

MoleculeReader & nuri::MoleculeReader::operator= ( MoleculeReader && )
defaultnoexcept

◆ parse()

virtual Molecule nuri::MoleculeReader::parse ( const std::vector< std::string > & block) const
pure virtual

Parse the current block and return the molecule.

Parameters
blockThe block to parse.
Returns
The current molecule.
Note
The returned molecule will be empty if the block is empty.

Implemented in nuri::DefaultReaderImpl< parser >, nuri::DefaultReaderImpl< read_mol2 >, nuri::DefaultReaderImpl< read_pdb >, nuri::DefaultReaderImpl< read_sdf >, nuri::DefaultReaderImpl< read_smiles >, and nuri::MmcifReader.

◆ stream()

MoleculeStream< MoleculeReader > nuri::MoleculeReader::stream ( )
inline

Convert the reader to a stream object.


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