Kea  1.9.9-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 259 of file memfile_lease_mgr.cc.

Constructor & Destructor Documentation

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

Constructor for all subnets query.

Definition at line 263 of file memfile_lease_mgr.cc.

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

Constructor for single subnet query.

Parameters
subnet_idID of the desired subnet

Definition at line 270 of file memfile_lease_mgr.cc.

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

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

Destructor.

Definition at line 283 of file memfile_lease_mgr.cc.

Member Function Documentation

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

References next_pos_, and rows_.

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

Returns the number of rows in the result set.

Definition at line 306 of file memfile_lease_mgr.cc.

References rows_.

Member Data Documentation

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

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

Definition at line 315 of file memfile_lease_mgr.cc.

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

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

A vector containing the "result set".

Definition at line 312 of file memfile_lease_mgr.cc.

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


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