MarlinMT  0.1.0
marlinmt::book::Condition Class Reference

wrapper class for an Entry filter function. More...

#include <Condition.h>

Public Types

using FilterFn_t = std::function< bool(const EntryKey &) >
 

Public Member Functions

 Condition ()
 default constructor. More...
 
 ~Condition ()=default
 
 Condition (FilterFn_t filterFn)
 construct Condition from filter function. More...
 
Conditionoperator= (const FilterFn_t &filterFn)
 
 Condition (Condition &&)=default
 move constructor. More...
 
Conditionoperator= (Condition &&)=default
 
 Condition (const Condition &)=default
 copy constructor. More...
 
Conditionoperator= (const Condition &)=default
 
bool operator() (const EntryKey &key) const
 test Condition on key. More...
 
Condition operator & (const Condition &rhs) const
 creates a composed condition. More...
 
Condition operator| (const Condition &rhs) const
 creates a composed condition. More...
 
Condition operator! () const
 creates a condition More...
 

Private Attributes

FilterFn_t _fiterFn
 actually filter function. More...
 

Detailed Description

wrapper class for an Entry filter function.

Definition at line 21 of file Condition.h.

Member Typedef Documentation

◆ FilterFn_t

using marlinmt::book::Condition::FilterFn_t = std::function< bool( const EntryKey & ) >

Definition at line 24 of file Condition.h.

Constructor & Destructor Documentation

◆ Condition() [1/4]

marlinmt::book::Condition::Condition ( )

default constructor.

Definition at line 27 of file Condition.cc.

Referenced by marlinmt::book::ConditionBuilder::condition(), operator &(), operator!(), and operator|().

◆ ~Condition()

marlinmt::book::Condition::~Condition ( )
default

◆ Condition() [2/4]

marlinmt::book::Condition::Condition ( FilterFn_t  filterFn)
explicit

construct Condition from filter function.

Definition at line 32 of file Condition.cc.

◆ Condition() [3/4]

marlinmt::book::Condition::Condition ( Condition &&  )
default

move constructor.

◆ Condition() [4/4]

marlinmt::book::Condition::Condition ( const Condition )
default

copy constructor.

Member Function Documentation

◆ operator &()

Condition marlinmt::book::Condition::operator& ( const Condition rhs) const
inline

creates a composed condition.

Parameters
rhscondition to compose with.
Returns
condition which accepts a key when this and rhs are accepted this.

Definition at line 55 of file Condition.h.

References _fiterFn, and Condition().

◆ operator!()

Condition marlinmt::book::Condition::operator! ( ) const
inline

creates a condition

Returns
condition which accepts a key when this denied it.

Definition at line 78 of file Condition.h.

References _fiterFn, and Condition().

◆ operator()()

bool marlinmt::book::Condition::operator() ( const EntryKey key) const
inline

test Condition on key.

Returns
true if key matches the condition.

Definition at line 47 of file Condition.h.

References _fiterFn.

◆ operator=() [1/3]

Condition & marlinmt::book::Condition::operator= ( const FilterFn_t filterFn)

Definition at line 36 of file Condition.cc.

References _fiterFn.

◆ operator=() [2/3]

Condition& marlinmt::book::Condition::operator= ( Condition &&  )
default

◆ operator=() [3/3]

Condition& marlinmt::book::Condition::operator= ( const Condition )
default

◆ operator|()

Condition marlinmt::book::Condition::operator| ( const Condition rhs) const
inline

creates a composed condition.

Parameters
rhscondition to compose with.
Returns
condition which accepts a key when this or rhs are accepted this.

Definition at line 67 of file Condition.h.

References _fiterFn, and Condition().

Member Data Documentation

◆ _fiterFn

FilterFn_t marlinmt::book::Condition::_fiterFn
private

actually filter function.

Definition at line 86 of file Condition.h.

Referenced by operator &(), operator!(), operator()(), operator=(), and operator|().


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