| Kea 3.0.2-git

isc::lease_query::AddressList Class Reference

Manages a unique list of IP addresses. More...

`#include <lease_query_impl.h>`

## Public Member Functions
| AddressList (uint16_t family)
| Constructor.
bool | contains (const isc::asiolink::IOAddress &address) const
| Checks if an address is present in the list.
uint16_t | getFamily ()
| Returns the protocol family of the address list.
void | insert (const isc::asiolink::IOAddress &address)
| Inserts an address into the list.
size_t | size () const
| Returns the number of addresses in the list.

## Detailed Description

Manages a unique list of IP addresses.

Definition at line 37 of file lease_query_impl.h.

## Constructor & Destructor Documentation

## ◆ AddressList()

isc::lease_query::AddressList::AddressList | ( | uint16_t | family | ) |
| inline

Constructor.

Parameters

  family | protocol family of the list (AF_INET or AF_INET6)

Definition at line 42 of file lease_query_impl.h.

## Member Function Documentation

## ◆ contains()

bool AddressList::contains | ( | const isc::asiolink::IOAddress & | address | ) | const

Checks if an address is present in the list.

Parameters

  address | address for which to search

Returns
  true if the address is in the list, false otherwise

Exceptions

  BadValue | if the address's family does not match the list's family.

Definition at line 30 of file lease_query_impl.cc.

References isc::asiolink::IOAddress::getFamily(), and isc_throw.

Referenced by insert().

Here is the call graph for this function:

## ◆ getFamily()

uint16_t isc::lease_query::AddressList::getFamily | ( |  | ) |
| inline

Returns the protocol family of the address list.

Definition at line 68 of file lease_query_impl.h.

## ◆ insert()

void AddressList::insert | ( | const isc::asiolink::IOAddress & | address | ) |

Inserts an address into the list.

Adds the given address to the list.

Parameters

  address | address to add

Exceptions

  BadValue | if the address's family does not match the list's family or the address is already in the list.

Definition at line 19 of file lease_query_impl.cc.

References contains(), and isc_throw.

Here is the call graph for this function:

## ◆ size()

size_t isc::lease_query::AddressList::size | ( |  | ) | const
| inline

Returns the number of addresses in the list.

Definition at line 63 of file lease_query_impl.h.

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

- lease_query_impl.h
- lease_query_impl.cc