Kea 3.1.1
isc::lease_query::XidQueue< QueryType > Class Template Reference

Wrapper around a chronological list of queries, uniquely keyed by transaction id. More...

#include <lease_query_connection.h>

Public Types

typedef boost::shared_ptr< QueryType > QueryPtrType
 Type of pointers to QueryType.
 
typedef boost::multi_index_container< QueryPtrType, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::ordered_unique< boost::multi_index::const_mem_fun< QueryType, Xid, &QueryType::getXid > > > > XidQueueContainer
 Multi-index container for storing bulk lease queries.
 

Public Member Functions

void add (QueryPtrType query)
 Adds a query to the end of the queue.
 
void clear ()
 Removes all queries from the queue.
 
bool empty () const
 Empty predicate.
 
QueryPtrType find (const Xid &xid) const
 Fetches the query for a given transaction id.
 
QueryPtrType pop ()
 Pops a query to the beginning of the queue.
 
void remove (const Xid &xid)
 Removes a query from the queue for a given transaction id.
 
size_t size () const
 Fetches the number of entries in the queue.
 

Detailed Description

template<class QueryType>
class isc::lease_query::XidQueue< QueryType >

Wrapper around a chronological list of queries, uniquely keyed by transaction id.

New entries are added to the end. The wrapper uses it's own mutex to ensure thread-safety.

Template Parameters
QueryTypeEither BlqQuery or BulkLeaseQuery type.

Definition at line 37 of file lease_query_connection.h.

Member Typedef Documentation

◆ QueryPtrType

template<class QueryType>
typedef boost::shared_ptr<QueryType> isc::lease_query::XidQueue< QueryType >::QueryPtrType

Type of pointers to QueryType.

Definition at line 40 of file lease_query_connection.h.

◆ XidQueueContainer

template<class QueryType>
typedef boost::multi_index_container< QueryPtrType, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::ordered_unique< boost::multi_index::const_mem_fun<QueryType, Xid, &QueryType::getXid> > > > isc::lease_query::XidQueue< QueryType >::XidQueueContainer

Multi-index container for storing bulk lease queries.

Definition at line 54 of file lease_query_connection.h.

Member Function Documentation

◆ add()

template<class QueryType>
void isc::lease_query::XidQueue< QueryType >::add ( QueryPtrType query)
inline

Adds a query to the end of the queue.

Parameters
queryPointer to the query to add.

Definition at line 59 of file lease_query_connection.h.

◆ clear()

template<class QueryType>
void isc::lease_query::XidQueue< QueryType >::clear ( )
inline

Removes all queries from the queue.

Definition at line 117 of file lease_query_connection.h.

◆ empty()

template<class QueryType>
bool isc::lease_query::XidQueue< QueryType >::empty ( ) const
inline

Empty predicate.

Returns
True is the queue is empty, False otherwise.

Definition at line 82 of file lease_query_connection.h.

◆ find()

template<class QueryType>
QueryPtrType isc::lease_query::XidQueue< QueryType >::find ( const Xid & xid) const
inline

Fetches the query for a given transaction id.

Parameters
xidTransaction id for which to search.
Returns
Pointer to the query if found, an empty pointer otherwise.

Definition at line 100 of file lease_query_connection.h.

◆ pop()

template<class QueryType>
QueryPtrType isc::lease_query::XidQueue< QueryType >::pop ( )
inline

Pops a query to the beginning of the queue.

Returns
The first query of the queue or null when the queue is empty.

Definition at line 67 of file lease_query_connection.h.

◆ remove()

template<class QueryType>
void isc::lease_query::XidQueue< QueryType >::remove ( const Xid & xid)
inline

Removes a query from the queue for a given transaction id.

Parameters
xidTransaction id for which to search.

Definition at line 108 of file lease_query_connection.h.

References get().

+ Here is the call graph for this function:

◆ size()

template<class QueryType>
size_t isc::lease_query::XidQueue< QueryType >::size ( ) const
inline

Fetches the number of entries in the queue.

Returns
Number of entries in the queue.

Definition at line 90 of file lease_query_connection.h.


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