ipcq 0.12.0
Loading...
Searching...
No Matches
ipcq::OutputIteratorAdapter< Iterator > Struct Template Reference

Adapts either LegacyOutputIterator or Iterator type (e.g. More...

#include <adapter.hpp>

Public Types

using ValueType = typename IteratorTraits<Iterator>::value_type
 

Public Member Functions

constexpr OutputIteratorAdapter (Iterator iter)
 
constexpr void operator() (ValueType const &value)
 Assigns value to *iterator and then increments the iterator.
 

Public Attributes

Iterator iterator
 

Detailed Description

template<class Iterator>
struct ipcq::OutputIteratorAdapter< Iterator >

Adapts either LegacyOutputIterator or Iterator type (e.g.

std::back_insert_iterator or std::iterator) to use in BasicReader::Read and BasicReader::Read.

Example that does in-place assignment:

std::vector<Topic> buffer(5);
reader.Read(ipcq::OutputIteratorAdapter(std::begin(buffer)), 5, 5s);
See also
ipcq::BackInserter for the variant that does insertion with Container::push_back.

Definition at line 52 of file adapter.hpp.

Member Typedef Documentation

◆ ValueType

template<class Iterator>
using ipcq::OutputIteratorAdapter< Iterator >::ValueType = typename IteratorTraits<Iterator>::value_type

Definition at line 53 of file adapter.hpp.

Constructor & Destructor Documentation

◆ OutputIteratorAdapter()

template<class Iterator>
ipcq::OutputIteratorAdapter< Iterator >::OutputIteratorAdapter ( Iterator iter)
inlineconstexpr

Definition at line 55 of file adapter.hpp.

Member Function Documentation

◆ operator()()

template<class Iterator>
void ipcq::OutputIteratorAdapter< Iterator >::operator() ( ValueType const & value)
inlineconstexpr

Assigns value to *iterator and then increments the iterator.

*iterator++ = value;

Definition at line 64 of file adapter.hpp.

Member Data Documentation

◆ iterator

template<class Iterator>
Iterator ipcq::OutputIteratorAdapter< Iterator >::iterator

Definition at line 67 of file adapter.hpp.


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