#include <agentx_queue.h>
Public Member Functions | |
AgentXQueue () | |
Construct an empty queue. | |
virtual | ~AgentXQueue () |
Destructor. | |
virtual u_int | add (AgentXPdu *) |
Add a request to the queue and set its packet id to a unique identifier. | |
virtual time_t | timeout (time_t) |
Timeout old requests and return the time until next request will timeout. | |
virtual AgentXPdu * | get_late (time_t) |
Get the first requests that is timed out in respect of the given time value. | |
virtual boolean | remove (AgentXPdu *) |
Remove a request from the queue. | |
virtual void | cancel (u_int) |
Cancel (remove from queue) all requests with a given transaction id. | |
virtual boolean | pending (u_int) |
Check whether there are any pending requests for a given transaction id. | |
virtual AgentXPdu * | find (u_int, unsigned long, boolean pending=FALSE) |
Get the request for a given session id and request id. | |
virtual AgentXPdu * | find (u_int) |
Get the request for the given packet id. | |
OrderedListCursor< AgentXPdu > | elements () |
Return a ordered list cursor over the elements of the queue (NOT SYNCHRONIZED). | |
Static Public Member Functions | |
static u_int | create_packet_id () |
Create a new packet id. | |
Protected Attributes | |
OrderedList< AgentXPdu > | queue |
Static Protected Attributes | |
static u_int | pid |
AgentXQueue::AgentXQueue | ( | ) |
Construct an empty queue.
virtual AgentXQueue::~AgentXQueue | ( | ) | [virtual] |
Destructor.
virtual u_int AgentXQueue::add | ( | AgentXPdu * | ) | [virtual] |
Add a request to the queue and set its packet id to a unique identifier.
(SYNCHRONIZED)
request | a new request |
virtual time_t AgentXQueue::timeout | ( | time_t | ) | [virtual] |
Timeout old requests and return the time until next request will timeout.
(SYNCHRONIZED)
timeout | a time value. All requests with a timeout value less than timeout will be deleted from the queue. |
virtual AgentXPdu* AgentXQueue::get_late | ( | time_t | ) | [virtual] |
Get the first requests that is timed out in respect of the given time value.
timeout | a time value. The first request with a timestamp value less than timeout will be returned. |
virtual boolean AgentXQueue::remove | ( | AgentXPdu * | ) | [virtual] |
Remove a request from the queue.
(NOT SYNCHRONIZED)
request | a pointer to the request to be removed. The memory allocated by request will be freed, if the request could be removed successfully. |
virtual void AgentXQueue::cancel | ( | u_int | ) | [virtual] |
Cancel (remove from queue) all requests with a given transaction id.
(SYNCHRONIZED)
transactionID | a transaction ID. |
virtual boolean AgentXQueue::pending | ( | u_int | ) | [virtual] |
Check whether there are any pending requests for a given transaction id.
transactionID | a transaction ID. |
virtual AgentXPdu* AgentXQueue::find | ( | u_int | , | |
unsigned | long, | |||
boolean | pending = FALSE | |||
) | [virtual] |
Get the request for a given session id and request id.
(NOT SYNCHRONIZED)
session | a AgentX session | |
transactionID | the transaction id of a request | |
pending | if TRUE, only pending (not yet sent) requests are returned, otherwise any request that match the given session and transaction ID will be returned. |
virtual AgentXPdu* AgentXQueue::find | ( | u_int | ) | [virtual] |
Get the request for the given packet id.
(NOT SYNCHRONIZED)
packetID | the packet id of a request |
OrderedListCursor<AgentXPdu> AgentXQueue::elements | ( | ) |
Return a ordered list cursor over the elements of the queue (NOT SYNCHRONIZED).
static u_int AgentXQueue::create_packet_id | ( | ) | [static] |
Create a new packet id.
u_int AgentXQueue::pid [static, protected] |
OrderedList<AgentXPdu> AgentXQueue::queue [protected] |