OpenWalnut  1.4.0
Public Member Functions
WPredicateHelper::ArbitraryPredicateBase< T > Class Template Reference

This class builds the base for wrapping around nearly every possible predicates like functors, classes with operator() and so on. More...

#include <WPredicateHelper.h>

+ Inheritance diagram for WPredicateHelper::ArbitraryPredicateBase< T >:

List of all members.

Public Member Functions

 ArbitraryPredicateBase ()
 Creates instance.
virtual ~ArbitraryPredicateBase ()
 Destructor.
virtual bool operator() (T const &inst) const =0
 Checks the instance of T against an arbitrary predicate.

Detailed Description

template<typename T>
class WPredicateHelper::ArbitraryPredicateBase< T >

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.

Template Parameters:
thetype to evaluate the predicate for. Usually, this is the type of list elements.

Definition at line 150 of file WPredicateHelper.h.


Constructor & Destructor Documentation

template<typename T >
WPredicateHelper::ArbitraryPredicateBase< T >::ArbitraryPredicateBase ( ) [inline]

Creates instance.

Definition at line 156 of file WPredicateHelper.h.

template<typename T >
virtual WPredicateHelper::ArbitraryPredicateBase< T >::~ArbitraryPredicateBase ( ) [inline, virtual]

Destructor.

Definition at line 163 of file WPredicateHelper.h.


Member Function Documentation

template<typename T >
virtual bool WPredicateHelper::ArbitraryPredicateBase< T >::operator() ( T const &  inst) const [pure virtual]

Checks the instance of T against an arbitrary predicate.

Parameters:
instthe value to check against a predicate
Returns:
true if predicate evaluates to true

Implemented in WPredicateHelper::ArbitraryPredicate< T, Predicate >.


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