AgentX++  2.0.5
agentx_node.h
Go to the documentation of this file.
1 /*_############################################################################
2  _##
3  _## agentx_node.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 
21 #ifndef _agentx_node_h_
22 #define _agentx_node_h_
23 
24 #include <agentx_pp/agentx_reg.h>
25 #include <agentx_pp/agentx_pdu.h>
26 #include <agent_pp/mib.h>
27 
28 #ifdef AGENTPP_NAMESPACE
29 namespace Agentpp {
30 #endif
31 
32 /*----------------------- class AgentXNode ---------------------------*/
33 
34 
35 class MasterAgentXMib;
36 
37 class AgentXNode: public MibEntry {
38 
39 friend class MasterAgentXMib;
40 
41  public:
53 
60  AgentXNode(const AgentXNode&);
61 
65  virtual ~AgentXNode();
66 
75  virtual void add_registration(AgentXRegEntry*);
76 
87  virtual bool remove_registration(const AgentXRegEntry&);
88 
98  virtual bool shrink(const Oidx&);
99 
109  virtual bool expand(const Oidx&);
110 
117  virtual mib_type type() const;
118 
124  virtual MibEntryPtr clone();
125 
126 
127  // interfaces dispatch table <-> management instrumentation
128 
135  virtual void get_request(Request*, int);
136 
143  virtual void get_next_request(Request*, int);
144 
153  virtual int commit_set_request(Request*, int);
154 
163  virtual int prepare_set_request(Request*, int&);
164 
173  virtual int undo_set_request(Request*, int&);
174 
182  virtual void cleanup_set_request(Request*, int&);
183 
190  virtual bool is_empty() { return false; }
191 
199  virtual OidxPtr max_key();
200 
214  virtual Oidx find_succ(const Oidx&, Request* req = 0);
215 
224  static bool is_agentx(const MibEntry&);
225 
232  u_int registration_count() { return origReg.size(); }
233 
240  AgentXRegEntry* active_registration()
241  { return origReg.first(); }
242 
249  AgentXRegion get_region() { return region; }
250 
251  protected:
252 
260  void set_region(const AgentXRegion&);
261 
270  virtual void get_request(Request*, int, u_char);
271 
281  virtual void set_request(Request*, int, u_char);
282 
289  void set_back_reference(MasterAgentXMib*);
290 
291  // Oidx upper;
292  OrderedList<AgentXRegEntry> origReg;
294 
297 };
298 
299 #ifdef AGENTPP_NAMESPACE
300 }
301 #endif
302 
303 
304 #endif