SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::select_types_with_ids< field_types, field_types_as_ids, selected_field_ids, field_no, return_types > Struct Template Reference

Exposes a subset of types as a seqan3::type_list selected based on their IDs. More...

#include <seqan3/io/detail/record.hpp>

+ Inheritance diagram for seqan3::detail::select_types_with_ids< field_types, field_types_as_ids, selected_field_ids, field_no, return_types >:

Public Types

using type = type_list< return_types... >
 The return type.
 

Related Symbols

(Note that these are not member symbols.)

template<typename field_types , typename field_types_as_ids , typename selected_field_ids , size_t field_no = 0, typename... return_types>
using select_types_with_ids_t = typename select_types_with_ids< field_types, field_types_as_ids, selected_field_ids, field_no, return_types... >::type
 Shortcut for seqan3::select_types_with_ids (transformation_trait shortcut).
 

Detailed Description

template<typename field_types, typename field_types_as_ids, typename selected_field_ids, size_t field_no = 0, typename... return_types>
struct seqan3::detail::select_types_with_ids< field_types, field_types_as_ids, selected_field_ids, field_no, return_types >

Exposes a subset of types as a seqan3::type_list selected based on their IDs.

Template Parameters
field_typesThe types of the fields available to the record in a seqan3::type_list.
field_types_as_idsA seqan3::fields type with seqan3::field IDs corresponding to field_types.
selected_field_idsA seqan3::fields type with the subset (and order) of the fields selected.
field_noThe field we are currently processing (defaults to 0).
return_typesThe type pack being aggregated (empty at start).

Given a list of types and corresponding IDs; and given a selection (and possibly different order) of IDs, return the types corresponding to that selection and in that order.

This transformation trait recurses over the selected_field_ids and retrieves the corresponding typenames from field_types via their identifer in field_types_as_ids. It recursively builds up return_types which it packs into a seqan3::type_list once the end of selected_field_ids is reached.

Example

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <string>
#include <vector>
int main()
{
using selected_types = seqan3::detail::select_types_with_ids_t<types, types_as_ids, selected_ids>;
// resolves to type_list<std::vector<phred42>, std::string>
static_assert(std::same_as<selected_types, seqan3::type_list<std::vector<seqan3::phred42>, std::string>>);
}
Provides auxiliary data structures and functions for seqan3::record and seqan3::fields.
Provides seqan3::dna4, container aliases and string literals.
Provides seqan3::phred42 quality scores.
A class template that holds a choice of seqan3::field.
Definition record.hpp:125
Type that contains multiple types.
Definition type_list.hpp:26
Provides seqan3::type_list.

The documentation for this struct was generated from the following file:
Hide me