• Main Page
  • Classes
  • Files
  • File List

/Users/yzchen/ns/ns-allinone-2.33/ns-2.33/sensor-nets/agent-list.h

00001 // Satish Kumar, kkumar@isi.edu
00002 
00003 #ifndef agent_list_h_
00004 #define agent_list_h_
00005 
00006 #include <cstdlib>
00007 #include <stdlib.h>
00008 #include <stdio.h>
00009 #include <iostream>
00010 #include <iomanip.h>
00011 #include <assert.h>
00012 #include <tclcl.h>
00013 #include <trace.h>
00014 #include <rng.h>
00015 #include <agent.h>
00016 
00017 class AgentList : public TclObject {
00018 public:
00019   AgentList() {
00020     agents_ = NULL;
00021     num_agents_ = 0;
00022   }
00023 
00024   virtual int command(int argc, const char * const * argv);
00025   static AgentList* instance() {assert(instance_); return instance_; }
00026   void AddAgent(nsaddr_t node_addr, void *a);
00027   void* GetAgent(nsaddr_t node_addr) {
00028     assert(num_agents_ > node_addr);
00029     return(agents_[node_addr]);
00030   }
00031   
00032 private:
00033   void **agents_;
00034   int num_agents_;
00035   static AgentList* instance_;
00036 };
00037 
00038 
00039 #endif

Generated on Tue Aug 10 2010 16:16:08 for ns-2.33 by  doxygen 1.7.1