RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RDKit::FilterCatalogEntry Class Reference

#include <FilterCatalogEntry.h>

Inheritance diagram for RDKit::FilterCatalogEntry:
RDCatalog::CatalogEntry

Public Member Functions

 FilterCatalogEntry ()
 FilterCatalogEntry (const std::string &name, const FilterMatcherBase &matcher)
 FilterCatalogEntry (const std::string &name, boost::shared_ptr< FilterMatcherBase > matcher)
 FilterCatalogEntry (const FilterCatalogEntry &rhs)
 ~FilterCatalogEntry () override
bool isValid () const
 Returns true if the Filters stored in this catalog entry are valid.
std::string getDescription () const override
 Returns the description of the catalog entry.
void setDescription (const std::string &description)
 Sets the description of the catalog entry.
Properties
STR_VECT getPropList () const
 returns a list with the names of our properties
template<typename T>
void setProp (const std::string_view key, T val)
 sets a property value
template<typename T>
void getProp (const std::string_view key, T &res) const
 allows retrieval of a particular property value
template<typename T>
getProp (const std::string_view key) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
bool getPropIfPresent (const std::string_view key, T &res) const
bool hasProp (const std::string_view key) const
 returns whether or not we have a property with name key
void clearProp (const std::string_view key)
 clears the value of a property
DictgetProps ()
const DictgetProps () const
void setProps (const Dict &props)
bool getFilterMatches (const ROMol &mol, std::vector< FilterMatch > &matchVect) const
 Returns the matching filters for this catalog entry.
bool hasFilterMatch (const ROMol &mol) const
 Returns true if the filters in this catalog entry match the molecule.
void toStream (std::ostream &ss) const override
 serializes (pickles) to a stream
std::string Serialize () const override
 returns a string with a serialized (pickled) representation
void initFromStream (std::istream &ss) override
 initializes from a stream pickle
void initFromString (const std::string &text) override
 initializes from a string pickle
Public Member Functions inherited from RDCatalog::CatalogEntry
virtual ~CatalogEntry ()=0
void setBitId (int bid)
 sets our bit Id
int getBitId () const
 returns our bit Id

Detailed Description

Definition at line 57 of file FilterCatalogEntry.h.

Constructor & Destructor Documentation

◆ FilterCatalogEntry() [1/4]

RDKit::FilterCatalogEntry::FilterCatalogEntry ( )
inline

Definition at line 64 of file FilterCatalogEntry.h.

Referenced by FilterCatalogEntry().

◆ FilterCatalogEntry() [2/4]

RDKit::FilterCatalogEntry::FilterCatalogEntry ( const std::string & name,
const FilterMatcherBase & matcher )
inline

Definition at line 66 of file FilterCatalogEntry.h.

References setDescription().

◆ FilterCatalogEntry() [3/4]

RDKit::FilterCatalogEntry::FilterCatalogEntry ( const std::string & name,
boost::shared_ptr< FilterMatcherBase > matcher )
inline

Definition at line 71 of file FilterCatalogEntry.h.

References setDescription().

◆ FilterCatalogEntry() [4/4]

RDKit::FilterCatalogEntry::FilterCatalogEntry ( const FilterCatalogEntry & rhs)
inline

Definition at line 77 of file FilterCatalogEntry.h.

References FilterCatalogEntry().

◆ ~FilterCatalogEntry()

RDKit::FilterCatalogEntry::~FilterCatalogEntry ( )
inlineoverride

Definition at line 82 of file FilterCatalogEntry.h.

Member Function Documentation

◆ clearProp()

void RDKit::FilterCatalogEntry::clearProp ( const std::string_view key)
inline

clears the value of a property

Definition at line 155 of file FilterCatalogEntry.h.

◆ getDescription()

std::string RDKit::FilterCatalogEntry::getDescription ( ) const
overridevirtual

Returns the description of the catalog entry.

Implements RDCatalog::CatalogEntry.

◆ getFilterMatches()

bool RDKit::FilterCatalogEntry::getFilterMatches ( const ROMol & mol,
std::vector< FilterMatch > & matchVect ) const
inline

Returns the matching filters for this catalog entry.

Definition at line 171 of file FilterCatalogEntry.h.

References isValid().

◆ getProp() [1/2]

template<typename T>
T RDKit::FilterCatalogEntry::getProp ( const std::string_view key) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 140 of file FilterCatalogEntry.h.

◆ getProp() [2/2]

template<typename T>
void RDKit::FilterCatalogEntry::getProp ( const std::string_view key,
T & res ) const
inline

allows retrieval of a particular property value

Parameters
keythe name under which the property should be stored. If a property is already stored under this name, it will be replaced.
resa reference to the storage location for the value.

Notes:

  • if no property with name key exists, a KeyErrorException will be thrown.
  • the boost::lexical_cast machinery is used to attempt type conversions. If this fails, a boost::bad_lexical_cast exception will be thrown.

Definition at line 135 of file FilterCatalogEntry.h.

◆ getPropIfPresent()

template<typename T>
bool RDKit::FilterCatalogEntry::getPropIfPresent ( const std::string_view key,
T & res ) const
inline

returns whether or not we have a property with name key and assigns the value if we do

Definition at line 147 of file FilterCatalogEntry.h.

◆ getPropList()

STR_VECT RDKit::FilterCatalogEntry::getPropList ( ) const
inline

returns a list with the names of our properties

Definition at line 104 of file FilterCatalogEntry.h.

◆ getProps() [1/2]

Dict & RDKit::FilterCatalogEntry::getProps ( )
inline

Properties usually contain the reference and source for the catalog entry.

Definition at line 161 of file FilterCatalogEntry.h.

◆ getProps() [2/2]

const Dict & RDKit::FilterCatalogEntry::getProps ( ) const
inline

Definition at line 162 of file FilterCatalogEntry.h.

◆ hasFilterMatch()

bool RDKit::FilterCatalogEntry::hasFilterMatch ( const ROMol & mol) const
inline

Returns true if the filters in this catalog entry match the molecule.

Definition at line 182 of file FilterCatalogEntry.h.

References isValid().

◆ hasProp()

bool RDKit::FilterCatalogEntry::hasProp ( const std::string_view key) const
inline

returns whether or not we have a property with name key

Definition at line 152 of file FilterCatalogEntry.h.

◆ initFromStream()

void RDKit::FilterCatalogEntry::initFromStream ( std::istream & ss)
overridevirtual

initializes from a stream pickle

Implements RDCatalog::CatalogEntry.

◆ initFromString()

void RDKit::FilterCatalogEntry::initFromString ( const std::string & text)
overridevirtual

initializes from a string pickle

Implements RDCatalog::CatalogEntry.

◆ isValid()

bool RDKit::FilterCatalogEntry::isValid ( ) const
inline

Returns true if the Filters stored in this catalog entry are valid.

Definition at line 87 of file FilterCatalogEntry.h.

Referenced by getFilterMatches(), and hasFilterMatch().

◆ Serialize()

std::string RDKit::FilterCatalogEntry::Serialize ( ) const
overridevirtual

returns a string with a serialized (pickled) representation

Implements RDCatalog::CatalogEntry.

◆ setDescription()

void RDKit::FilterCatalogEntry::setDescription ( const std::string & description)

Sets the description of the catalog entry.

Referenced by FilterCatalogEntry(), and FilterCatalogEntry().

◆ setProp()

template<typename T>
void RDKit::FilterCatalogEntry::setProp ( const std::string_view key,
T val )
inline

sets a property value

Parameters
keythe name under which the property should be stored. If a property is already stored under this name, it will be replaced.
valthe value to be stored

Definition at line 114 of file FilterCatalogEntry.h.

◆ setProps()

void RDKit::FilterCatalogEntry::setProps ( const Dict & props)
inline

Definition at line 163 of file FilterCatalogEntry.h.

◆ toStream()

void RDKit::FilterCatalogEntry::toStream ( std::ostream & ss) const
overridevirtual

serializes (pickles) to a stream

Implements RDCatalog::CatalogEntry.


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