renamed: Util/OSRMException.h -> Util/osrm_exception.hpp
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2014, Project OSRM, Dennis Luxen, others
|
||||
Copyright (c) 2015, Project OSRM, Dennis Luxen, others
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
@@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "../Util/integer_range.hpp"
|
||||
#include "../Util/graph_loader.hpp"
|
||||
#include "../Util/simple_logger.hpp"
|
||||
#include "../Util/OSRMException.h"
|
||||
#include "../Util/osrm_exception.hpp"
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
|
||||
const EdgeID edge_id_1 = m_query_graph->FindEdgeInEitherDirection(node_u, data.id);
|
||||
if (SPECIAL_EDGEID == edge_id_1)
|
||||
{
|
||||
throw OSRMException("cannot find first segment of edge (" +
|
||||
throw osrm::exception("cannot find first segment of edge (" +
|
||||
std::to_string(node_u) + "," + std::to_string(data.id) +
|
||||
"," + std::to_string(node_v) + "), eid: " +
|
||||
std::to_string(eid));
|
||||
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
|
||||
const EdgeID edge_id_2 = m_query_graph->FindEdgeInEitherDirection(data.id, node_v);
|
||||
if (SPECIAL_EDGEID == edge_id_2)
|
||||
{
|
||||
throw OSRMException("cannot find second segment of edge (" +
|
||||
throw osrm::exception("cannot find second segment of edge (" +
|
||||
std::to_string(node_u) + "," + std::to_string(data.id) +
|
||||
"," + std::to_string(node_v) + "), eid: " +
|
||||
std::to_string(eid));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2014, Project OSRM, Dennis Luxen, others
|
||||
Copyright (c) 2015, Project OSRM, Dennis Luxen, others
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
@@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "../data_structures/dynamic_graph.hpp"
|
||||
#include "../Util/graph_loader.hpp"
|
||||
#include "../Util/make_unique.hpp"
|
||||
#include "../Util/OSRMException.h"
|
||||
#include "../Util/osrm_exception.hpp"
|
||||
#include "../Util/simple_logger.hpp"
|
||||
#include "../Util/FingerPrint.h"
|
||||
|
||||
@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!restriction_ifstream.good())
|
||||
{
|
||||
throw OSRMException("Could not access <osrm-restrictions> files");
|
||||
throw osrm::exception("Could not access <osrm-restrictions> files");
|
||||
}
|
||||
uint32_t usable_restrictions = 0;
|
||||
restriction_ifstream.read((char *)&usable_restrictions, sizeof(uint32_t));
|
||||
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
|
||||
std::ifstream input_stream(argv[1], std::ifstream::in | std::ifstream::binary);
|
||||
if (!input_stream.is_open())
|
||||
{
|
||||
throw OSRMException("Cannot open osrm file");
|
||||
throw osrm::exception("Cannot open osrm file");
|
||||
}
|
||||
|
||||
// load graph data
|
||||
@@ -206,13 +206,13 @@ int main(int argc, char *argv[])
|
||||
OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(pszDriverName);
|
||||
if (nullptr == poDriver)
|
||||
{
|
||||
throw OSRMException("ESRI Shapefile driver not available");
|
||||
throw osrm::exception("ESRI Shapefile driver not available");
|
||||
}
|
||||
OGRDataSource *poDS = poDriver->CreateDataSource("component.shp", nullptr);
|
||||
|
||||
if (nullptr == poDS)
|
||||
{
|
||||
throw OSRMException("Creation of output file failed");
|
||||
throw osrm::exception("Creation of output file failed");
|
||||
}
|
||||
|
||||
OGRSpatialReference *poSRS = new OGRSpatialReference();
|
||||
@@ -222,7 +222,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (nullptr == poLayer)
|
||||
{
|
||||
throw OSRMException("Layer creation failed.");
|
||||
throw osrm::exception("Layer creation failed.");
|
||||
}
|
||||
TIMER_STOP(SCC_RUN_SETUP);
|
||||
SimpleLogger().Write() << "shapefile setup took " << TIMER_MSEC(SCC_RUN_SETUP)/1000. << "s";
|
||||
@@ -268,7 +268,7 @@ int main(int argc, char *argv[])
|
||||
poFeature->SetGeometry(&lineString);
|
||||
if (OGRERR_NONE != poLayer->CreateFeature(poFeature))
|
||||
{
|
||||
throw OSRMException("Failed to create feature in shapefile.");
|
||||
throw osrm::exception("Failed to create feature in shapefile.");
|
||||
}
|
||||
OGRFeature::DestroyFeature(poFeature);
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
|
||||
Copyright (c) 2015, Project OSRM, Dennis Luxen, others
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
@@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "../Util/git_sha.hpp"
|
||||
#include "../Util/OSRMException.h"
|
||||
#include "../Util/osrm_exception.hpp"
|
||||
#include "../Util/simple_logger.hpp"
|
||||
#include "../Util/timing_util.hpp"
|
||||
|
||||
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
|
||||
// create file to test
|
||||
if (boost::filesystem::exists(test_path))
|
||||
{
|
||||
throw OSRMException("Data file already exists");
|
||||
throw osrm::exception("Data file already exists");
|
||||
}
|
||||
|
||||
int *random_array = new int[number_of_elements];
|
||||
@@ -121,13 +121,13 @@ int main(int argc, char *argv[])
|
||||
open(test_path.string().c_str(), O_CREAT | O_TRUNC | O_WRONLY | O_SYNC, S_IRWXU);
|
||||
if (-1 == file_desc)
|
||||
{
|
||||
throw OSRMException("Could not open random data file");
|
||||
throw osrm::exception("Could not open random data file");
|
||||
}
|
||||
TIMER_START(write_1gb);
|
||||
int ret = write(file_desc, random_array, number_of_elements * sizeof(unsigned));
|
||||
if (0 > ret)
|
||||
{
|
||||
throw OSRMException("could not write random data file");
|
||||
throw osrm::exception("could not write random data file");
|
||||
}
|
||||
TIMER_STOP(write_1gb);
|
||||
close(file_desc);
|
||||
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
||||
// Run Non-Cached I/O benchmarks
|
||||
if (!boost::filesystem::exists(test_path))
|
||||
{
|
||||
throw OSRMException("data file does not exist");
|
||||
throw osrm::exception("data file does not exist");
|
||||
}
|
||||
|
||||
// volatiles do not get optimized
|
||||
@@ -228,13 +228,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
SimpleLogger().Write(logWARNING) << "seek error " << strerror(errno);
|
||||
throw OSRMException("seek error");
|
||||
throw osrm::exception("seek error");
|
||||
}
|
||||
if (-1 == ret2)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
SimpleLogger().Write(logWARNING) << "read error " << strerror(errno);
|
||||
throw OSRMException("read error");
|
||||
throw osrm::exception("read error");
|
||||
}
|
||||
timing_results_raw_random.push_back(TIMER_SEC(random_access));
|
||||
}
|
||||
@@ -289,13 +289,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
SimpleLogger().Write(logWARNING) << "seek error " << strerror(errno);
|
||||
throw OSRMException("seek error");
|
||||
throw osrm::exception("seek error");
|
||||
}
|
||||
if (-1 == ret2)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
SimpleLogger().Write(logWARNING) << "read error " << strerror(errno);
|
||||
throw OSRMException("read error");
|
||||
throw osrm::exception("read error");
|
||||
}
|
||||
timing_results_raw_seq.push_back(TIMER_SEC(read_every_100));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user