Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
console::ChannelIterator< T, N > Class Template Reference

通道迭代器。 More...

#include <channel.h>

Public Types

using iterator_category = std::input_iterator_tag
 迭代器类别。
using value_type = T
 值类型。
using difference_type = std::ptrdiff_t
 差异类型。
using pointer = T *
 指针类型。
using reference = T &
 引用类型。

Public Member Functions

 ChannelIterator (Channel< T, N > &channel)
T & operator* ()
 解引用查询。
T * operator-> ()
 成员访问查询。
ChannelIterator & operator++ ()
 前置递增。
ChannelIterator operator++ (int)
 后置递增。
bool operator== (const ChannelIterator &) const
 比较相等。
bool operator!= (const ChannelIterator &) const
 比较不等。

Private Attributes

Channel< T, N > & channel_
 通道引用
T cache_
 缓存值

Detailed Description

template<class T, size_t N>
class console::ChannelIterator< T, N >

通道迭代器。

Note
不要怀疑,输入迭代器里就是这样的,我确保这就是正确的语义。

Member Typedef Documentation

◆ difference_type

template<class T, size_t N>
using console::ChannelIterator< T, N >::difference_type = std::ptrdiff_t

差异类型。

◆ iterator_category

template<class T, size_t N>
using console::ChannelIterator< T, N >::iterator_category = std::input_iterator_tag

迭代器类别。

◆ pointer

template<class T, size_t N>
using console::ChannelIterator< T, N >::pointer = T *

指针类型。

◆ reference

template<class T, size_t N>
using console::ChannelIterator< T, N >::reference = T &

引用类型。

◆ value_type

template<class T, size_t N>
using console::ChannelIterator< T, N >::value_type = T

值类型。

Constructor & Destructor Documentation

◆ ChannelIterator()

template<class T, size_t N>
console::ChannelIterator< T, N >::ChannelIterator ( Channel< T, N > & channel)
inlineexplicit

Member Function Documentation

◆ operator!=()

template<class T, size_t N>
bool console::ChannelIterator< T, N >::operator!= ( const ChannelIterator< T, N > & ) const
inline

比较不等。

Returns
是否不等。
Note
当通道关闭时,迭代器被视为不等。

◆ operator*()

template<class T, size_t N>
T & console::ChannelIterator< T, N >::operator* ( )
inline

解引用查询。

Returns
缓存值。

◆ operator++() [1/2]

template<class T, size_t N>
ChannelIterator & console::ChannelIterator< T, N >::operator++ ( )
inline

前置递增。

Returns
迭代器自身。
Note
No-OP,return *this。

◆ operator++() [2/2]

template<class T, size_t N>
ChannelIterator console::ChannelIterator< T, N >::operator++ ( int )
inline

后置递增。

Returns
迭代器自身。
Note
No-OP,return *this。

◆ operator->()

template<class T, size_t N>
T * console::ChannelIterator< T, N >::operator-> ( )
inline

成员访问查询。

Returns
缓存值指针。

◆ operator==()

template<class T, size_t N>
bool console::ChannelIterator< T, N >::operator== ( const ChannelIterator< T, N > & ) const
inline

比较相等。

Returns
是否相等。
Note
当通道关闭时,迭代器被视为相等。

Member Data Documentation

◆ cache_

template<class T, size_t N>
T console::ChannelIterator< T, N >::cache_
private

缓存值

◆ channel_

template<class T, size_t N>
Channel<T, N>& console::ChannelIterator< T, N >::channel_
private

通道引用


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