Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Kept_Filter< F > Class Template Reference

A filter that an algorithm object keeps: one given as an lvalue is used where it is, so that the caller sees what the algorithm does to it; one given as an rvalue is moved into the keeper, so that it lives as long as the object. More...

#include <tpl_graph.H>

Inheritance diagram for Aleph::Kept_Filter< F >:
[legend]
Collaboration diagram for Aleph::Kept_Filter< F >:
[legend]

Public Member Functions

 Kept_Filter (F &f) noexcept
 Use f where it is.
 
 Kept_Filter (F &&f) noexcept(std::is_nothrow_move_constructible_v< F >)
 Keep f, moved.
 
 Kept_Filter (const Kept_Filter &k) noexcept(std::is_nothrow_copy_constructible_v< F >)
 Copy a moved filter, or use the same lvalue.
 
 Kept_Filter (Kept_Filter &&k) noexcept(std::is_nothrow_move_constructible_v< F >)
 Move a moved filter, or use the same lvalue.
 
Kept_Filter & operator= (const Kept_Filter &)=delete
 
F & get () const noexcept
 The filter.
 
 operator F& () const noexcept
 The filter.
 

Private Attributes

std::optional< F > own
 
F * filter
 

Detailed Description

template<class F>
class Aleph::Kept_Filter< F >

A filter that an algorithm object keeps: one given as an lvalue is used where it is, so that the caller sees what the algorithm does to it; one given as an rvalue is moved into the keeper, so that it lives as long as the object.

A keeper converts to a reference to its filter. The copy of a keeper of a moved filter has a copy of it; that of a keeper of an lvalue uses the same lvalue.

Template Parameters
FType of the filter.

Definition at line 1248 of file tpl_graph.H.

Constructor & Destructor Documentation

◆ Kept_Filter() [1/4]

template<class F >
Aleph::Kept_Filter< F >::Kept_Filter ( F &  f)
inlinenoexcept

Use f where it is.

Definition at line 1255 of file tpl_graph.H.

◆ Kept_Filter() [2/4]

template<class F >
Aleph::Kept_Filter< F >::Kept_Filter ( F &&  f)
inlinenoexcept

Keep f, moved.

Definition at line 1258 of file tpl_graph.H.

◆ Kept_Filter() [3/4]

template<class F >
Aleph::Kept_Filter< F >::Kept_Filter ( const Kept_Filter< F > &  k)
inlinenoexcept

Copy a moved filter, or use the same lvalue.

Definition at line 1262 of file tpl_graph.H.

◆ Kept_Filter() [4/4]

template<class F >
Aleph::Kept_Filter< F >::Kept_Filter ( Kept_Filter< F > &&  k)
inlinenoexcept

Move a moved filter, or use the same lvalue.

Definition at line 1267 of file tpl_graph.H.

Member Function Documentation

◆ get()

template<class F >
F & Aleph::Kept_Filter< F >::get ( ) const
inlinenoexcept

The filter.

Definition at line 1274 of file tpl_graph.H.

References Aleph::Kept_Filter< F >::filter.

Referenced by TYPED_TEST().

◆ operator F&()

template<class F >
Aleph::Kept_Filter< F >::operator F& ( ) const
inlinenoexcept

The filter.

Definition at line 1277 of file tpl_graph.H.

◆ operator=()

template<class F >
Kept_Filter & Aleph::Kept_Filter< F >::operator= ( const Kept_Filter< F > &  )
delete

Member Data Documentation

◆ filter

template<class F >
F* Aleph::Kept_Filter< F >::filter
private

◆ own

template<class F >
std::optional<F> Aleph::Kept_Filter< F >::own
private

Definition at line 1250 of file tpl_graph.H.


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