Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Chem::TopologicalEntityAlignment< T > Class Template Reference

TopologicalEntityAlignment. More...

#include <TopologicalEntityAlignment.hpp>

+ Inheritance diagram for CDPL::Chem::TopologicalEntityAlignment< T >:

Public Types

typedef T EntityType
 The actual entity type. More...
 
typedef std::vector< const EntityType * > EntitySet
 The container storing the entities to align. More...
 
typedef boost::indirect_iterator< typename EntitySet::const_iterator, const EntityTypeConstEntityIterator
 A constant iterator over the stored entities. More...
 
typedef std::function< bool(const EntityType &, const EntityType &)> EntityMatchFunction
 A generic wrapper class used to store a user-defined entity match constraint function. More...
 
typedef std::function< bool(const EntityType &, const EntityType &, const EntityType &, const EntityType &)> EntityPairMatchFunction
 A generic wrapper class used to store a user-defined entity-pair match constraint function. More...
 

Public Member Functions

 TopologicalEntityAlignment ()
 Constructs the TopologicalEntityAlignment instance. More...
 
virtual ~TopologicalEntityAlignment ()
 Virtual destructor. More...
 
void setEntityMatchFunction (const EntityMatchFunction &func)
 Specifies a function for restricting allowed entity mappings in the search for alignment solutions. More...
 
const EntityMatchFunctiongetEntityMatchFunction () const
 Returns the function that was registered for restricting allowed entity mappings. More...
 
void setEntityPairMatchFunction (const EntityPairMatchFunction &func)
 Specifies a function for checking the compatibility of entity-pairs in the search for alignment solutions. More...
 
const EntityPairMatchFunctiongetEntityPairMatchFunction () const
 Returns the function that was registered for checking the compatibility of entity-pairs. More...
 
void addEntity (const EntityType &entity, bool first_set)
 Adds an entity to the specified alignment entity set. More...
 
void clearEntities (bool first_set)
 Removes all entities in the specified alignment entity set. More...
 
std::size_t getNumEntities (bool first_set) const
 Returns the number of entities in the specified alignment entity set. More...
 
ConstEntityIterator getEntitiesBegin (bool first_set) const
 Returns a constant iterator pointing to the beginning of the entities stored in the specified set. More...
 
ConstEntityIterator getEntitiesEnd (bool first_set) const
 Returns a constant iterator pointing to the end of the entities stored in the specified set. More...
 
const EntityTypegetEntity (std::size_t idx, bool first_set) const
 Returns a non-const reference to the stored entity at index idx in the specified set. More...
 
bool nextAlignment (Util::STPairArray &mapping)
 Searches for the next alignment solution and stores the corresponding mapping of the entities in the first set to the entities in the second set in the map provided as an argument. More...
 
void reset ()
 

Detailed Description

template<typename T>
class CDPL::Chem::TopologicalEntityAlignment< T >

TopologicalEntityAlignment.

Member Typedef Documentation

◆ EntityType

template<typename T >
typedef T CDPL::Chem::TopologicalEntityAlignment< T >::EntityType

The actual entity type.

◆ EntitySet

template<typename T >
typedef std::vector<const EntityType*> CDPL::Chem::TopologicalEntityAlignment< T >::EntitySet

The container storing the entities to align.

◆ ConstEntityIterator

template<typename T >
typedef boost::indirect_iterator<typename EntitySet::const_iterator, const EntityType> CDPL::Chem::TopologicalEntityAlignment< T >::ConstEntityIterator

A constant iterator over the stored entities.

◆ EntityMatchFunction

template<typename T >
typedef std::function<bool(const EntityType&, const EntityType&)> CDPL::Chem::TopologicalEntityAlignment< T >::EntityMatchFunction

A generic wrapper class used to store a user-defined entity match constraint function.

◆ EntityPairMatchFunction

template<typename T >
typedef std::function<bool(const EntityType&, const EntityType&, const EntityType&, const EntityType&)> CDPL::Chem::TopologicalEntityAlignment< T >::EntityPairMatchFunction

A generic wrapper class used to store a user-defined entity-pair match constraint function.

Constructor & Destructor Documentation

◆ TopologicalEntityAlignment()

Constructs the TopologicalEntityAlignment instance.

◆ ~TopologicalEntityAlignment()

template<typename T >
virtual CDPL::Chem::TopologicalEntityAlignment< T >::~TopologicalEntityAlignment ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ setEntityMatchFunction()

template<typename T >
void CDPL::Chem::TopologicalEntityAlignment< T >::setEntityMatchFunction ( const EntityMatchFunction func)

Specifies a function for restricting allowed entity mappings in the search for alignment solutions.

Parameters
funcThe constraint check function.

◆ getEntityMatchFunction()

template<typename T >
const CDPL::Chem::TopologicalEntityAlignment< T >::EntityMatchFunction & CDPL::Chem::TopologicalEntityAlignment< T >::getEntityMatchFunction

Returns the function that was registered for restricting allowed entity mappings.

Returns
The registered constraint check function.

◆ setEntityPairMatchFunction()

template<typename T >
void CDPL::Chem::TopologicalEntityAlignment< T >::setEntityPairMatchFunction ( const EntityPairMatchFunction func)

Specifies a function for checking the compatibility of entity-pairs in the search for alignment solutions.

Parameters
funcThe constraint check function.
Note
This function gets only called for pairs with already matching first and second entities.

◆ getEntityPairMatchFunction()

template<typename T >
const CDPL::Chem::TopologicalEntityAlignment< T >::EntityPairMatchFunction & CDPL::Chem::TopologicalEntityAlignment< T >::getEntityPairMatchFunction

Returns the function that was registered for checking the compatibility of entity-pairs.

Returns
The registered constraint check function.

◆ addEntity()

template<typename T >
void CDPL::Chem::TopologicalEntityAlignment< T >::addEntity ( const EntityType entity,
bool  first_set 
)

Adds an entity to the specified alignment entity set.

Parameters
entityThe entity object to add.
first_setIf true, the entity is added to the first entity set, if false to the second one.
Note
Adding the same entity instance more than once has no effect.

◆ clearEntities()

template<typename T >
void CDPL::Chem::TopologicalEntityAlignment< T >::clearEntities ( bool  first_set)

Removes all entities in the specified alignment entity set.

Parameters
first_setIf true, the first entity set is cleared, if false the second one.

◆ getNumEntities()

template<typename T >
std::size_t CDPL::Chem::TopologicalEntityAlignment< T >::getNumEntities ( bool  first_set) const

Returns the number of entities in the specified alignment entity set.

Parameters
first_setIf true, the size of first entity set is returned, if false the size of the second one.

◆ getEntitiesBegin()

template<typename T >
CDPL::Chem::TopologicalEntityAlignment< T >::ConstEntityIterator CDPL::Chem::TopologicalEntityAlignment< T >::getEntitiesBegin ( bool  first_set) const

Returns a constant iterator pointing to the beginning of the entities stored in the specified set.

Parameters
first_setIf true, an iterator for first entity set is returned, if false for the second one.
Returns
A constant iterator pointing to the beginning of the entities stored in the specified set.

◆ getEntitiesEnd()

template<typename T >
CDPL::Chem::TopologicalEntityAlignment< T >::ConstEntityIterator CDPL::Chem::TopologicalEntityAlignment< T >::getEntitiesEnd ( bool  first_set) const

Returns a constant iterator pointing to the end of the entities stored in the specified set.

Parameters
first_setIf true, an iterator for first entity set is returned, if false for the second one.
Returns
A constant iterator pointing to the end of the entities stored in the specified set.

◆ getEntity()

template<typename T >
const CDPL::Chem::TopologicalEntityAlignment< T >::EntityType & CDPL::Chem::TopologicalEntityAlignment< T >::getEntity ( std::size_t  idx,
bool  first_set 
) const

Returns a non-const reference to the stored entity at index idx in the specified set.

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

◆ nextAlignment()

template<typename T >
bool CDPL::Chem::TopologicalEntityAlignment< T >::nextAlignment ( Util::STPairArray mapping)

Searches for the next alignment solution and stores the corresponding mapping of the entities in the first set to the entities in the second set in the map provided as an argument.

Parameters
mappingThe map where the entitiy mapping of the found alignment solution has to be stored.
Returns
true if a new alignment solution could be found, and false otherwise.

◆ reset()

template<typename T >
void CDPL::Chem::TopologicalEntityAlignment< T >::reset

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