OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WPredicateHelper::Name< T > Class Template Reference

This class tests against the getName() method of the instances of type T. More...

#include <WPredicateHelper.h>

+ Collaboration diagram for WPredicateHelper::Name< T >:

Public Member Functions

 Name (std::string check)
 Creates instance. More...
 
bool operator() (const T &inst)
 Checks the instance of T against the string specified during construction. More...
 

Private Attributes

std::string m_check
 The string to check against. More...
 

Detailed Description

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

This class tests against the getName() method of the instances of type T.

Many, many, many many many classes in OpenWalnut provide a getName() method. This predicate can check against a defined name. Useful for searching.

Definition at line 70 of file WPredicateHelper.h.

Constructor & Destructor Documentation

◆ Name()

template<typename T >
WPredicateHelper::Name< T >::Name ( std::string  check)
inlineexplicit

Creates instance.

The specified string is used for checking.

Parameters
checkthe string to check against.

Definition at line 78 of file WPredicateHelper.h.

Member Function Documentation

◆ operator()()

template<typename T >
bool WPredicateHelper::Name< T >::operator() ( const T &  inst)
inline

Checks the instance of T against the string specified during construction.

Parameters
instuse getName of this instance of T
Returns
true if m_checked == inst.getName()

Definition at line 90 of file WPredicateHelper.h.

References WPredicateHelper::Name< T >::m_check.

Member Data Documentation

◆ m_check

template<typename T >
std::string WPredicateHelper::Name< T >::m_check
private

The string to check against.

Definition at line 99 of file WPredicateHelper.h.

Referenced by WPredicateHelper::Name< std::shared_ptr< T > >::operator()(), and WPredicateHelper::Name< T >::operator()().


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