SeqAn3 3.1.0
The Modern C++ library for sequence analysis.
seqan3::concatenated_sequences< inner_type, data_delimiters_type > Class Template Reference

Container that stores sequences concatenated internally. More...

#include <seqan3/alphabet/container/concatenated_sequences.hpp>

+ Inheritance diagram for seqan3::concatenated_sequences< inner_type, data_delimiters_type >:

Public Types

Member types
using value_type = std::decay_t< inner_type >
 == inner_type. More...
 
using reference = detail::concatenated_sequences_reference_proxy< value_type, false >
 A proxy of type views::slice that represents the range on the concatenated vector. More...
 
using const_reference = detail::concatenated_sequences_reference_proxy< value_type, true >
 An immutable proxy of type views::slice that represents the range on the concatenated vector. More...
 
using iterator = detail::random_access_iterator< concatenated_sequences >
 The iterator type of this container (a random access iterator). More...
 
using const_iterator = detail::random_access_iterator< concatenated_sequences const >
 The const iterator type of this container (a random access iterator). More...
 
using difference_type = std::ranges::range_difference_t< data_delimiters_type >
 A signed integer type (usually std::ptrdiff_t) More...
 
using size_type = std::ranges::range_size_t< data_delimiters_type >
 An unsigned integer type (usually std::size_t) More...
 

Public Member Functions

Constructors, destructor and assignment
 concatenated_sequences ()=default
 Default constructors.
 
constexpr concatenated_sequences (concatenated_sequences const &)=default
 Default constructors.
 
constexpr concatenated_sequences (concatenated_sequences &&)=default
 Default constructors.
 
constexpr concatenated_sequencesoperator= (concatenated_sequences const &)=default
 Default constructors.
 
constexpr concatenated_sequencesoperator= (concatenated_sequences &&)=default
 Default constructors.
 
 ~concatenated_sequences ()=default
 Default constructors.
 
template<std::ranges::input_range rng_of_rng_type>
 concatenated_sequences (rng_of_rng_type &&rng_of_rng)
 Construct/assign from a different range. More...
 
template<std::ranges::forward_range rng_type>
 concatenated_sequences (size_type const count, rng_type &&value)
 Construct/assign with count times value. More...
 
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
 concatenated_sequences (begin_iterator_type begin_it, end_iterator_type end_it)
 Construct/assign from pair of iterators. More...
 
template<std::ranges::forward_range value_type_t = value_type>
 concatenated_sequences (std::initializer_list< value_type_t > ilist)
 Construct/assign from std::initializer_list. More...
 
template<std::ranges::forward_range value_type_t>
concatenated_sequencesoperator= (std::initializer_list< value_type_t > ilist)
 Construct/assign from std::initializer_list. More...
 
template<std::ranges::input_range rng_of_rng_type>
void assign (rng_of_rng_type &&rng_of_rng)
 Construct/assign from a different range. More...
 
template<std::ranges::forward_range rng_type>
void assign (size_type const count, rng_type &&value)
 Construct/assign with count times value. More...
 
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
void assign (begin_iterator_type begin_it, end_iterator_type end_it)
 Construct/assign from pair of iterators. More...
 
template<std::ranges::forward_range rng_type = value_type>
void assign (std::initializer_list< rng_type > ilist)
 Construct/assign from std::initializer_list. More...
 
Iterators
iterator begin () noexcept
 Returns an iterator to the first element of the container. More...
 
const_iterator begin () const noexcept
 Returns an iterator to the first element of the container. More...
 
const_iterator cbegin () const noexcept
 Returns an iterator to the first element of the container. More...
 
iterator end () noexcept
 Returns an iterator to the element following the last element of the container. More...
 
const_iterator end () const noexcept
 Returns an iterator to the element following the last element of the container. More...
 
const_iterator cend () const noexcept
 Returns an iterator to the element following the last element of the container. More...
 
Element access
reference at (size_type const i)
 Return the i-th element as a view. More...
 
const_reference at (size_type const i) const
 Return the i-th element as a view. More...
 
reference operator[] (size_type const i)
 Return the i-th element as a view. More...
 
const_reference operator[] (size_type const i) const
 Return the i-th element as a view. More...
 
reference front ()
 Return the first element as a view. Calling front on an empty container is undefined. More...
 
const_reference front () const
 Return the first element as a view. Calling front on an empty container is undefined. More...
 
reference back ()
 Return the last element as a view. More...
 
const_reference back () const
 Return the last element as a view. More...
 
reference concat ()
 Return the concatenation of all members. More...
 
const_reference concat () const
 Return the concatenation of all members. More...
 
std::pair< decltype(data_values) &, decltype(data_delimiters) & > raw_data ()
 Provides direct, unsafe access to underlying data structures. More...
 
std::pair< decltype(data_values) const &, decltype(data_delimiters) const & > raw_data () const
 Provides direct, unsafe access to underlying data structures. More...
 
Capacity
bool empty () const noexcept
 Checks whether the container is empty. More...
 
size_type size () const noexcept
 Returns the number of elements in the container, i.e. std::distance(begin(), end()). More...
 
size_type max_size () const noexcept
 Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container. More...
 
size_type capacity () const noexcept
 Returns the number of elements that the container has currently allocated space for. More...
 
void reserve (size_type const new_cap)
 Increase the capacity to a value that's greater or equal to new_cap. More...
 
void shrink_to_fit ()
 Requests the removal of unused capacity. More...
 
Capacity (concat)
size_type concat_size () const noexcept
 Returns the cumulative size of all elements in the container. More...
 
size_type concat_capacity () const noexcept
 Returns the concatenated size the container has currently allocated space for. More...
 
void concat_reserve (size_type const new_cap)
 Increase the concat_capacity() to a value that's greater or equal to new_cap. More...
 
Modifiers
void clear () noexcept
 Removes all elements from the container. More...
 
template<std::ranges::forward_range rng_type>
iterator insert (const_iterator pos, rng_type &&value)
 Inserts value before position in the container. More...
 
template<std::ranges::forward_range rng_type>
iterator insert (const_iterator pos, size_type const count, rng_type &&value)
 Inserts count copies of value before position in the container. More...
 
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
iterator insert (const_iterator pos, begin_iterator_type first, end_iterator_type last)
 Inserts elements from range [first, last) before position in the container. More...
 
template<std::ranges::forward_range rng_type>
iterator insert (const_iterator pos, std::initializer_list< rng_type > const &ilist)
 Inserts elements from initializer list before position in the container. More...
 
iterator erase (const_iterator first, const_iterator last)
 Removes specified elements from the container. More...
 
iterator erase (const_iterator pos)
 Removes specified elements from the container. More...
 
template<std::ranges::forward_range rng_type>
void push_back (rng_type &&value)
 Appends the given element value to the end of the container. More...
 
void pop_back ()
 Removes the last element of the container. More...
 
void resize (size_type const count)
 Resizes the container to contain count elements. More...
 
template<std::ranges::forward_range rng_type>
void resize (size_type const count, rng_type &&value)
 Resizes the container to contain count elements. More...
 
constexpr void swap (concatenated_sequences &rhs) noexcept
 Swap contents with another instance. More...
 
constexpr void swap (concatenated_sequences &&rhs) noexcept
 Swap contents with another instance. More...
 
Comparison operators
constexpr bool operator== (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is equal to rhs. More...
 
constexpr bool operator!= (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is not equal to rhs. More...
 
constexpr bool operator< (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is less than rhs. More...
 
constexpr bool operator> (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is greater than rhs. More...
 
constexpr bool operator<= (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is less than or equal to rhs. More...
 
constexpr bool operator>= (concatenated_sequences const &rhs) const noexcept
 Checks whether *this is greater than or equal to rhs. More...
 

Static Protected Attributes

Compatibility

Static constexpr variables that emulate whether the ranges are compatible (which doesn't work for types during their definition).

template<std::ranges::range t>
static constexpr bool is_compatible_with_value_type
 Whether a type is compatible with this class's value_type or reference type. More...
 
template<typename t >
static constexpr bool iter_value_t_is_compatible_with_value_type
 Whether a type is compatible with this class. More...
 
template<std::ranges::range t>
static constexpr bool range_value_t_is_compatible_with_value_type
 Whether a type is compatible with this class. More...
 

Detailed Description

template<typename inner_type, typename data_delimiters_type = std::vector<typename inner_type::size_type>>
class seqan3::concatenated_sequences< inner_type, data_delimiters_type >

Container that stores sequences concatenated internally.

Template Parameters
inner_typeThe type of sequences that will be stored. Must satisfy seqan3::reservible_container.
data_delimiters_typeA container that stores the begin/end positions in the inner_type. Must be seqan3::reservible_container and have inner_type's size_type as value_type.

This class may be used whenever you would usually use std::vector<std::vector<some_alphabet>> or std::vector<std::string>, i.e. whenever you have a collection of sequences. It is the spiritual successor of the StringSet<TString, Owner<ConcatDirect>> from SeqAn2.

It saves all of the member sequences inside one concatenated sequence internally. If you access an element, you instead get a view on the internal string as a proxy. This has the following advantages:

  • Better cache locality when parsing the sequences linearly (and often also on random access).
  • Constant time access to the concatenation of the sequences via concat().
  • This access is also writable so that certain transformations can be done globally, instead of element-wise.
  • Also direct access to the delimiters via raw_data() [this is used by some algorithms].

The disadvantages are:

  • Slower inserts and erases because the entire concatenation might have to be copied.
  • No emplace operations.
  • Modifying elements is limited to operations on elements of that element, i.e. you can change a character, but you can't assign a new member sequence to an existing position.

Example

#include <vector>
int main()
{
using namespace seqan3::literals;
seqan3::concatenated_sequences<seqan3::dna4_vector> concat1{"ACGT"_dna4, "GAGGA"_dna4};
seqan3::debug_stream << concat1[0] << '\n'; // "ACGT"
std::vector<seqan3::dna4_vector> concat2{"ACTA"_dna4, "AGGA"_dna4};
concat1 = concat2; // you can assign from other ranges
concat2[0] = "ATTA"_dna4; // this works for vector of vector
concat1[0][1] = 'T'_dna4; // and this works for concatenated_sequences
seqan3::debug_stream << concat1[0] << '\n'; // "ATTA"
// if you know that you will be adding ten vectors of length ten:
std::vector<seqan3::dna4> vector_of_length10{"ACGTACGTAC"_dna4};
concat1.reserve(10);
concat1.concat_reserve(10 * vector_of_length10.size());
while (concat1.size() < 10)
{
// ...
concat1.push_back(vector_of_length10);
}
}
Container that stores sequences concatenated internally.
Definition: concatenated_sequences.hpp:189
Provides seqan3::concatenated_sequences.
Provides seqan3::debug_stream and related types.
Provides seqan3::dna4, container aliases and string literals.
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition: debug_stream.hpp:37
The SeqAn namespace for literals.
T reserve(T... args)

Exceptions

Whenever a strong exception guarantee is given for this class, it presumes that std::is_nothrow_move_constructible<typename inner_type::value_type> otherwise only basic exception safety can be assumed.

Thread safety

This container provides no thread-safety beyond the promise given also by the STL that all calls to const member function are safe from multiple threads (as long as no thread calls a non-const member function at the same time).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

Member Typedef Documentation

◆ const_iterator

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
using seqan3::concatenated_sequences< inner_type, data_delimiters_type >::const_iterator = detail::random_access_iterator<concatenated_sequences const>

The const iterator type of this container (a random access iterator).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ const_reference

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
using seqan3::concatenated_sequences< inner_type, data_delimiters_type >::const_reference = detail::concatenated_sequences_reference_proxy<value_type, true>

An immutable proxy of type views::slice that represents the range on the concatenated vector.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ difference_type

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
using seqan3::concatenated_sequences< inner_type, data_delimiters_type >::difference_type = std::ranges::range_difference_t<data_delimiters_type>

A signed integer type (usually std::ptrdiff_t)

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ iterator

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
using seqan3::concatenated_sequences< inner_type, data_delimiters_type >::iterator = detail::random_access_iterator<concatenated_sequences>

The iterator type of this container (a random access iterator).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ reference

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
using seqan3::concatenated_sequences< inner_type, data_delimiters_type >::reference = detail::concatenated_sequences_reference_proxy<value_type, false>

A proxy of type views::slice that represents the range on the concatenated vector.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ size_type

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
using seqan3::concatenated_sequences< inner_type, data_delimiters_type >::size_type = std::ranges::range_size_t<data_delimiters_type>

An unsigned integer type (usually std::size_t)

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ value_type

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
using seqan3::concatenated_sequences< inner_type, data_delimiters_type >::value_type = std::decay_t<inner_type>

== inner_type.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

Constructor & Destructor Documentation

◆ concatenated_sequences() [1/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::input_range rng_of_rng_type>
seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concatenated_sequences ( rng_of_rng_type &&  rng_of_rng)
inline

Construct/assign from a different range.

Template Parameters
rng_of_rng_typeThe type of range to be inserted; must satisfy range_value_t_is_compatible_with_value_type.
Parameters
rng_of_rngThe sequences to construct/assign from.

Complexity

Linear in the cumulative size of rng_of_rng.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ concatenated_sequences() [2/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range rng_type>
seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concatenated_sequences ( size_type const  count,
rng_type &&  value 
)
inline

Construct/assign with count times value.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
countNumber of elements.
valueThe initial value to be assigned.

Complexity

In $O(count*value)$.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ concatenated_sequences() [3/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concatenated_sequences ( begin_iterator_type  begin_it,
end_iterator_type  end_it 
)
inline

Construct/assign from pair of iterators.

Template Parameters
begin_iterator_typeMust satisfy std::forward_iterator and must satisfy iter_value_t_is_compatible_with_value_type.
end_iterator_typeMust satisfy std::sized_sentinel_for.
Parameters
begin_itbegin of range to construct/assign from.
end_itend of range to construct/assign from.

Complexity

Linear in the cumulative size of the ranges between begin_it and end_it.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ concatenated_sequences() [4/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range value_type_t = value_type>
seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concatenated_sequences ( std::initializer_list< value_type_t >  ilist)
inline

Construct/assign from std::initializer_list.

Template Parameters
value_type_tThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
ilista std::initializer_list of value_type_t.

Complexity

Linear in the cumulative size of the ranges in ilist.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

Member Function Documentation

◆ assign() [1/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::assign ( begin_iterator_type  begin_it,
end_iterator_type  end_it 
)
inline

Construct/assign from pair of iterators.

Template Parameters
begin_iterator_typeMust satisfy std::forward_iterator and satisfy iter_value_t_is_compatible_with_value_type.
end_iterator_typeMust satisfy std::sized_sentinel_for.
Parameters
begin_itbegin of range to construct/assign from.
end_itend of range to construct/assign from.

Complexity

Linear in the cumulative size of the ranges between begin_it and end_it.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ assign() [2/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::input_range rng_of_rng_type>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::assign ( rng_of_rng_type &&  rng_of_rng)
inline

Construct/assign from a different range.

Template Parameters
rng_of_rng_typeThe type of range to be inserted; must satisfy range_value_t_is_compatible_with_value_type.
Parameters
rng_of_rngThe sequences to construct/assign from.

Complexity

Linear in the cumulative size of rng_of_rng.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ assign() [3/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range rng_type>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::assign ( size_type const  count,
rng_type &&  value 
)
inline

Construct/assign with count times value.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
countNumber of elements.
valueThe initial value to be assigned.

Complexity

In $O(count*value)$.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ assign() [4/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range rng_type = value_type>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::assign ( std::initializer_list< rng_type >  ilist)
inline

Construct/assign from std::initializer_list.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
ilista std::initializer_list of rng_type.

Complexity

Linear in the cumulative size of the elements in ilist.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ at() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::at ( size_type const  i)
inline

Return the i-th element as a view.

Parameters
iThe element to retrieve.
Exceptions
std::out_of_rangeIf you access an element behind the last.
Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ at() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::at ( size_type const  i) const
inline

Return the i-th element as a view.

Parameters
iThe element to retrieve.
Exceptions
std::out_of_rangeIf you access an element behind the last.
Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ back() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::back ( )
inline

Return the last element as a view.

Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Calling back on an empty container is undefined. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ back() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::back ( ) const
inline

Return the last element as a view.

Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Calling back on an empty container is undefined. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ begin() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::begin ( ) const
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ begin() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::begin ( )
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ capacity()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
size_type seqan3::concatenated_sequences< inner_type, data_delimiters_type >::capacity ( ) const
inlinenoexcept

Returns the number of elements that the container has currently allocated space for.

Returns
The capacity of the currently allocated storage.
Attention

This does not operate on underlying concat container, see concat_capacity().

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ cbegin()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::cbegin ( ) const
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to end().

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ cend()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::cend ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the container.

Returns
Iterator to the first element.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ clear()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::clear ( )
inlinenoexcept

Removes all elements from the container.

Returns
The number of elements in the container.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ concat() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concat ( )
inline

Return the concatenation of all members.

Returns
A std::ranges::view proxy on the concatenation of underlying sequences.

This is a safe way of accessing the internal concatenated representation, i.e. you cannot do operations that would invalidate this container (like insert or resize), but you can write to the individual positions.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ concat() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concat ( ) const
inline

Return the concatenation of all members.

Returns
A std::ranges::view proxy on the concatenation of underlying sequences.

This is a safe way of accessing the internal concatenated representation, i.e. you cannot do operations that would invalidate this container (like insert or resize), but you can write to the individual positions.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ concat_capacity()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
size_type seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concat_capacity ( ) const
inlinenoexcept

Returns the concatenated size the container has currently allocated space for.

Returns
The capacity of the currently allocated storage.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ concat_reserve()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concat_reserve ( size_type const  new_cap)
inline

Increase the concat_capacity() to a value that's greater or equal to new_cap.

Parameters
new_capThe new capacity.
Exceptions
std::length_errorIf new_cap > max_size().
std::exceptionAny exception thrown by Allocator::allocate() (typically std::bad_alloc).

Increase the capacity of the underlying concatenated sequence to a value that's greater or equal to new_cap. If new_cap is greater than the current concat_capacity(), new storage is allocated, otherwise the method does nothing. If new_cap is greater than concat_capacity(), all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise, no iterators or references are invalidated.

Complexity

At most linear in the concat_size() of the container.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ concat_size()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
size_type seqan3::concatenated_sequences< inner_type, data_delimiters_type >::concat_size ( ) const
inlinenoexcept

Returns the cumulative size of all elements in the container.

Returns
The cumulative size of elements in the container.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ empty()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::empty ( ) const
inlinenoexcept

Checks whether the container is empty.

Returns
true if the container is empty, false otherwise.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ end() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::end ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the container.

Returns
Iterator to the first element.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ end() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::end ( )
inlinenoexcept

Returns an iterator to the element following the last element of the container.

Returns
Iterator to the first element.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ erase() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::erase ( const_iterator  first,
const_iterator  last 
)
inline

Removes specified elements from the container.

Parameters
firstBegin of range to erase.
lastBehind the end of range to erase.
Returns
Iterator pointing to the first element inserted, or pos if first==last.

Invalidates iterators and references at or after the point of the erase, including the end() iterator.

The iterator first does not need to be dereferenceable if first==last: erasing an empty range is a no-op.

Complexity

Linear in concat_size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ erase() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::erase ( const_iterator  pos)
inline

Removes specified elements from the container.

Parameters
posRemove the element at pos.
Returns
Iterator pointing to the first element inserted, or pos if first==last.

Invalidates iterators and references at or after the point of the erase, including the end() iterator.

The iterator pos must be valid and dereferenceable. Thus the end() iterator (which is valid, but is not dereferencable) cannot be used as a value for pos.

Complexity

Linear in concat_size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ front() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::front ( )
inline

Return the first element as a view. Calling front on an empty container is undefined.

Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Calling front on an empty container is undefined. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ front() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::front ( ) const
inline

Return the first element as a view. Calling front on an empty container is undefined.

Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Calling front on an empty container is undefined. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ insert() [1/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::forward_iterator begin_iterator_type, typename end_iterator_type >
iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::insert ( const_iterator  pos,
begin_iterator_type  first,
end_iterator_type  last 
)
inline

Inserts elements from range [first, last) before position in the container.

Template Parameters
begin_iterator_typeMust satisfy std::forward_iterator and iter_value_t_is_compatible_with_value_type.
end_iterator_typeMust satisfy std::sized_sentinel_for.
Parameters
posIterator before which the content will be inserted. pos may be the end() iterator.
firstBegin of range to insert.
lastBehind the end of range to insert.
Returns
Iterator pointing to the first element inserted, or pos if first==last.

The behaviour is undefined if first and last are iterators into *this.

Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.

Complexity

Worst-case linear in concat_size(). This is a drawback over e.g. std::vector<std::vector<alphabet>>.

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ insert() [2/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range rng_type>
iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::insert ( const_iterator  pos,
rng_type &&  value 
)
inline

Inserts value before position in the container.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy std::ranges::forward_range and have the same value_type as value_type (i.e. value_type's value_type!).
Parameters
posIterator before which the content will be inserted. pos may be the end() iterator.
valueElement value to insert.
Returns
Iterator pointing to the inserted value.

Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.

Complexity

Worst-case linear in concat_size(). This is a drawback over e.g. std::vector<std::vector<alphabet>>.

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

Example

int main()
{
using namespace seqan3::literals;
foobar.insert(foobar.end(), "ACGT"_dna4);
seqan3::debug_stream << foobar[0] << '\n'; // "ACGT"
}
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: concatenated_sequences.hpp:616
iterator insert(const_iterator pos, rng_type &&value)
Inserts value before position in the container.
Definition: concatenated_sequences.hpp:1050

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ insert() [3/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range rng_type>
iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::insert ( const_iterator  pos,
size_type const  count,
rng_type &&  value 
)
inline

Inserts count copies of value before position in the container.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
posIterator before which the content will be inserted. pos may be the end() iterator.
countNumber of copies.
valueElement value to insert.
Returns
Iterator pointing to the first element inserted, or pos if count==0.

Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.

Complexity

Worst-case linear in concat_size(). This is a drawback over e.g. std::vector<std::vector<alphabet>>.

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

Example

int main()
{
using namespace seqan3::literals;
foobar.insert(foobar.end(), 2, "ACGT"_dna4);
seqan3::debug_stream << foobar[0] << '\n'; // "ACGT"
seqan3::debug_stream << foobar[1] << '\n'; // "ACGT"
}

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ insert() [4/4]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range rng_type>
iterator seqan3::concatenated_sequences< inner_type, data_delimiters_type >::insert ( const_iterator  pos,
std::initializer_list< rng_type > const &  ilist 
)
inline

Inserts elements from initializer list before position in the container.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
posIterator before which the content will be inserted. pos may be the end() iterator.
ilistInitializer list with values to insert.
Returns
Iterator pointing to the first element inserted, or pos if ilist is empty.

Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.

Complexity

Worst-case linear in concat_size(). This is a drawback over e.g. std::vector<std::vector<alphabet>>.

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ max_size()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
size_type seqan3::concatenated_sequences< inner_type, data_delimiters_type >::max_size ( ) const
inlinenoexcept

Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container.

Returns
The number of elements in the container.

This value typically reflects the theoretical limit on the size of the container. At runtime, the size of the container may be limited to a value smaller than max_size() by the amount of RAM available.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator!=()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator!= ( concatenated_sequences< inner_type, data_delimiters_type > const &  rhs) const
inlineconstexprnoexcept

Checks whether *this is not equal to rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator<()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator< ( concatenated_sequences< inner_type, data_delimiters_type > const &  rhs) const
inlineconstexprnoexcept

Checks whether *this is less than rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator<=()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator<= ( concatenated_sequences< inner_type, data_delimiters_type > const &  rhs) const
inlineconstexprnoexcept

Checks whether *this is less than or equal to rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator=()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range value_type_t>
concatenated_sequences & seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator= ( std::initializer_list< value_type_t >  ilist)
inline

Construct/assign from std::initializer_list.

Template Parameters
value_type_tThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
ilista std::initializer_list of value_type_t.

Complexity

Linear in the cumulative size of the elements in ilist.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator==()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator== ( concatenated_sequences< inner_type, data_delimiters_type > const &  rhs) const
inlineconstexprnoexcept

Checks whether *this is equal to rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator>()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator> ( concatenated_sequences< inner_type, data_delimiters_type > const &  rhs) const
inlineconstexprnoexcept

Checks whether *this is greater than rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator>=()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator>= ( concatenated_sequences< inner_type, data_delimiters_type > const &  rhs) const
inlineconstexprnoexcept

Checks whether *this is greater than or equal to rhs.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator[]() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator[] ( size_type const  i)
inline

Return the i-th element as a view.

Parameters
iThe element to retrieve.
Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Accessing an element behind the last causes undefined behaviour. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ operator[]() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
const_reference seqan3::concatenated_sequences< inner_type, data_delimiters_type >::operator[] ( size_type const  i) const
inline

Return the i-th element as a view.

Parameters
iThe element to retrieve.
Returns
A std::ranges::view on the underlying concatenated sequences that acts as a proxy for the element.

Accessing an element behind the last causes undefined behaviour. In debug mode an assertion checks the size of the container.

Complexity

Constant.

Exceptions

Strong exception guarantee (never modifies data).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ pop_back()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::pop_back ( )
inline

Removes the last element of the container.

Calling pop_back on an empty container is undefined. In debug mode an assertion will be thrown.

No iterators or references except for back() and end() are invalidated.

Complexity

Constant.

Exceptions

No exception is thrown in release mode.

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ push_back()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range rng_type>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::push_back ( rng_type &&  value)
inline

Appends the given element value to the end of the container.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
valueThe value to append.

If the new size() is greater than capacity() then all iterators and references (including the past-the-end iterator) are invalidated. Otherwise only the past-the-end iterator is invalidated.

Complexity

Amortised linear in the size of value. Wort-case linear in concat_size().

Exceptions

Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ raw_data() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
std::pair< decltype(data_values) &, decltype(data_delimiters) & > seqan3::concatenated_sequences< inner_type, data_delimiters_type >::raw_data ( )
inline

Provides direct, unsafe access to underlying data structures.

Returns
A std::pair of the concatenated sequences and the delimiter string.

This entity is not part of the SeqAn API. Do not rely on it in your applications. The exact representation of the data is implementation defined.

◆ raw_data() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
std::pair< decltype(data_values) const &, decltype(data_delimiters) const & > seqan3::concatenated_sequences< inner_type, data_delimiters_type >::raw_data ( ) const
inline

Provides direct, unsafe access to underlying data structures.

Returns
A std::pair of the concatenated sequences and the delimiter string.

This entity is not part of the SeqAn API. Do not rely on it in your applications. The exact representation of the data is implementation defined.

◆ reserve()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::reserve ( size_type const  new_cap)
inline

Increase the capacity to a value that's greater or equal to new_cap.

Parameters
new_capThe new capacity.
Exceptions
std::length_errorIf new_cap > max_size().
std::exceptionAny exception thrown by Allocator::allocate() (typically std::bad_alloc).

Increase the capacity of the vector to a value that's greater or equal to new_cap. If new_cap is greater than the current capacity(), new storage is allocated, otherwise the method does nothing. If new_cap is greater than capacity(), all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise, no iterators or references are invalidated.

Attention
This does not operate on underlying concat container, see concat_reserve().

Complexity

At most linear in the size() of the container.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ resize() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::resize ( size_type const  count)
inline

Resizes the container to contain count elements.

Parameters
countThe new size.
Exceptions
std::length_errorIf count > max_size().
std::exceptionAny exception thrown by Allocator::allocate() (typically std::bad_alloc).

Increase the size() of the vector to count.

If the current capacity() is smaller than count, new storage is allocated and all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise only the past-the-end iterator is invalidated.

If the current size is greater than count, the container is reduced to its first count elements. Capacity is never reduced when resizing to smaller size because that would invalidate all iterators, rather than only the ones that would be invalidated by the equivalent sequence of pop_back() calls.

Complexity

At most linear in the size() of the container.

Exceptions

Only new size: Strong exception guarantee (no data is modified in case an exception is thrown). [only new size]

New default value: Basic exception guarantee, i.e. guaranteed not to leak, but container my contain bogus data after exceptions is thrown.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ resize() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::forward_range rng_type>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::resize ( size_type const  count,
rng_type &&  value 
)
inline

Resizes the container to contain count elements.

Template Parameters
rng_typeThe type of range to be inserted; must satisfy is_compatible_with_value_type.
Parameters
valueInstead of appending empty containers, append copies of value.
countThe new size.
Exceptions
std::length_errorIf count > max_size().
std::exceptionAny exception thrown by Allocator::allocate() (typically std::bad_alloc).

Increase the size() of the vector to count.

If the current capacity() is smaller than count, new storage is allocated and all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise only the past-the-end iterator is invalidated.

If the current size is greater than count, the container is reduced to its first count elements. Capacity is never reduced when resizing to smaller size because that would invalidate all iterators, rather than only the ones that would be invalidated by the equivalent sequence of pop_back() calls.

Complexity

At most linear in the size() of the container.

Exceptions

Only new size: Strong exception guarantee (no data is modified in case an exception is thrown). [only new size]

New default value: Basic exception guarantee, i.e. guaranteed not to leak, but container my contain bogus data after exceptions is thrown.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ shrink_to_fit()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::shrink_to_fit ( )
inline

Requests the removal of unused capacity.

It is a non-binding request to reduce capacity() to size() and concat_capacity() to concat_size(). It depends on the implementation if the request is fulfilled. If reallocation occurs, all iterators, including the past the end iterator, and all references to the elements are invalidated. If no reallocation takes place, no iterators or references are invalidated.

Attention
This affects both underlying data structures.

Complexity

At most linear in the size() of the container.

Exceptions

Strong exception guarantee (no data is modified in case an exception is thrown).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ size()

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
size_type seqan3::concatenated_sequences< inner_type, data_delimiters_type >::size ( ) const
inlinenoexcept

Returns the number of elements in the container, i.e. std::distance(begin(), end()).

Returns
The number of elements in the container.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ swap() [1/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
constexpr void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::swap ( concatenated_sequences< inner_type, data_delimiters_type > &&  rhs)
inlineconstexprnoexcept

Swap contents with another instance.

Parameters
rhsThe other instance to swap with.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

◆ swap() [2/2]

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
constexpr void seqan3::concatenated_sequences< inner_type, data_delimiters_type >::swap ( concatenated_sequences< inner_type, data_delimiters_type > &  rhs)
inlineconstexprnoexcept

Swap contents with another instance.

Parameters
rhsThe other instance to swap with.

Complexity

Constant.

Exceptions

No-throw guarantee.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

Member Data Documentation

◆ is_compatible_with_value_type

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::range t>
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::is_compatible_with_value_type
staticconstexprprotected

Whether a type is compatible with this class's value_type or reference type.

This entity is not part of the SeqAn API. Do not rely on it in your applications. Exposition only.

◆ iter_value_t_is_compatible_with_value_type

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<typename t >
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::iter_value_t_is_compatible_with_value_type
staticconstexprprotected

Whether a type is compatible with this class.

This entity is not part of the SeqAn API. Do not rely on it in your applications. Exposition only.

◆ range_value_t_is_compatible_with_value_type

template<typename inner_type , typename data_delimiters_type = std::vector<typename inner_type::size_type>>
template<std::ranges::range t>
constexpr bool seqan3::concatenated_sequences< inner_type, data_delimiters_type >::range_value_t_is_compatible_with_value_type
staticconstexprprotected

Whether a type is compatible with this class.

This entity is not part of the SeqAn API. Do not rely on it in your applications. Exposition only.


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