public StorageLayer(string fileName, TrieSettings trieSettings, DBreezeConfiguration configuration)
{
if (trieSettings.StorageWasOverriden)
{
switch (trieSettings.AlternativeTableStorageType)
{
case DBreezeConfiguration.eStorage.DISK:
_tableStorage = (IStorage) new FSR(fileName, trieSettings, configuration);
break;
case DBreezeConfiguration.eStorage.MEMORY:
_tableStorage = (IStorage)new MSR(fileName, trieSettings, configuration);
break;
case DBreezeConfiguration.eStorage.RemoteInstance:
_tableStorage = (IStorage)new RISR(fileName, trieSettings, configuration);
break;
}
}
else
{
switch (configuration.Storage)
{
case DBreezeConfiguration.eStorage.DISK:
_tableStorage = (IStorage)new FSR(fileName, trieSettings, configuration);
break;
case DBreezeConfiguration.eStorage.MEMORY:
_tableStorage = (IStorage)new MSR(fileName, trieSettings, configuration);
break;
case DBreezeConfiguration.eStorage.RemoteInstance:
_tableStorage = (IStorage)new RISR(fileName, trieSettings, configuration);
break;
}
}
}