Kea: isc::dhcp::MemfileLeaseStatsQuery Class Reference

| Kea 3.2.0-git

isc::dhcp::MemfileLeaseStatsQuery Class Reference

Base Memfile derivation of the statistical lease data query. More...

Inheritance diagram for isc::dhcp::MemfileLeaseStatsQuery:
[legend]

## Public Member Functions
| MemfileLeaseStatsQuery (const SelectMode &select_mode=ALL_SUBNETS)
| Constructor for all subnets query.
| MemfileLeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
| Constructor for subnet range query.
| MemfileLeaseStatsQuery (const SubnetID &subnet_id)
| Constructor for single subnet query.
virtual | ~MemfileLeaseStatsQuery ()
| Destructor.
virtual bool | getNextRow (LeaseStatsRow &row)
| Fetches the next row in the result set.
int | getRowCount () const
| Returns the number of rows in the result set.
Public Member Functions inherited from isc::dhcp::LeaseStatsQuery
| LeaseStatsQuery (const SelectMode &select_mode=ALL_SUBNETS)
| Constructor to query statistics for all subnets.
| LeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
| Constructor to query for the stats for a range of subnets.
| LeaseStatsQuery (const SubnetID &subnet_id)
| Constructor to query for a single subnet's stats.
virtual | ~LeaseStatsQuery ()
| virtual destructor
SubnetID | getFirstSubnetID () const
| Returns the value of first subnet ID specified (or zero).
SubnetID | getLastSubnetID () const
| Returns the value of last subnet ID specified (or zero).
SelectMode | getSelectMode () const
| Returns the selection criteria mode The value returned is based upon the constructor variant used and it indicates which query variant will be executed.
virtual void | start ()
| Executes the query.

## Protected Attributes
std::vector< LeaseStatsRow >::iterator | next_pos_
| An iterator for accessing the next row within the result set.
std::vector< LeaseStatsRow > | rows_
| A vector containing the "result set".
Protected Attributes inherited from isc::dhcp::LeaseStatsQuery
SubnetID | first_subnet_id_
| First (or only) subnet_id in the selection criteria.
SubnetID | last_subnet_id_
| Last subnet_id in the selection criteria when a range is given.

## Additional Inherited Members
Public Types inherited from isc::dhcp::LeaseStatsQuery
enum | SelectMode { ALL_SUBNETS , SINGLE_SUBNET , SUBNET_RANGE , ALL_SUBNET_POOLS }
| Defines the types of selection criteria supported. More...

## Detailed Description

Base Memfile derivation of the statistical lease data query.

This class provides the functionality such as results storage and row fetching common to fulfilling the statistical lease data query.

Definition at line 319 of file memfile_lease_mgr.cc.

## Constructor & Destructor Documentation

## ◆ MemfileLeaseStatsQuery() [1/3]

isc::dhcp::MemfileLeaseStatsQuery::MemfileLeaseStatsQuery | ( | const SelectMode & | select_mode = ALL_SUBNETS | ) |
| inline

Constructor for all subnets query.

Parameters

  select_mode | The selection criteria which is either ALL_SUBNETS or ALL_SUBNET_POOLS

Definition at line 325 of file memfile_lease_mgr.cc.

References isc::dhcp::LeaseStatsQuery::LeaseStatsQuery(), isc::dhcp::LeaseStatsQuery::ALL_SUBNETS, next_pos_, and rows_.

Referenced by isc::dhcp::MemfileLeaseStatsQuery4::MemfileLeaseStatsQuery4(), isc::dhcp::MemfileLeaseStatsQuery4::MemfileLeaseStatsQuery4(), isc::dhcp::MemfileLeaseStatsQuery4::MemfileLeaseStatsQuery4(), isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6(), isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6(), and isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6().

Here is the call graph for this function:

## ◆ MemfileLeaseStatsQuery() [2/3]

isc::dhcp::MemfileLeaseStatsQuery::MemfileLeaseStatsQuery | ( | const SubnetID & | subnet_id | ) |
| inline

Constructor for single subnet query.

Parameters

  subnet_id | ID of the desired subnet

Definition at line 332 of file memfile_lease_mgr.cc.

References isc::dhcp::LeaseStatsQuery::LeaseStatsQuery(), next_pos_, and rows_.

Here is the call graph for this function:

## ◆ MemfileLeaseStatsQuery() [3/3]

isc::dhcp::MemfileLeaseStatsQuery::MemfileLeaseStatsQuery | ( | const SubnetID & | first_subnet_id,
|  | const SubnetID & | last_subnet_id )
| inline

Constructor for subnet range query.

Parameters

  first_subnet_id | ID of the first subnet in the desired range
  last_subnet_id | ID of the last subnet in the desired range

Definition at line 340 of file memfile_lease_mgr.cc.

References isc::dhcp::LeaseStatsQuery::LeaseStatsQuery(), next_pos_, and rows_.

Here is the call graph for this function:

## ◆ ~MemfileLeaseStatsQuery()

virtual isc::dhcp::MemfileLeaseStatsQuery::~MemfileLeaseStatsQuery | ( |  | ) |
| inlinevirtual

Destructor.

Definition at line 345 of file memfile_lease_mgr.cc.

## Member Function Documentation

## ◆ getNextRow()

virtual bool isc::dhcp::MemfileLeaseStatsQuery::getNextRow | ( | LeaseStatsRow & | row | ) |
| inlinevirtual

Fetches the next row in the result set.

Once the internal result set has been populated by invoking the the start() method, this method is used to iterate over the result set rows. Once the last row has been fetched, subsequent calls will return false.

Parameters

  row | Storage for the fetched row

Returns
  True if the fetch succeeded, false if there are no more rows to fetch.

Reimplemented from isc::dhcp::LeaseStatsQuery.

Definition at line 357 of file memfile_lease_mgr.cc.

References next_pos_, and rows_.

## ◆ getRowCount()

int isc::dhcp::MemfileLeaseStatsQuery::getRowCount | ( |  | ) | const
| inline

Returns the number of rows in the result set.

Definition at line 368 of file memfile_lease_mgr.cc.

References rows_.

## Member Data Documentation

## ◆ next_pos_

std::vector<LeaseStatsRow>::iterator isc::dhcp::MemfileLeaseStatsQuery::next_pos_
| protected

An iterator for accessing the next row within the result set.

Definition at line 377 of file memfile_lease_mgr.cc.

Referenced by MemfileLeaseStatsQuery(), MemfileLeaseStatsQuery(), MemfileLeaseStatsQuery(), and getNextRow().

## ◆ rows_

std::vector<LeaseStatsRow> isc::dhcp::MemfileLeaseStatsQuery::rows_
| protected

A vector containing the "result set".

Definition at line 374 of file memfile_lease_mgr.cc.

Referenced by MemfileLeaseStatsQuery(), MemfileLeaseStatsQuery(), MemfileLeaseStatsQuery(), getNextRow(), and getRowCount().

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

- memfile_lease_mgr.cc