Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Pharm::FeatureSet Class Reference

FeatureSet. More...

#include <FeatureSet.hpp>

+ Inheritance diagram for CDPL::Pharm::FeatureSet:

Public Types

typedef std::shared_ptr< FeatureSetSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated FeatureSet instances. More...
 
typedef boost::indirect_iterator< FeatureList::const_iterator, const FeatureConstFeatureIterator
 A constant random access iterator used to iterate over the stored const Pharm::Feature objects. More...
 
typedef boost::indirect_iterator< FeatureList::iterator, FeatureFeatureIterator
 A mutable random access iterator used to iterate over the stored const Pharm::Feature objects. More...
 
- Public Types inherited from CDPL::Pharm::FeatureContainer
typedef std::shared_ptr< FeatureContainerSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated FeatureContainer instances. More...
 
typedef Util::IndexedElementIterator< const Feature, ConstFeatureAccessor > ConstFeatureIterator
 A constant random access iterator used to iterate over the stored const Pharm::Feature objects. More...
 
typedef Util::IndexedElementIterator< Feature, FeatureAccessor > FeatureIterator
 A mutable random access iterator used to iterate over the stored Pharm::Feature objects. More...
 
- Public Types inherited from CDPL::Chem::Entity3DContainer
typedef Util::IndexedElementIterator< const Entity3D, ConstEntityAccessor > ConstEntityIterator
 A constant random access iterator used to iterate over the stored const Chem::Entity3D objects. More...
 
typedef Util::IndexedElementIterator< Entity3D, EntityAccessor > EntityIterator
 A mutable random access iterator used to iterate over the stored Chem::Entity3D objects. More...
 
- Public Types inherited from CDPL::Base::PropertyContainer
typedef PropertyMap::value_type PropertyEntry
 A Base::LookupKey / Base::Any pair that stores the property value for a given property key. More...
 
typedef PropertyMap::const_iterator ConstPropertyIterator
 A constant iterator used to iterate over the property entries. More...
 

Public Member Functions

 FeatureSet ()
 Constructs an empty FeatureSet instance. More...
 
 FeatureSet (const FeatureSet &ftr_set)
 Constructs a copy of the FeatureSet instance ftr_set. More...
 
 FeatureSet (const FeatureContainer &cntnr)
 Constructs a FeatureSet instance storing the features and properties of the feature container cntnr. More...
 
 ~FeatureSet ()
 Destructor. More...
 
std::size_t getNumFeatures () const
 Returns the number of features. More...
 
bool containsFeature (const Feature &ftr) const
 Tells whether the specified feature is part of this feature set. More...
 
std::size_t getFeatureIndex (const Feature &ftr) const
 Returns the index of the specified feature. More...
 
ConstFeatureIterator getFeaturesBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Pharm::Feature objects. More...
 
FeatureIterator getFeaturesBegin ()
 Returns a mutable iterator pointing to the beginning of the stored const Pharm::Feature objects. More...
 
ConstFeatureIterator getFeaturesEnd () const
 Returns a constant iterator pointing to the end of the stored const Pharm::Feature objects. More...
 
FeatureIterator getFeaturesEnd ()
 Returns a mutable iterator pointing to the end of the stored const Pharm::Feature objects. More...
 
const FeaturegetFeature (std::size_t idx) const
 Returns a const reference to the feature at index idx. More...
 
FeaturegetFeature (std::size_t idx)
 Returns a non-const reference to the feature at index idx. More...
 
bool addFeature (const Feature &ftr)
 Extends the feature set by the specified feature. More...
 
void removeFeature (std::size_t idx)
 Removes the feature at the specified index. More...
 
FeatureIterator removeFeature (const FeatureIterator &it)
 Removes the feature specified by the iterator it. More...
 
bool removeFeature (const Feature &ftr)
 Removes the specified feature. More...
 
void clear ()
 Removes all features and properties. More...
 
FeatureSetoperator= (const FeatureSet &ftr_set)
 Replaces the current set of features and properties by the features and properties of the feature set ftr_set. More...
 
FeatureSetoperator= (const FeatureContainer &cntnr)
 Replaces the current set of features and properties by the features and properties of the feature container cntnr. More...
 
FeatureSetoperator+= (const FeatureContainer &cntnr)
 Extends the current set of features by the features in the feature container cntnr. More...
 
FeatureSetoperator-= (const FeatureContainer &cntnr)
 Removes the pharmacophore features referenced by the feature container cntnr from this FeatureSet instance. More...
 
- Public Member Functions inherited from CDPL::Pharm::FeatureContainer
virtual ~FeatureContainer ()
 Virtual destructor. More...
 
ConstFeatureIterator getFeaturesBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Pharm::Feature objects. More...
 
ConstFeatureIterator getFeaturesEnd () const
 Returns a constant iterator pointing to the end of the stored const Pharm::Feature objects. More...
 
FeatureIterator getFeaturesBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Pharm::Feature objects. More...
 
FeatureIterator getFeaturesEnd ()
 Returns a mutable iterator pointing to the end of the stored Pharm::Feature objects. More...
 
ConstFeatureIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored const Pharm::Feature objects. More...
 
ConstFeatureIterator end () const
 Returns a constant iterator pointing to the end of the stored const Pharm::Feature objects. More...
 
FeatureIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored Pharm::Feature objects. More...
 
FeatureIterator end ()
 Returns a mutable iterator pointing to the end of the stored Pharm::Feature objects. More...
 
virtual std::size_t getNumEntities () const
 Returns the number of stored Chem::Entity3D objects. More...
 
virtual const Chem::Entity3DgetEntity (std::size_t idx) const
 Returns a const reference to the Chem::Entity3D instance at index idx. More...
 
virtual Chem::Entity3DgetEntity (std::size_t idx)
 Returns a non-const reference to the entity at index idx. More...
 
- Public Member Functions inherited from CDPL::Chem::Entity3DContainer
ConstEntityIterator getEntitiesBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More...
 
ConstEntityIterator getEntitiesEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More...
 
EntityIterator getEntitiesBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More...
 
EntityIterator getEntitiesEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More...
 
ConstEntityIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More...
 
ConstEntityIterator end () const
 Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More...
 
EntityIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More...
 
EntityIterator end ()
 Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More...
 
const Entity3DContainergetEntities () const
 Returns a const reference to itself. More...
 
Entity3DContainergetEntities ()
 Returns a reference to itself. More...
 
- Public Member Functions inherited from CDPL::Base::PropertyContainer
std::size_t getNumProperties () const
 Returns the number of property entries. More...
 
template<typename T >
void setProperty (const LookupKey &key, T &&val)
 Sets the value of the property specified by key to val. More...
 
template<typename T >
const T & getProperty (const LookupKey &key) const
 Returns the value of the property specified by key as a const reference to an object of type T. More...
 
template<typename T >
const T & getPropertyOrDefault (const LookupKey &key, const T &def_val) const
 Returns the value of the property specified by key as a const reference to an object of type T, or the default value def_val if a stored value does not exist. More...
 
const AnygetProperty (const LookupKey &key, bool throw_=false) const
 Returns the value of the property specified by key. More...
 
bool isPropertySet (const LookupKey &key) const
 Tells whether or not a value has been assigned to the property specified by key. More...
 
ConstPropertyIterator getPropertiesBegin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator getPropertiesEnd () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
ConstPropertyIterator begin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator end () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
bool removeProperty (const LookupKey &key)
 Clears the value of the property specified by key. More...
 
void clearProperties ()
 Clears all property values. More...
 
void addProperties (const PropertyContainer &cntnr)
 Adds the property value entries in the PropertyContainer instance cntnr. More...
 
void copyProperties (const PropertyContainer &cntnr)
 Replaces the current set of properties by a copy of the entries in cntnr. More...
 
void swap (PropertyContainer &cntnr)
 Exchanges the properties of this container with the properties of the container cntnr. More...
 
const PropertyContainergetProperties () const
 Returns a const reference to itself. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Pharm::FeatureContainer
FeatureContaineroperator= (const FeatureContainer &cntnr)
 Replaces the current set of pharmacophore features and properties by a copy of the features and properties of the container cntnr. More...
 
- Protected Member Functions inherited from CDPL::Chem::Entity3DContainer
virtual ~Entity3DContainer ()
 Virtual destructor. More...
 
Entity3DContaineroperator= (const Entity3DContainer &cntnr)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Base::PropertyContainer
 PropertyContainer ()
 Constructs an empty PropertyContainer instance. More...
 
 PropertyContainer (const PropertyContainer &cntnr)
 Constructs a copy of the PropertyContainer instance cntnr. More...
 
virtual ~PropertyContainer ()
 Virtual destructor. More...
 
PropertyContaineroperator= (const PropertyContainer &cntnr)
 Assignment operator. More...
 

Detailed Description

FeatureSet.

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated FeatureSet instances.

◆ ConstFeatureIterator

typedef boost::indirect_iterator<FeatureList::const_iterator, const Feature> CDPL::Pharm::FeatureSet::ConstFeatureIterator

A constant random access iterator used to iterate over the stored const Pharm::Feature objects.

◆ FeatureIterator

typedef boost::indirect_iterator<FeatureList::iterator, Feature> CDPL::Pharm::FeatureSet::FeatureIterator

A mutable random access iterator used to iterate over the stored const Pharm::Feature objects.

Constructor & Destructor Documentation

◆ FeatureSet() [1/3]

CDPL::Pharm::FeatureSet::FeatureSet ( )

Constructs an empty FeatureSet instance.

◆ FeatureSet() [2/3]

CDPL::Pharm::FeatureSet::FeatureSet ( const FeatureSet ftr_set)

Constructs a copy of the FeatureSet instance ftr_set.

Parameters
ftr_setThe other FeatureSet instance to copy.

◆ FeatureSet() [3/3]

CDPL::Pharm::FeatureSet::FeatureSet ( const FeatureContainer cntnr)
explicit

Constructs a FeatureSet instance storing the features and properties of the feature container cntnr.

Parameters
cntnrThe Pharm::FeatureContainer instance providing the features and properties to store.

◆ ~FeatureSet()

CDPL::Pharm::FeatureSet::~FeatureSet ( )

Destructor.

Destroys the FeatureSet instance and frees all allocated resources.

Member Function Documentation

◆ getNumFeatures()

std::size_t CDPL::Pharm::FeatureSet::getNumFeatures ( ) const
virtual

Returns the number of features.

Returns
The number of features.

Implements CDPL::Pharm::FeatureContainer.

◆ containsFeature()

bool CDPL::Pharm::FeatureSet::containsFeature ( const Feature ftr) const
virtual

Tells whether the specified feature is part of this feature set.

Parameters
ftrThe feature to look for.
Returns
true if feature is part of this feature set, and false otherwise.

Implements CDPL::Pharm::FeatureContainer.

◆ getFeatureIndex()

std::size_t CDPL::Pharm::FeatureSet::getFeatureIndex ( const Feature ftr) const
virtual

Returns the index of the specified feature.

Parameters
ftrThe feature for which to return the index.
Returns
The zero-based index of the specified feature.
Exceptions
Base::ItemNotFoundif the specified feature is not part of the feature set.

Implements CDPL::Pharm::FeatureContainer.

◆ getFeaturesBegin() [1/2]

ConstFeatureIterator CDPL::Pharm::FeatureSet::getFeaturesBegin ( ) const

Returns a constant iterator pointing to the beginning of the stored const Pharm::Feature objects.

Returns
A constant iterator pointing to the beginning of the stored const Pharm::Feature objects.

◆ getFeaturesBegin() [2/2]

FeatureIterator CDPL::Pharm::FeatureSet::getFeaturesBegin ( )

Returns a mutable iterator pointing to the beginning of the stored const Pharm::Feature objects.

Returns
A mutable iterator pointing to the beginning of the stored const Pharm::Feature objects.

◆ getFeaturesEnd() [1/2]

ConstFeatureIterator CDPL::Pharm::FeatureSet::getFeaturesEnd ( ) const

Returns a constant iterator pointing to the end of the stored const Pharm::Feature objects.

Returns
A constant iterator pointing to the end of the stored const Pharm::Feature objects.

◆ getFeaturesEnd() [2/2]

FeatureIterator CDPL::Pharm::FeatureSet::getFeaturesEnd ( )

Returns a mutable iterator pointing to the end of the stored const Pharm::Feature objects.

Returns
A mutable iterator pointing to the end of the stored const Pharm::Feature objects.

◆ getFeature() [1/2]

const Feature& CDPL::Pharm::FeatureSet::getFeature ( std::size_t  idx) const
virtual

Returns a const reference to the feature at index idx.

Parameters
idxThe zero-based index of the feature to return.
Returns
A const reference to the feature at the specified index.
Exceptions
Base::IndexErrorif the number of features is zero or idx is not in the range [0, getNumFeatures() - 1].

Implements CDPL::Pharm::FeatureContainer.

◆ getFeature() [2/2]

Feature& CDPL::Pharm::FeatureSet::getFeature ( std::size_t  idx)
virtual

Returns a non-const reference to the feature at index idx.

Parameters
idxThe zero-based index of the feature to return.
Returns
A non-const reference to the feature at the specified index.
Exceptions
Base::IndexErrorif the number of features is zero or idx is not in the range [0, getNumFeatures() - 1].

Implements CDPL::Pharm::FeatureContainer.

◆ addFeature()

bool CDPL::Pharm::FeatureSet::addFeature ( const Feature ftr)

Extends the feature set by the specified feature.

Parameters
ftrThe feature to add.
Returns
true if the feature was not already a part of the feature set, and false otherwise.

◆ removeFeature() [1/3]

void CDPL::Pharm::FeatureSet::removeFeature ( std::size_t  idx)

Removes the feature at the specified index.

Parameters
idxThe zero-based index of the feature to remove.
Exceptions
Base::IndexErrorif the number of features is zero or idx is not in the range [0, getNumFeatures() - 1].

◆ removeFeature() [2/3]

FeatureIterator CDPL::Pharm::FeatureSet::removeFeature ( const FeatureIterator it)

Removes the feature specified by the iterator it.

Parameters
itAn iterator that specifies the feature to remove.
Returns
A mutable iterator pointing to the next feature in the list.
Exceptions
Base::RangeErrorif the number of features is zero or it is not in the range [getFeaturesBegin(), getFeaturesEnd() - 1].

◆ removeFeature() [3/3]

bool CDPL::Pharm::FeatureSet::removeFeature ( const Feature ftr)

Removes the specified feature.

Parameters
ftrThe feature to remove.
Returns
true if the feature was part of the feature set and has been removed, and false otherwise.

◆ clear()

void CDPL::Pharm::FeatureSet::clear ( )

Removes all features and properties.

◆ operator=() [1/2]

FeatureSet& CDPL::Pharm::FeatureSet::operator= ( const FeatureSet ftr_set)

Replaces the current set of features and properties by the features and properties of the feature set ftr_set.

Parameters
ftr_setThe feature set to copy.
Returns
A reference to itself.

◆ operator=() [2/2]

FeatureSet& CDPL::Pharm::FeatureSet::operator= ( const FeatureContainer cntnr)

Replaces the current set of features and properties by the features and properties of the feature container cntnr.

Parameters
cntnrThe Pharm::FeatureContainer instance providing the features and properties to copy.
Returns
A reference to itself.

◆ operator+=()

FeatureSet& CDPL::Pharm::FeatureSet::operator+= ( const FeatureContainer cntnr)

Extends the current set of features by the features in the feature container cntnr.

Parameters
cntnrThe Pharm::FeatureContainer instance providing the features to append.
Returns
A reference to itself.
Note
Does not affect any properties.

◆ operator-=()

FeatureSet& CDPL::Pharm::FeatureSet::operator-= ( const FeatureContainer cntnr)

Removes the pharmacophore features referenced by the feature container cntnr from this FeatureSet instance.

Parameters
cntnrThe Pharm::FeatureContainer instance providing the features to remove.
Returns
A reference to itself.
Note
Does not affect any properties if this != &cntr.

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