AgentX++  2.0.5
agentx_queue.h
Go to the documentation of this file.
1 /*_############################################################################
2  _##
3  _## agentx_queue.h
4  _##
5  _##
6  _## AgentX++ 2
7  _## -------------------------------------
8  _## Copyright (C) 2000-2013 - Frank Fock
9  _##
10  _## Use of this software is subject to the license agreement you received
11  _## with this software and which can be downloaded from
12  _## http://www.agentpp.com
13  _##
14  _## This is licensed software and may not be used in a commercial
15  _## environment, except for evaluation purposes, unless a valid
16  _## license has been purchased.
17  _##
18  _##########################################################################*/
19 
20 #ifndef _agentx_queue_h_
21 #define _agentx_queue_h_
22 
24 #include <agentx_pp/agentx_pdu.h>
25 
26 #include <agent_pp/List.h>
27 
28 #ifdef AGENTPP_NAMESPACE
29 namespace Agentpp {
30 #endif
31 
32 
33 /*-------------------------- class AgentXQueue -----------------------*/
34 
44 #if !defined (AGENTXPP_DECL_TEMPL_LIST_AGENTXPDU)
45 #define AGENTXPP_DECL_TEMPL_LIST_AGENTXPDU
47 #endif
48 #if !defined (AGENTXPP_DECL_TEMPL_LISTCURSOR_AGENTXPDU)
49 #define AGENTXPP_DECL_TEMPL_LISTCURSOR_AGENTXPDU
51 #endif
52 #if !defined (AGENTXPP_DECL_TEMPL_ORDEREDLIST_AGENTXPDU)
53 #define AGENTXPP_DECL_TEMPL_ORDEREDLIST_AGENTXPDU
55 #endif
56 #if !defined (AGENTXPP_DECL_TEMPL_ORDEREDLISTCURSOR_AGENTXPDU)
57 #define AGENTXPP_DECL_TEMPL_ORDEREDLISTCURSOR_AGENTXPDU
59 #endif
60 
61 class AGENTXPP_DECL AgentXQueue: public Synchronized {
62 
63  public:
64 
68  AgentXQueue();
69 
73  virtual ~AgentXQueue();
74 
84  virtual u_int add(AgentXPdu*);
85 
96  virtual time_t timeout(time_t);
97 
108  virtual AgentXPdu* get_late(time_t);
109 
120  virtual bool remove(AgentXPdu*);
121 
129  virtual void cancel(u_int);
130 
141  virtual bool pending(u_int);
142 
159  virtual AgentXPdu* find(u_int, unsigned long, bool pending=FALSE);
160 
171  virtual AgentXPdu* find(u_int);
172 
180  OrderedListCursor<AgentXPdu> elements();
181 
188  static u_int create_packet_id();
189 
190  protected:
191  static u_int pid;
192 
193 
195 };
196 #ifdef AGENTPP_NAMESPACE
197 }
198 #endif
199 
200 
201 #endif