SatCat5
satcat5::ip::DhcpPoolStatic< SIZE > Class Template Referencefinal

Detailed Description

template<unsigned SIZE>
class satcat5::ip::DhcpPoolStatic< SIZE >

The simplest possible implementation of DhcpPool, supporting a contiguous range of IP-addresses from BASE to BASE+SIZE-1.

Definition at line 172 of file ip_dhcp.h.

#include <ip_dhcp.h>

Inheritance diagram for satcat5::ip::DhcpPoolStatic< SIZE >:
[legend]
Collaboration diagram for satcat5::ip::DhcpPoolStatic< SIZE >:
[legend]

Public Member Functions

 DhcpPoolStatic (const satcat5::ip::Addr &base)
 
unsigned addr2idx (const satcat5::ip::Addr &addr) const override
 Find index associated with the given IP address. More...
 
satcat5::ip::Addr idx2addr (unsigned idx) const override
 Fetch IP-address for Nth object in the pool. More...
 
satcat5::ip::DhcpAddressidx2meta (unsigned idx) override
 Fetch metadata for Nth object in the pool.or Returns NULL if the index is out of bounds. More...
 
bool contains (const satcat5::ip::Addr &addr)
 Does this pool contain the designated address?
 
satcat5::ip::DhcpAddressaddr2meta (const satcat5::ip::Addr &addr)
 Two-step lookup of metadata from address.
 

Private Attributes

const satcat5::ip::Addr m_base
 
satcat5::ip::DhcpAddress m_array [SIZE]
 

Member Function Documentation

◆ addr2idx()

template<unsigned SIZE>
unsigned satcat5::ip::DhcpPoolStatic< SIZE >::addr2idx ( const satcat5::ip::Addr addr) const
inlineoverridevirtual

Find index associated with the given IP address.

If none is found, return any out-of-bounds index. Child classes MUST override this method.

Implements satcat5::ip::DhcpPool.

Definition at line 178 of file ip_dhcp.h.

◆ idx2addr()

template<unsigned SIZE>
satcat5::ip::Addr satcat5::ip::DhcpPoolStatic< SIZE >::idx2addr ( unsigned  idx) const
inlineoverridevirtual

Fetch IP-address for Nth object in the pool.

Returns ip::ADDR_NONE if the index is out of bounds. Child classes MUST override this method.

Implements satcat5::ip::DhcpPool.

Definition at line 181 of file ip_dhcp.h.

◆ idx2meta()

template<unsigned SIZE>
satcat5::ip::DhcpAddress* satcat5::ip::DhcpPoolStatic< SIZE >::idx2meta ( unsigned  idx)
inlineoverridevirtual

Fetch metadata for Nth object in the pool.or Returns NULL if the index is out of bounds.

Child classes MUST override this method.

Implements satcat5::ip::DhcpPool.

Definition at line 184 of file ip_dhcp.h.


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