Raptor 3.0.1
A fast and space-efficient pre-filter for querying very large collections of nucleotide sequences
 
Loading...
Searching...
No Matches
emplace_iterator.hpp
Go to the documentation of this file.
1// --------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2023, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2023, Knut Reinert & MPI für molekulare Genetik
4// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5// shipped with this file and also available at: https://github.com/seqan/raptor/blob/main/LICENSE.md
6// --------------------------------------------------------------------------------------------------
7
13#pragma once
14
15#include <seqan3/search/dream_index/interleaved_bloom_filter.hpp>
16
17namespace raptor
18{
19
20template <typename container_t>
22{
23public:
25 using value_type = void;
26 using difference_type = ptrdiff_t;
27 using pointer = void;
28 using reference = void;
29
30 emplace_iterator() = delete;
31 emplace_iterator(emplace_iterator const &) = default;
33 emplace_iterator & operator=(emplace_iterator const &) = default;
34 emplace_iterator & operator=(emplace_iterator &&) = default;
35 ~emplace_iterator() = default;
36
37 explicit constexpr emplace_iterator(container_t & cont, seqan3::bin_index const idx) :
38 container{std::addressof(cont)},
39 index{std::move(idx)}
40 {}
41
42 constexpr emplace_iterator & operator=(uint64_t const value)
43 {
44 container->emplace(std::move(value), index);
45 return *this;
46 }
47
48 [[nodiscard]] constexpr emplace_iterator & operator*()
49 {
50 return *this;
51 }
52
53 constexpr emplace_iterator & operator++()
54 {
55 return *this;
56 }
57
58 constexpr emplace_iterator operator++(int)
59 {
60 return *this;
61 }
62
63private:
64 container_t * container{};
65 seqan3::bin_index index{};
66};
67
68template <typename container_t>
69[[nodiscard]] inline constexpr emplace_iterator<container_t> emplacer(container_t & cont, seqan3::bin_index const idx)
70{
71 return emplace_iterator<container_t>(cont, std::move(idx));
72}
73
74} // namespace raptor
T addressof(T... args)
Definition emplace_iterator.hpp:22