< address_type >
|The iterator type. More...|
|AddressRange (const address_type &first, const address_type &last, bool only_hosts=false)|
|Constructs an address range from two addresses. More...|
|bool||contains (const address_type &addr) const|
|Indicates whether an address is included in this range. More...|
|const_iterator||begin () const|
|Returns an interator to the beginning of this range. More...|
|const_iterator||end () const|
|Returns an interator to the end of this range. More...|
|bool||is_iterable () const|
|Indicates whether this range is iterable. More...|
|static AddressRange||from_mask (const address_type &first, const address_type &mask)|
|Creates an address range from a base address and a network mask. More...|
Represents a range of addresses.
This class provides a begin()/end() interface which allows iterating through every address stored in it.
Note that when iterating a range that was created using operator/(IPv4Address, int) and the analog for IPv6, the network and broadcast addresses are discarded:
Ranges created using AddressRange(address_type, address_type) will allow the iteration over the entire range:
The type of addresses stored in the range.
|typedef AddressRangeIterator<address_type> Tins::AddressRange< Address >::const_iterator|
The iterator type.
The iterator type.
This is the same type as const_iterator, since the addresses stored in this range are read only.
Constructs an address range from two addresses.
The range will consist of the addresses [first, last].
If only_hosts is true, then the network and broadcast addresses will not be available when iterating the range.
If last < first, an std::runtime_error exception is thrown.
|first||The first address in the range.|
|last||The last address(inclusive) in the range.|
|only_hosts||Indicates whether only host addresses should be accessed when using iterators.|
Returns an interator to the beginning of this range.
const_iterator pointing to the beginning of this range.
Indicates whether an address is included in this range.
|addr||The address to test.|
Returns an interator to the end of this range.
const_iterator pointing to the end of this range.
Creates an address range from a base address and a network mask.
|first||The base address.|
|mask||The network mask to be used.|
Indicates whether this range is iterable.
Iterable ranges are those for which there is at least one address that could represent a host. For IPv4 ranges, a /31 or /32 ranges does not contain any, therefore it's not iterable. The same is true for /127 and /128 IPv6 ranges.