Kea  2.1.7-git
isc::hooks::ParkingLotHandle Class Reference

Provides a limited view to the ParkingLot. More...

#include <parking_lots.h>

Public Member Functions

 ParkingLotHandle (const ParkingLotPtr &parking_lot)
 Constructor. More...
 
template<typename T >
int dereference (T parked_object)
 Decreases the reference counter for the parked object. More...
 
template<typename T >
bool drop (T parked_object)
 Removes parked object without calling a callback. More...
 
template<typename T >
int reference (T parked_object)
 Increases reference counter for the parked object. More...
 
template<typename T >
bool unpark (T parked_object)
 Signals that the object should be unparked. More...
 

Detailed Description

Provides a limited view to the ParkingLot.

The handle is provided to the callouts which can reference and unpark parked objects. The callouts should not park objects, therefore this operation is not available.

The types of the parked objects provided as T parameter of respective functions are most often shared pointers. One should not use references to parked objects nor references to shared pointers to avoid premature destruction of the parked objects.

Definition at line 306 of file parking_lots.h.

Constructor & Destructor Documentation

◆ ParkingLotHandle()

isc::hooks::ParkingLotHandle::ParkingLotHandle ( const ParkingLotPtr parking_lot)
inline

Constructor.

Parameters
parking_lotpointer to the parking lot for which the handle is created.

Definition at line 313 of file parking_lots.h.

Member Function Documentation

◆ dereference()

template<typename T >
int isc::hooks::ParkingLotHandle::dereference ( parked_object)
inline

Decreases the reference counter for the parked object.

This method is called by the callouts to decrease the reference count of a parked object.

Template Parameters
Typeof the parked object.
Parameters
parked_objectobject which will be parked.
Returns
new reference count as an integer

Definition at line 340 of file parking_lots.h.

◆ drop()

template<typename T >
bool isc::hooks::ParkingLotHandle::drop ( parked_object)
inline

Removes parked object without calling a callback.

It ignores any reference counts on the parked object.

Template Parameters
Typeof the parked object.
Parameters
parked_objectparked object to be removed.
Returns
false if the object couldn't be removed because there is no such object, true otherwise.

Definition at line 369 of file parking_lots.h.

◆ reference()

template<typename T >
int isc::hooks::ParkingLotHandle::reference ( parked_object)
inline

Increases reference counter for the parked object.

This method is called by the callouts to increase a reference count on the object to be parked. It must be called before the object is actually parked.

Template Parameters
Typeof the parked object.
Parameters
parked_objectobject which will be parked.
Returns
new reference count as an integer

Definition at line 327 of file parking_lots.h.

◆ unpark()

template<typename T >
bool isc::hooks::ParkingLotHandle::unpark ( parked_object)
inline

Signals that the object should be unparked.

If the specified object is parked in this parking lot, the reference count is decreased as a result of this method. If the reference count is 0, the object is unparked and the callback is invoked. Typically, the callback points to a function which resumes processing of a packet.

Template Parameters
Typeof the parked object.
Parameters
parked_objectparked object to be unparked.
Returns
false if the object couldn't be unparked because there is no such object, true otherwise.

Definition at line 356 of file parking_lots.h.


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