Kea
1.9.9-git
|
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... | |
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 300 of file parking_lots.h.
|
inline |
Constructor.
parking_lot | pointer to the parking lot for which the handle is created. |
Definition at line 307 of file parking_lots.h.
|
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.
Type | of the parked object. |
parked_object | object which will be parked. |
Definition at line 334 of file parking_lots.h.
|
inline |
Removes parked object without calling a callback.
It ignores any reference counts on the parked object.
Type | of the parked object. |
parked_object | parked object to be removed. |
Definition at line 363 of file parking_lots.h.
|
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.
Type | of the parked object. |
parked_object | object which will be parked. |
Definition at line 321 of file parking_lots.h.
|
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.
Type | of the parked object. |
parked_object | parked object to be unparked. |
Definition at line 350 of file parking_lots.h.