public T Read(ulong id, DatabaseLocationType type) { switch (type) { case DatabaseLocationType.MemoryAndDisk: return(ReadFromMemoryFirstThenDisk(id)); case DatabaseLocationType.MemoryOnly: return(TryGetElementFromMemory(id)); case DatabaseLocationType.DiskOnly: return(TryGetElementFromDiskByID(id)); } throw new Exception("unsupported read method"); }
public bool Store(T e, DatabaseLocationType type) { switch (type) { case DatabaseLocationType.MemoryAndDisk: return(ForceStoreToMemory(e) && ForceStoreToDisk(e)); case DatabaseLocationType.MemoryOnly: return(ForceStoreToMemory(e)); case DatabaseLocationType.DiskOnly: return(ForceStoreToDisk(e)); } throw new Exception("unsupported store method"); }
public T Read(string id, DatabaseLocationType type) { return(Read(DatabaseElement.GenerateID(id), type)); }