RDKit: RDKit::v2::FileParsers::MolSupplier Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RDKit::v2::FileParsers::MolSupplier Class Referenceabstract

`#include <MolSupplier.h>`

Inheritance diagram for RDKit::v2::FileParsers::MolSupplier:

## Public Member Functions
| MolSupplier ()
virtual | ~MolSupplier ()
virtual void | init ()=0
virtual void | reset ()=0
virtual bool | atEnd ()=0
virtual std::unique_ptr< RWMol > | next ()=0
virtual void | close ()

## Protected Member Functions
std::istream * | openAndCheckStream (const std::string &filename)

## Protected Attributes
std::istream * | dp_inStream = nullptr
bool | df_owner = false

## Detailed Description

Here are a couple of ways one can interact with MolSuppliers:

1) Lazy (ForwardIterator): while(!supplier.atEnd()){ ROMol *mol = supplier.next(); if(mol){ do something; } } 2) Random Access: for(int i=0;i<supplier.length();i++){ ROMol *mol = supplier[i]; if(mol){ do something; } }

Definition at line 62 of file MolSupplier.h.

## Constructor & Destructor Documentation

## ◆ MolSupplier()

RDKit::v2::FileParsers::MolSupplier::MolSupplier | ( |  | ) |
| inline

Definition at line 65 of file MolSupplier.h.

## ◆ ~MolSupplier()

virtual RDKit::v2::FileParsers::MolSupplier::~MolSupplier | ( |  | ) |
| inlinevirtual

Definition at line 66 of file MolSupplier.h.

## Member Function Documentation

## ◆ atEnd()

virtual bool RDKit::v2::FileParsers::MolSupplier::atEnd | ( |  | ) |
| pure virtual

Implemented in RDKit::v2::FileParsers::ForwardSDMolSupplier, RDKit::v2::FileParsers::SDMolSupplier, RDKit::v2::FileParsers::SmilesMolSupplier, and RDKit::v2::FileParsers::TDTMolSupplier.

## ◆ close()

virtual void RDKit::v2::FileParsers::MolSupplier::close | ( |  | ) |
| inlinevirtual

Definition at line 72 of file MolSupplier.h.

References df_owner, and dp_inStream.

Referenced by RDKit::v2::FileParsers::ForwardSDMolSupplier::~ForwardSDMolSupplier(), RDKit::v2::FileParsers::SDMolSupplier::~SDMolSupplier(), RDKit::v2::FileParsers::SmilesMolSupplier::~SmilesMolSupplier(), and RDKit::v2::FileParsers::TDTMolSupplier::~TDTMolSupplier().

## ◆ init()

virtual void RDKit::v2::FileParsers::MolSupplier::init | ( |  | ) |
| pure virtual

Implemented in RDKit::v2::FileParsers::ForwardSDMolSupplier, RDKit::v2::FileParsers::SDMolSupplier, RDKit::v2::FileParsers::SmilesMolSupplier, and RDKit::v2::FileParsers::TDTMolSupplier.

## ◆ next()

virtual std::unique_ptr< RWMol > RDKit::v2::FileParsers::MolSupplier::next | ( |  | ) |
| pure virtual

Implemented in RDKit::v2::FileParsers::ForwardSDMolSupplier, RDKit::v2::FileParsers::SDMolSupplier, RDKit::v2::FileParsers::SmilesMolSupplier, and RDKit::v2::FileParsers::TDTMolSupplier.

## ◆ openAndCheckStream()

std::istream * RDKit::v2::FileParsers::MolSupplier::openAndCheckStream | ( | const std::string & | filename | ) |
| inlineprotected

Definition at line 96 of file MolSupplier.h.

## ◆ reset()

virtual void RDKit::v2::FileParsers::MolSupplier::reset | ( |  | ) |
| pure virtual

Implemented in RDKit::v2::FileParsers::ForwardSDMolSupplier, RDKit::v2::FileParsers::SDMolSupplier, RDKit::v2::FileParsers::SmilesMolSupplier, and RDKit::v2::FileParsers::TDTMolSupplier.

## Member Data Documentation

## ◆ df_owner

bool RDKit::v2::FileParsers::MolSupplier::df_owner = false
| protected

Definition at line 92 of file MolSupplier.h.

Referenced by close().

## ◆ dp_inStream

std::istream* RDKit::v2::FileParsers::MolSupplier::dp_inStream = nullptr
| protected

Definition at line 90 of file MolSupplier.h.

Referenced by close().

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

- MolSupplier.h