Loading...
Searching...
No Matches
shape.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <seqan3/utility/container/dynamic_bitset.hpp>
namespace seqan3
{
struct ungapped
{
uint8_t value;
};
struct bin_literal
{
uint64_t value;
};
class shape : public dynamic_bitset<58>
{
public:
constexpr shape() noexcept = default;
constexpr shape(shape const &) noexcept = default;
constexpr shape(shape &&) noexcept = default;
constexpr shape & operator=(shape const &) noexcept = default;
constexpr shape & operator=(shape &&) noexcept = default;
~shape() noexcept = default;
constexpr shape(ungapped k) noexcept : dynamic_bitset<58>((1ULL << k.value) - 1)
{
assert(k.value > 0);
}
constexpr shape(bin_literal const literal) noexcept : dynamic_bitset<58>(literal.value)
{
assert(front() == 1); // First position must be 1, e.g. no 0111 shape
assert(back() == 1); // Last position must be 1, e.g. no 1110 shape
}
};
inline namespace literals
{
constexpr shape operator""_shape(unsigned long long const value)
{
return shape{bin_literal{value}};
}
} // namespace literals
} // namespace seqan3
seqan3::dynamic_bitset< 58 >::dynamic_bitset
friend class dynamic_bitset
Definition dynamic_bitset.hpp:57
seqan3::dynamic_bitset< 58 >::back
constexpr reference back() noexcept
Definition dynamic_bitset.hpp:1165
seqan3::dynamic_bitset< 58 >::front
constexpr reference front() noexcept
Definition dynamic_bitset.hpp:1135
seqan3::shape::shape
constexpr shape(bin_literal const literal) noexcept
Construct from a given seqan3::bin_literal.
Definition shape.hpp:102
seqan3::shape::shape
constexpr shape() noexcept=default
Defaulted.
dynamic_bitset.hpp
A constexpr bitset implementation with dynamic size at compile time.
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
seqan3::bin_literal
A strong type of underlying type uint64_t that represents the shape in binary representation.
Definition shape.hpp:31
seqan3::bin_literal::value
uint64_t value
The shape in binary representation.
Definition shape.hpp:33
seqan3::ungapped
A strong type of underlying type uint8_t that represents the ungapped shape size.
Definition shape.hpp:22
seqan3::ungapped::value
uint8_t value
The ungapped shape size.
Definition shape.hpp:24
Hide me