Kea 2.7.6
isc::dhcp::MemfileLeaseStatsQuery Class Reference

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

+ Inheritance diagram for isc::dhcp::MemfileLeaseStatsQuery:

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< LeaseStatsRowrows_
 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 266 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_modeThe selection criteria which is either ALL_SUBNETS or ALL_SUBNET_POOLS

Definition at line 272 of file memfile_lease_mgr.cc.

◆ MemfileLeaseStatsQuery() [2/3]

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

Constructor for single subnet query.

Parameters
subnet_idID of the desired subnet

Definition at line 279 of file memfile_lease_mgr.cc.

◆ 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_idID of the first subnet in the desired range
last_subnet_idID of the last subnet in the desired range

Definition at line 287 of file memfile_lease_mgr.cc.

◆ ~MemfileLeaseStatsQuery()

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

Destructor.

Definition at line 292 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
rowStorage 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 304 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 315 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 324 of file memfile_lease_mgr.cc.

Referenced by getNextRow().

◆ rows_

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

A vector containing the "result set".

Definition at line 321 of file memfile_lease_mgr.cc.

Referenced by getNextRow(), and getRowCount().


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