RDKit: RDKit::CachedMolHolder Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Member Functions | List of all members
RDKit::CachedMolHolder Class Reference

Concrete class that holds binary cached molecules in memory. More...

`#include <SubstructLibrary.h>`

Inheritance diagram for RDKit::CachedMolHolder:

## Public Member Functions
| CachedMolHolder ()
unsigned int | addMol (const ROMol &m) override
unsigned int | addBinary (const std::string &pickle)
boost::shared_ptr< ROMol > | getMol (unsigned int idx) const override
unsigned int | size () const override
| Get the current library size.
std::vector< std::string > & | getMols ()
const std::vector< std::string > & | getMols () const
Public Member Functions inherited from RDKit::MolHolderBase
virtual | ~MolHolderBase ()

## Detailed Description

Concrete class that holds binary cached molecules in memory.

This implementation uses quite a bit less memory than the non cached implementation. However, due to the reduced speed it should be used in conjunction with a pattern fingerprinter.

See RDKit::FPHolder

Definition at line 121 of file SubstructLibrary.h.

## Constructor & Destructor Documentation

## ◆ CachedMolHolder()

RDKit::CachedMolHolder::CachedMolHolder | ( |  | ) |
| inline

Definition at line 125 of file SubstructLibrary.h.

## Member Function Documentation

## ◆ addBinary()

unsigned int RDKit::CachedMolHolder::addBinary | ( | const std::string & | pickle | ) |
| inline

Adds a pickled binary molecule, no validity checking of the input is done.

Definition at line 135 of file SubstructLibrary.h.

References size().

## ◆ addMol()

unsigned int RDKit::CachedMolHolder::addMol | ( | const ROMol & | m | ) |
| inlineoverridevirtual

Add a new molecule to the substructure search library Returns the molecules index in the library

Implements RDKit::MolHolderBase.

Definition at line 127 of file SubstructLibrary.h.

References RDKit::MolPickler::pickleMol(), and size().

## ◆ getMol()

boost::shared_ptr< ROMol > RDKit::CachedMolHolder::getMol | ( | unsigned int | idx | ) | const
| inlineoverridevirtual

Implements RDKit::MolHolderBase.

Definition at line 140 of file SubstructLibrary.h.

References RDKit::MolPickler::molFromPickle().

## ◆ getMols() [1/2]

std::vector< std::string > & RDKit::CachedMolHolder::getMols | ( |  | ) |
| inline

Definition at line 153 of file SubstructLibrary.h.

## ◆ getMols() [2/2]

const std::vector< std::string > & RDKit::CachedMolHolder::getMols | ( |  | ) | const
| inline

Definition at line 154 of file SubstructLibrary.h.

## ◆ size()

unsigned int RDKit::CachedMolHolder::size | ( |  | ) | const
| inlineoverridevirtual

Get the current library size.

Implements RDKit::MolHolderBase.

Definition at line 149 of file SubstructLibrary.h.

References rdcast.

Referenced by addBinary(), and addMol().

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

- SubstructLibrary.h