Class SBCFunctor#
This class describes a functor. More...
#include <SBCFunctor.hpp>
Inherited by the following classes: SBCFunctor0, SBCFunctor0, SBCFunctor0, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor1, SBCFunctor10, SBCFunctor10, SBCFunctor10, SBCFunctor10, SBCFunctor11, SBCFunctor11, SBCFunctor11, SBCFunctor11, SBCFunctor12, SBCFunctor12, SBCFunctor12, SBCFunctor12, SBCFunctor13, SBCFunctor13, SBCFunctor13, SBCFunctor13, SBCFunctor14, SBCFunctor14, SBCFunctor14, SBCFunctor14, SBCFunctor15, SBCFunctor15, SBCFunctor15, SBCFunctor15, SBCFunctor16, SBCFunctor16, SBCFunctor16, SBCFunctor16, SBCFunctor2, SBCFunctor2, SBCFunctor2, SBCFunctor2, SBCFunctor3, SBCFunctor3, SBCFunctor3, SBCFunctor3, SBCFunctor4, SBCFunctor4, SBCFunctor4, SBCFunctor4, SBCFunctor5, SBCFunctor5, SBCFunctor5, SBCFunctor5, SBCFunctor6, SBCFunctor6, SBCFunctor6, SBCFunctor6, SBCFunctor7, SBCFunctor7, SBCFunctor7, SBCFunctor7, SBCFunctor8, SBCFunctor8, SBCFunctor8, SBCFunctor8, SBCFunctor9, SBCFunctor9, SBCFunctor9, SBCFunctor9, SBCFunctor0, SBCFunctor1, SBCFunctor10, SBCFunctor11, SBCFunctor12, SBCFunctor13, SBCFunctor14, SBCFunctor15, SBCFunctor16, SBCFunctor2, SBCFunctor3, SBCFunctor4, SBCFunctor5, SBCFunctor6, SBCFunctor7, SBCFunctor8, SBCFunctor9
Public Functions#
Type | Name |
---|---|
SBCFunctor () Constructs a functor. |
|
virtual SBCFunctor * | clone () const |
virtual | ~SBCFunctor () Destructs the functor. |
Detailed Description#
This class describes a functor. A functor is an object of a class that acts as a function.
For example, the only purpose of the following class is to compute the distance between two atoms:
class DistanceCalculator : public SBFunctor2<SBQuantity::length, SBAtom*, SBAtom*> {
public:
DistanceCalculator() {}
virtual ~DistanceCalculator() {}
SBQuantity::length operator(SBAtom* atom1, SBAtom atom2) {
return (atom1->getPosition() - atom2->getPosition()).norm();
}
};
The class SBCFunctor is the base class of all functor classes:
- SBCFunctor0: a functor which takes no arguments
- SBCFunctor1: a functor which takes 1 argument
- ...
- SBCFunctor16: a functor which takes 16 arguments
Functors are used in several places. In particular, predicates are functors that return a boolean and which may be logically combined.
Short name: SBFunctor
See also: SBCFunctorPredicate
Public Functions Documentation#
function SBCFunctor#
Constructs a functor.
function clone#
function ~SBCFunctor#
Destructs the functor.