Only allow to specify the common base path

This commit is contained in:
Patrick Niklaus
2016-03-22 19:30:18 +01:00
parent 1b1274fd56
commit cb8bfa027e
16 changed files with 392 additions and 661 deletions
+4 -4
View File
@@ -1,24 +1,24 @@
#ifndef STORAGE_HPP
#define STORAGE_HPP
#include "storage/storage_config.hpp"
#include <boost/filesystem/path.hpp>
#include <unordered_map>
#include <string>
namespace osrm
{
namespace storage
{
using DataPaths = std::unordered_map<std::string, boost::filesystem::path>;
class Storage
{
public:
Storage(const DataPaths &data_paths);
Storage(StorageConfig config);
int Run();
private:
DataPaths paths;
StorageConfig config;
};
}
}
+34
View File
@@ -0,0 +1,34 @@
#ifndef STORAGE_CONFIG_HPP
#define STORAGE_CONFIG_HPP
#include <boost/filesystem/path.hpp>
#include <string>
namespace osrm
{
namespace storage
{
struct StorageConfig
{
StorageConfig() = default;
StorageConfig(const boost::filesystem::path &base);
bool IsValid() const;
std::string ram_index_path;
std::string file_index_path;
std::string hsgr_data_path;
std::string nodes_data_path;
std::string edges_data_path;
std::string core_data_path;
std::string geometries_path;
std::string timestamp_path;
std::string datasource_names_path;
std::string datasource_indexes_path;
std::string names_data_path;
std::string properties_path;
};
}
}
#endif