AgentXQueue Class Reference

#include <agentx_queue.h>

List of all members.

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 AgentXPduget_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 AgentXPdufind (u_int, unsigned long, boolean pending=FALSE)
 Get the request for a given session id and request id.
virtual AgentXPdufind (u_int)
 Get the request for the given packet id.
OrderedListCursor< AgentXPduelements ()
 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< AgentXPduqueue

Static Protected Attributes

static u_int pid


Constructor & Destructor Documentation

AgentXQueue::AgentXQueue (  ) 

Construct an empty queue.

virtual AgentXQueue::~AgentXQueue (  )  [virtual]

Destructor.


Member Function Documentation

virtual u_int AgentXQueue::add ( AgentXPdu  )  [virtual]

Add a request to the queue and set its packet id to a unique identifier.

(SYNCHRONIZED)

Parameters:
request a new request
Returns:
the (new) unique packet id of request.

virtual time_t AgentXQueue::timeout ( time_t   )  [virtual]

Timeout old requests and return the time until next request will timeout.

(SYNCHRONIZED)

Parameters:
timeout a time value. All requests with a timeout value less than timeout will be deleted from the queue.
Returns:
the time until the next request will timeout.

virtual AgentXPdu* AgentXQueue::get_late ( time_t   )  [virtual]

Get the first requests that is timed out in respect of the given time value.

Parameters:
timeout a time value. The first request with a timestamp value less than timeout will be returned.
Returns:
a pointer to an AgentXPdu.

virtual boolean AgentXQueue::remove ( AgentXPdu  )  [virtual]

Remove a request from the queue.

(NOT SYNCHRONIZED)

Parameters:
request a pointer to the request to be removed. The memory allocated by request will be freed, if the request could be removed successfully.
Returns:
TRUE 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)

Parameters:
transactionID a transaction ID.

virtual boolean AgentXQueue::pending ( u_int   )  [virtual]

Check whether there are any pending requests for a given transaction id.

Parameters:
transactionID a transaction ID.
Returns:
TRUE if there is any request for the specified transaction id within the queue, FALSE otherwise.

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)

Parameters:
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.
Returns:
a pointer to an AgentXPdu if such a request could be found or 0 otherwise.

virtual AgentXPdu* AgentXQueue::find ( u_int   )  [virtual]

Get the request for the given packet id.

(NOT SYNCHRONIZED)

Parameters:
packetID the packet id of a request
Returns:
a pointer an request if such a request could be found or 0 otherwise.

OrderedListCursor<AgentXPdu> AgentXQueue::elements (  ) 

Return a ordered list cursor over the elements of the queue (NOT SYNCHRONIZED).

Returns:
an OrderedListCursor instance.

static u_int AgentXQueue::create_packet_id (  )  [static]

Create a new packet id.

Returns:
a packet id.


Member Data Documentation

u_int AgentXQueue::pid [static, protected]

OrderedList<AgentXPdu> AgentXQueue::queue [protected]


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

Generated on Tue May 26 23:32:15 2009 for AgentX++ by  doxygen 1.5.6