Kea  2.1.7-git
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 ()
 Constructor for all subnets query. More...
 
 MemfileLeaseStatsQuery (const SubnetID &subnet_id)
 Constructor for single subnet query. More...
 
 MemfileLeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
 Constructor for subnet range query. More...
 
virtual ~MemfileLeaseStatsQuery ()
 Destructor. More...
 
virtual bool getNextRow (LeaseStatsRow &row)
 Fetches the next row in the result set. More...
 
int getRowCount () const
 Returns the number of rows in the result set. More...
 
- Public Member Functions inherited from isc::dhcp::LeaseStatsQuery
 LeaseStatsQuery ()
 Default constructor The query created will return statistics for all subnets. More...
 
 LeaseStatsQuery (const SubnetID &subnet_id)
 Constructor to query for a single subnet's stats. More...
 
 LeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
 Constructor to query for the stats for a range of subnets. More...
 
virtual ~LeaseStatsQuery ()
 virtual destructor More...
 
SubnetID getFirstSubnetID () const
 Returns the value of first subnet ID specified (or zero) More...
 
SubnetID getLastSubnetID () const
 Returns the value of last subnet ID specified (or zero) More...
 
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. More...
 
virtual void start ()
 Executes the query. More...
 

Protected Attributes

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

Additional Inherited Members

- Public Types inherited from isc::dhcp::LeaseStatsQuery
enum  SelectMode { ALL_SUBNETS, SINGLE_SUBNET, SUBNET_RANGE }
 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 261 of file memfile_lease_mgr.cc.

Constructor & Destructor Documentation

◆ MemfileLeaseStatsQuery() [1/3]

isc::dhcp::MemfileLeaseStatsQuery::MemfileLeaseStatsQuery ( )
inline

Constructor for all subnets query.

Definition at line 265 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 272 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 280 of file memfile_lease_mgr.cc.

◆ ~MemfileLeaseStatsQuery()

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

Destructor.

Definition at line 285 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 297 of file memfile_lease_mgr.cc.

◆ getRowCount()

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

Returns the number of rows in the result set.

Definition at line 308 of file memfile_lease_mgr.cc.

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 317 of file memfile_lease_mgr.cc.

◆ rows_

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

A vector containing the "result set".

Definition at line 314 of file memfile_lease_mgr.cc.


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