00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _DISCOVERY_TABLE_H_
00018 #define _DISCOVERY_TABLE_H_
00019
00020 #include <list>
00021 #include <oasys/debug/Log.h>
00022 #include <oasys/util/StringBuffer.h>
00023 #include <oasys/util/Singleton.h>
00024
00025 namespace dtn {
00026
00027 class Discovery;
00028
00029 typedef std::list<Discovery*> DiscoveryList;
00030
00031 class DiscoveryTable : public oasys::Singleton<DiscoveryTable,false>,
00032 public oasys::Logger
00033 {
00034 public:
00035 virtual ~DiscoveryTable();
00036
00037 static void init()
00038 {
00039 if (instance_ != NULL)
00040 {
00041 PANIC("DiscoveryTable already initialized");
00042 }
00043 instance_ = new DiscoveryTable();
00044 }
00045
00046 bool add(const std::string& name, const char* addr_family,
00047 int argc, const char* argv[]);
00048
00049 bool del(const std::string& name);
00050
00051 void dump(oasys::StringBuffer* buf);
00052
00053 void shutdown();
00054
00055 protected:
00056 friend class DiscoveryCommand;
00057 friend class oasys::Singleton<DiscoveryTable>;
00058
00059 DiscoveryTable();
00060
00061 bool find(const std::string& name, DiscoveryList::iterator* iter);
00062
00063 DiscoveryList dlist_;
00064 };
00065
00066 };
00067
00068 #endif // _DISCOVERY_TABLE_H_