OpenWalnut
1.5.0dev
|
This class builds the base for wrapping around nearly every possible predicates like functors, classes with operator() and so on. More...
#include <WPredicateHelper.h>
Public Member Functions | |
ArbitraryPredicateBase () | |
Creates instance. More... | |
virtual | ~ArbitraryPredicateBase () |
Destructor. More... | |
virtual bool | operator() (T const &inst) const =0 |
Checks the instance of T against an arbitrary predicate. More... | |
This class builds the base for wrapping around nearly every possible predicates like functors, classes with operator() and so on.
It is especially useful to have an base class allowing predicate evaluation without knowing the exact predicate type. In multi-threaded environments, command queues are a common way to add/remove/replace items in a list. With this base class it is possible to provide predicates in such queues. The direct use of this class for std algorithms (find_if, remove_if, count_if, ... ) is not recommended as it simply is not needed.
the | type to evaluate the predicate for. Usually, this is the type of list elements. |
Definition at line 150 of file WPredicateHelper.h.
|
inline |
Creates instance.
Definition at line 156 of file WPredicateHelper.h.
|
inlinevirtual |
Destructor.
Definition at line 163 of file WPredicateHelper.h.
|
pure virtual |
Checks the instance of T against an arbitrary predicate.
inst | the value to check against a predicate |
Implemented in WPredicateHelper::ArbitraryPredicate< T, Predicate >.