AgentX++  2.0.5
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
AgentXQueue Class Reference

#include <agentx_queue.h>

Inheritance diagram for AgentXQueue:

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 bool 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 bool pending (u_int)
 Check whether there are any pending requests for a given transaction id.
 
virtual AgentXPdufind (u_int, unsigned long, bool 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
requesta new request
Returns
the (new) unique packet id of request.
virtual void AgentXQueue::cancel ( u_int  )
virtual

Cancel (remove from queue) all requests with a given transaction id.

(SYNCHRONIZED)

Parameters
transactionIDa transaction ID.
static u_int AgentXQueue::create_packet_id ( )
static

Create a new packet id.

Returns
a packet id.
OrderedListCursor<AgentXPdu> AgentXQueue::elements ( )

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

Returns
an OrderedListCursor instance.
virtual AgentXPdu* AgentXQueue::find ( u_int  ,
unsigned  long,
bool  pending = FALSE 
)
virtual

Get the request for a given session id and request id.

(NOT SYNCHRONIZED)

Parameters
sessiona AgentX session
transactionIDthe transaction id of a request
pendingif 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
packetIDthe packet id of a request
Returns
a pointer an request if such a request could be found or 0 otherwise.
virtual AgentXPdu* AgentXQueue::get_late ( time_t  )
virtual

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

Parameters
timeouta time value. The first request with a timestamp value less than timeout will be returned.
Returns
a pointer to an AgentXPdu.
virtual bool AgentXQueue::pending ( u_int  )
virtual

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

Parameters
transactionIDa transaction ID.
Returns
TRUE if there is any request for the specified transaction id within the queue, FALSE otherwise.
virtual bool AgentXQueue::remove ( AgentXPdu )
virtual

Remove a request from the queue.

(NOT SYNCHRONIZED)

Parameters
requesta 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 time_t AgentXQueue::timeout ( time_t  )
virtual

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

(SYNCHRONIZED)

Parameters
timeouta 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.

Member Data Documentation

u_int AgentXQueue::pid
staticprotected
OrderedList<AgentXPdu> AgentXQueue::queue
protected

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