SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
Output iterator necessary for providing a range-like interface in output file. More...
#include <seqan3/io/detail/out_file_iterator.hpp>
Public Types | |
Member types | |
The associated types are | |
using | value_type = void |
The value type (void). | |
using | reference = void |
The reference type (void). | |
using | const_reference = void |
The const reference type (void). | |
using | size_type = void |
The size type (void). | |
using | difference_type = std::ptrdiff_t |
A signed integer type, usually std::ptrdiff_t. | |
using | pointer = void * |
The pointer type. | |
using | iterator_category = std::output_iterator_tag |
Tag this class as an input access iterator. | |
Public Member Functions | |
Constructors, destructor and assignment. | |
constexpr | out_file_iterator ()=default |
Default constructor. | |
constexpr | out_file_iterator (out_file_iterator const &)=default |
Copy constructor. | |
constexpr out_file_iterator & | operator= (out_file_iterator const &)=default |
Copy construction via assignment. | |
constexpr | out_file_iterator (out_file_iterator &&)=default |
Move constructor. | |
constexpr out_file_iterator & | operator= (out_file_iterator &&)=default |
Move assignment. | |
~out_file_iterator ()=default | |
Use default deconstructor. | |
constexpr | out_file_iterator (file_type &_host) noexcept |
Construct with reference to host. | |
Iterator operations | |
out_file_iterator & | operator++ () |
This is a no-op, returns reference to self. | |
out_file_iterator | operator++ (int) |
This is a no-op, returns copy of self. In contrast to input iterators, the return type is required. | |
out_file_iterator & | operator* () noexcept |
Return reference to self. | |
template<typename arg_t > | |
out_file_iterator & | operator= (arg_t &&arg) |
Insert the given value into the file, via the file's push_back() member. | |
Private Attributes | |
file_type * | host {} |
Pointer to file host. | |
Comparison operators | |
This iterator never equals its sentinel. | |
constexpr bool | operator== (std::default_sentinel_t const &) const noexcept |
Checks whether *this is equal to the sentinel (always false). | |
constexpr bool | operator!= (std::default_sentinel_t const &) const noexcept |
Checks whether *this is not equal to the sentinel (always true). | |
constexpr friend bool | operator== (std::default_sentinel_t const &, out_file_iterator const &it) noexcept |
Checks whether it is equal to the sentinel. | |
constexpr friend bool | operator!= (std::default_sentinel_t const &, out_file_iterator const &it) noexcept |
Checks whether it is not equal to the sentinel. | |
Output iterator necessary for providing a range-like interface in output file.
file_type | The data structure on which the iterator operates, e.g. std::vector<int> . |
This iterator is a single-pass output iterator for output files. All associated types are void, dereferencing this iterator returns a reference to self so that you can use the assignment operator, both, on the iterator directly, and after dereferencing. The assignment operator performs the actual file-writing, it delegates to the file's push_back()
member functions. The argument given to push_back()
must meet the specific file's constraints and is not checked by the iterator.
The increment operations are no-ops (perform nothing) and comparisons against std::default_sentinel always return false (there is no end in an output file).
If any of these characteristics seem unusual to you, please refer to the standard library's documentation on output iterators.
This class template differs from std::back_insert_iterator only in that it performs no checks itself on the assigned values and that it allows comparisons against std::default_sentinel.
|
inline |
Insert the given value into the file, via the file's push_back()
member.
arg_t | The argument type (the file's push_back() will enforce certain constraints). |
[in] | arg | The argument to be inserted. |