SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
seqan3::detail::adaptor_for_view_without_args< view_type > Class Template Reference

Template for range adaptor closure objects that store no arguments and always delegate to the view constructor. More...

#include <seqan3/range/views/detail.hpp>

+ Inheritance diagram for seqan3::detail::adaptor_for_view_without_args< view_type >:

Public Member Functions

constexpr auto operator() (urng_t &&urange) &&
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr auto operator() (urng_t &&urange) const &
 Function-style overload for ranges.
 
Constructors, destructor and assignment
constexpr adaptor_for_view_without_args ()=default
 Defaulted.
 
constexpr adaptor_for_view_without_args (adaptor_for_view_without_args const &) noexcept=default
 Defaulted.
 
constexpr adaptor_for_view_without_args (adaptor_for_view_without_args &&) noexcept=default
 Defaulted.
 
constexpr adaptor_for_view_without_argsoperator= (adaptor_for_view_without_args const &) noexcept=default
 Defaulted.
 
constexpr adaptor_for_view_without_argsoperator= (adaptor_for_view_without_args &&) noexcept=default
 Defaulted.
 
 ~adaptor_for_view_without_args () noexcept=default
 Defaulted.
 

Private Types

using base_type = adaptor_base< adaptor_for_view_without_args< view_type > >
 Type of the CRTP-base.
 

Private Member Functions

constexpr auto pass_args_to_impl (urng_t &&urange, std::index_sequence< Is... > const &) &&
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr auto pass_args_to_impl (urng_t &&urange, std::index_sequence< Is... > const &) const &
 Helper function to unpack the tuple and delegate to the derived type.
 

Static Private Member Functions

template<typename ... arg_types>
static auto impl (arg_types &&... args)
 Call the view's constructor with the given arguments (all of the base class'es operators ultimately resolve to this function call). More...
 

Private Attributes

std::tuple< stored_args_ts... > arguments
 Stores the arguments.
 
friend base_type
 Befriend the base class so it can call impl().
 
friend derived_type
 Befriend the derived_type so it can access private members if need be.
 

Detailed Description

template<template< typename, typename ... > typename view_type>
class seqan3::detail::adaptor_for_view_without_args< view_type >

Template for range adaptor closure objects that store no arguments and always delegate to the view constructor.

Template Parameters
view_typeThe view type template.

Use this adaptor template when you always want to delegate to the view's constructor and you have no arguments. Since it's a one-line it's easier than specialising seqan3::detail::adaptor_base.

Example

(from include/seqan3/range/views/single_pass_input.hpp)

This is the signature of the view type template in namespace seqan3::detail:

template <std::ranges::view urng_t>
class single_pass_input_view : public std::ranges::view_interface<single_pass_input_view<urng_t>>
{

This is the definition of the range adaptor closure object, it will always delegate to the constructor: seqan3::detail::single_pass_input_view::single_pass_input_view():

namespace seqan3::views
{
inline constexpr auto single_pass_input = detail::adaptor_for_view_without_args<detail::single_pass_input_view>{};
} // namespace seqan3::views
constexpr auto single_pass_input
A view adapter that decays most of the range properties and adds single pass behavior.
Definition: single_pass_input.hpp:362
The SeqAn namespace for views.

Member Function Documentation

◆ impl()

template<template< typename, typename ... > typename view_type>
template<typename ... arg_types>
static auto seqan3::detail::adaptor_for_view_without_args< view_type >::impl ( arg_types &&...  args)
inlinestaticprivate

Call the view's constructor with the given arguments (all of the base class'es operators ultimately resolve to this function call).

Template Parameters
arg_typesThe arguments to the view (this first one will be a range, the rest is optional).
Parameters
[in]argsThe arguments to the constructor.
Returns
An instance of view_type.

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