OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::IP::RangePartitionType< ADDR > Class Template Reference

divide a range of IP addresses into smaller, equal-sized partitions More...

#include <range.hpp>

Public Member Functions

 RangePartitionType (const RangeType< ADDR > &src_range, const std::size_t n_partitions)
 Constructor for RangePartitionType.
 
bool next (RangeType< ADDR > &r)
 Retrieves the next partition in the range.
 

Private Attributes

RangeType< ADDR > range
 
std::size_t remaining
 

Detailed Description

template<typename ADDR>
class openvpn::IP::RangePartitionType< ADDR >

divide a range of IP addresses into smaller, equal-sized partitions

designed to divide a range of IP addresses into smaller, equal-sized partitions. This class is useful when you need to split a large range of IP addresses into manageable chunks, which can be helpful in various networking scenarios.

Template Parameters
ADDRThe address type

Definition at line 225 of file range.hpp.

Constructor & Destructor Documentation

◆ RangePartitionType()

template<typename ADDR >
openvpn::IP::RangePartitionType< ADDR >::RangePartitionType ( const RangeType< ADDR > &  src_range,
const std::size_t  n_partitions 
)
inline

Constructor for RangePartitionType.

Parameters
src_rangeThe source range to be partitioned
n_partitionsThe number of partitions to create
Note
This constructor initializes the RangePartitionType with a given range and number of partitions

Definition at line 365 of file range.hpp.

Member Function Documentation

◆ next()

template<typename ADDR >
bool openvpn::IP::RangePartitionType< ADDR >::next ( RangeType< ADDR > &  r)
inline

Retrieves the next partition in the range.

Parameters
[out]rThe RangeType object to store the next partition
Returns
true if a next partition exists, false otherwise
Note
This function is used to iterate through the partitions of the range

Definition at line 372 of file range.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ range

template<typename ADDR >
RangeType<ADDR> openvpn::IP::RangePartitionType< ADDR >::range
private

Definition at line 245 of file range.hpp.

◆ remaining

template<typename ADDR >
std::size_t openvpn::IP::RangePartitionType< ADDR >::remaining
private

Definition at line 246 of file range.hpp.


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