File indexing completed on 2025-01-18 09:29:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_ASIO_IP_ADDRESS_V6_RANGE_HPP
0013 #define BOOST_ASIO_IP_ADDRESS_V6_RANGE_HPP
0014
0015 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0016 # pragma once
0017 #endif
0018
0019 #include <boost/asio/detail/config.hpp>
0020 #include <boost/asio/ip/address_v6_iterator.hpp>
0021
0022 #include <boost/asio/detail/push_options.hpp>
0023
0024 namespace boost {
0025 namespace asio {
0026 namespace ip {
0027
0028 template <typename> class basic_address_range;
0029
0030
0031
0032
0033
0034
0035
0036 template <> class basic_address_range<address_v6>
0037 {
0038 public:
0039
0040 typedef basic_address_iterator<address_v6> iterator;
0041
0042
0043 basic_address_range() noexcept
0044 : begin_(address_v6()),
0045 end_(address_v6())
0046 {
0047 }
0048
0049
0050 explicit basic_address_range(const iterator& first,
0051 const iterator& last) noexcept
0052 : begin_(first),
0053 end_(last)
0054 {
0055 }
0056
0057
0058 basic_address_range(const basic_address_range& other) noexcept
0059 : begin_(other.begin_),
0060 end_(other.end_)
0061 {
0062 }
0063
0064
0065 basic_address_range(basic_address_range&& other) noexcept
0066 : begin_(static_cast<iterator&&>(other.begin_)),
0067 end_(static_cast<iterator&&>(other.end_))
0068 {
0069 }
0070
0071
0072 basic_address_range& operator=(
0073 const basic_address_range& other) noexcept
0074 {
0075 begin_ = other.begin_;
0076 end_ = other.end_;
0077 return *this;
0078 }
0079
0080
0081 basic_address_range& operator=(basic_address_range&& other) noexcept
0082 {
0083 begin_ = static_cast<iterator&&>(other.begin_);
0084 end_ = static_cast<iterator&&>(other.end_);
0085 return *this;
0086 }
0087
0088
0089 iterator begin() const noexcept
0090 {
0091 return begin_;
0092 }
0093
0094
0095 iterator end() const noexcept
0096 {
0097 return end_;
0098 }
0099
0100
0101 bool empty() const noexcept
0102 {
0103 return begin_ == end_;
0104 }
0105
0106
0107 iterator find(const address_v6& addr) const noexcept
0108 {
0109 return addr >= *begin_ && addr < *end_ ? iterator(addr) : end_;
0110 }
0111
0112 private:
0113 iterator begin_;
0114 iterator end_;
0115 };
0116
0117
0118 typedef basic_address_range<address_v6> address_v6_range;
0119
0120 }
0121 }
0122 }
0123
0124 #include <boost/asio/detail/pop_options.hpp>
0125
0126 #endif