Chemical Data Processing Library C++ API - Version 1.2.0
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
CDPL::Chem::Entity3DContainer Class Referenceabstract

A common interface for data-structures that support a random access to stored Chem::Entity3D instances. More...

#include <Entity3DContainer.hpp>

+ Inheritance diagram for CDPL::Chem::Entity3DContainer:

Public Types

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 Member Functions

virtual std::size_t getNumEntities () const =0
 Returns the number of stored Chem::Entity3D objects. More...
 
virtual const Entity3DgetEntity (std::size_t idx) const =0
 Returns a const reference to the Chem::Entity3D instance at index idx. More...
 
virtual Entity3DgetEntity (std::size_t idx)=0
 Returns a non-const reference to the entity at index idx. More...
 
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...
 

Protected Member Functions

virtual ~Entity3DContainer ()
 Virtual destructor. More...
 
Entity3DContaineroperator= (const Entity3DContainer &cntnr)
 Assignment operator. More...
 

Detailed Description

A common interface for data-structures that support a random access to stored Chem::Entity3D instances.

Implementations have to guarantee that a given Chem::Entity3D object is stored only once and its index is unique amongst all contained Chem::Entity3D instances. Otherwise algorithms that rely on this behaviour may not work correctly!

Member Typedef Documentation

◆ ConstEntityIterator

A constant random access iterator used to iterate over the stored const Chem::Entity3D objects.

◆ EntityIterator

A mutable random access iterator used to iterate over the stored Chem::Entity3D objects.

Constructor & Destructor Documentation

◆ ~Entity3DContainer()

virtual CDPL::Chem::Entity3DContainer::~Entity3DContainer ( )
inlineprotectedvirtual

Virtual destructor.

Member Function Documentation

◆ getNumEntities()

virtual std::size_t CDPL::Chem::Entity3DContainer::getNumEntities ( ) const
pure virtual

Returns the number of stored Chem::Entity3D objects.

Returns
The number of stored Chem::Entity3D objects.

Implemented in CDPL::Pharm::FeatureContainer, CDPL::ConfGen::CanonicalFragment, and CDPL::Chem::AtomContainer.

◆ getEntity() [1/2]

virtual const Entity3D& CDPL::Chem::Entity3DContainer::getEntity ( std::size_t  idx) const
pure virtual

Returns a const reference to the Chem::Entity3D instance at index idx.

Parameters
idxThe zero-based index of the Chem::Entity3D instance to return.
Returns
A const reference to the Chem::Entity3D instance at the specified index.
Exceptions
Base::IndexErrorif the container is empty or idx is not in the range [0, getNumEntities() - 1].

Implemented in CDPL::Pharm::FeatureContainer, CDPL::ConfGen::CanonicalFragment, and CDPL::Chem::AtomContainer.

◆ getEntity() [2/2]

virtual Entity3D& CDPL::Chem::Entity3DContainer::getEntity ( std::size_t  idx)
pure virtual

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

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

Implemented in CDPL::Pharm::FeatureContainer, CDPL::ConfGen::CanonicalFragment, and CDPL::Chem::AtomContainer.

◆ getEntitiesBegin() [1/2]

ConstEntityIterator CDPL::Chem::Entity3DContainer::getEntitiesBegin ( ) const

Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects.

Returns
A constant iterator pointing to the beginning of the stored const Chem::Entity3D objects.

◆ getEntitiesEnd() [1/2]

ConstEntityIterator CDPL::Chem::Entity3DContainer::getEntitiesEnd ( ) const

Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects.

Returns
A constant iterator pointing to the end of the stored const Chem::Entity3D objects.

◆ getEntitiesBegin() [2/2]

EntityIterator CDPL::Chem::Entity3DContainer::getEntitiesBegin ( )

Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects.

Returns
A mutable iterator pointing to the beginning of the stored Chem::Entity3D objects.

◆ getEntitiesEnd() [2/2]

EntityIterator CDPL::Chem::Entity3DContainer::getEntitiesEnd ( )

Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects.

Returns
A mutable iterator pointing to the end of the stored Chem::Entity3D objects.

◆ begin() [1/2]

ConstEntityIterator CDPL::Chem::Entity3DContainer::begin ( ) const

Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects.

Returns
A constant iterator pointing to the beginning of the stored const Chem::Entity3D objects.

◆ end() [1/2]

ConstEntityIterator CDPL::Chem::Entity3DContainer::end ( ) const

Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects.

Returns
A constant iterator pointing to the end of the stored const Chem::Entity3D objects.

◆ begin() [2/2]

EntityIterator CDPL::Chem::Entity3DContainer::begin ( )

Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects.

Returns
A mutable iterator pointing to the beginning of the stored Chem::Entity3D objects.

◆ end() [2/2]

EntityIterator CDPL::Chem::Entity3DContainer::end ( )

Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects.

Returns
A mutable iterator pointing to the end of the stored Chem::Entity3D objects.

◆ getEntities() [1/2]

const Entity3DContainer& CDPL::Chem::Entity3DContainer::getEntities ( ) const
inline

Returns a const reference to itself.

Returns
A const reference to itself.

◆ getEntities() [2/2]

Entity3DContainer& CDPL::Chem::Entity3DContainer::getEntities ( )
inline

Returns a reference to itself.

Returns
A reference to itself.

◆ operator=()

Entity3DContainer& CDPL::Chem::Entity3DContainer::operator= ( const Entity3DContainer cntnr)
protected

Assignment operator.

Parameters
cntnrThe other container to copy.
Returns
A reference to itself.

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