00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _REGISTRATION_STORE_H_
00018 #define _REGISTRATION_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 #include "reg/APIRegistration.h"
00026
00027 namespace dtn {
00028
00032 typedef oasys::InternalKeyDurableTable<
00033 oasys::UIntShim, u_int32_t, APIRegistration> RegistrationStoreImpl;
00034
00039 class RegistrationStore : public oasys::Singleton<RegistrationStore, false>,
00040 public RegistrationStoreImpl {
00041 public:
00046 static int init(const oasys::StorageConfig& cfg,
00047 oasys::DurableStore* store)
00048 {
00049 if (instance_ != NULL) {
00050 PANIC("RegistrationStore::init called multiple times");
00051 }
00052 instance_ = new RegistrationStore();
00053 return instance_->do_init(cfg, store);
00054 }
00055
00059 RegistrationStore();
00060
00064 static bool initialized() { return (instance() != NULL); }
00065 };
00066
00067 }
00068
00069 #endif