00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _LINK_STORE_H_
00018 #define _LINK_STORE_H_
00019
00020 #include <oasys/debug/DebugUtils.h>
00021 #include <oasys/serialize/TypeShims.h>
00022 #include <oasys/storage/InternalKeyDurableTable.h>
00023 #include <oasys/util/Singleton.h>
00024
00025 namespace dtn {
00026
00027 class Link;
00028
00033 typedef oasys::InternalKeyDurableTable<
00034 oasys::StringShim, std::string, Link> LinkStoreImpl;
00035
00039 class LinkStore : public oasys::Singleton<LinkStore, false>,
00040 public LinkStoreImpl {
00041 public:
00046 static int init(const oasys::StorageConfig& cfg,
00047 oasys::DurableStore* store)
00048 {
00049 if (instance_ != NULL) {
00050 PANIC("LinkStore::init called multiple times");
00051 }
00052 instance_ = new LinkStore();
00053 return instance_->do_init(cfg, store);
00054 }
00055
00059 LinkStore();
00060
00064 static bool initialized() { return (instance() != NULL); }
00065 };
00066
00067 }
00068
00069 #endif