LifeV
EntityFlagInterrogator< MeshEntity, ComparisonPolicy > Class Template Reference

A simple predicate to test the boolean flag on a mesh entity. More...

#include <MeshEntityContainer.hpp>

+ Collaboration diagram for EntityFlagInterrogator< MeshEntity, ComparisonPolicy >:

Public Types

typedef ComparisonPolicy comparisonPolicy_Type
 

Public Member Functions

 EntityFlagInterrogator (flag_Type flag, ComparisonPolicy const &p=ComparisonPolicy(&Flag::testOneSet))
 
bool operator() (const MeshEntity &entity) const
 

Private Attributes

const flag_Type M_flag
 
const ComparisonPolicy M_policy
 

Detailed Description

template<typename MeshEntity, typename ComparisonPolicy = std::function<bool (flag_Type, flag_Type)>>
class LifeV::Predicates::EntityFlagInterrogator< MeshEntity, ComparisonPolicy >

A simple predicate to test the boolean flag on a mesh entity.

MeshEntity must have a method flag_Type flag();

The ComparisonPolicy passed as (possible) second template parameter must be a functor capable of being constructed from a bool (*)(flag_Type const&, flag_Type const &) and so that bool operator()(flag_Type const&, flag_Type const &) is defined. By default it is a boost function and the class uses the testOneSet policy by default Usage: if you want a predicate that tests if a boolean flag is equal to a given flag MYFLAG you create a object of type

EntityFlagInterrogator<faceType> interrogator(MYFLAG,Flags::testAllSet)
interrogator(myFace); // true if flags of myface all all equal to MYFLAG
which can now be used on all std algorithms operating on containers of mesh entities
Author
Luca Formaggia

Definition at line 155 of file MeshEntityContainer.hpp.

Member Typedef Documentation

◆ comparisonPolicy_Type

typedef ComparisonPolicy comparisonPolicy_Type

Definition at line 158 of file MeshEntityContainer.hpp.

Constructor & Destructor Documentation

◆ EntityFlagInterrogator()

EntityFlagInterrogator ( flag_Type  flag,
ComparisonPolicy const &  p = ComparisonPolicy ( &Flag::testOneSet ) 
)
inline

Definition at line 160 of file MeshEntityContainer.hpp.

Member Function Documentation

◆ operator()()

bool operator() ( const MeshEntity entity) const
inline

Definition at line 164 of file MeshEntityContainer.hpp.

Field Documentation

◆ M_flag

const flag_Type M_flag
private

Definition at line 170 of file MeshEntityContainer.hpp.

◆ M_policy

const ComparisonPolicy M_policy
private

Definition at line 171 of file MeshEntityContainer.hpp.


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