2011-01-09 16:45:16 -05:00
|
|
|
/*
|
|
|
|
|
2015-02-19 03:19:51 -05:00
|
|
|
Copyright (c) 2014, Project OSRM contributors
|
2013-10-14 07:42:28 -04:00
|
|
|
All rights reserved.
|
2011-01-09 16:45:16 -05:00
|
|
|
|
2013-10-14 07:42:28 -04:00
|
|
|
Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
are permitted provided that the following conditions are met:
|
2011-01-09 16:45:16 -05:00
|
|
|
|
2013-10-14 07:42:28 -04:00
|
|
|
Redistributions of source code must retain the above copyright notice, this list
|
|
|
|
of conditions and the following disclaimer.
|
|
|
|
Redistributions in binary form must reproduce the above copyright notice, this
|
|
|
|
list of conditions and the following disclaimer in the documentation and/or
|
|
|
|
other materials provided with the distribution.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
|
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
*/
|
2011-01-09 16:45:16 -05:00
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#ifndef SEARCH_ENGINE_HPP
|
|
|
|
#define SEARCH_ENGINE_HPP
|
2011-01-09 16:45:16 -05:00
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#include "search_engine_data.hpp"
|
2014-11-28 09:33:08 -05:00
|
|
|
#include "../routing_algorithms/alternative_path.hpp"
|
|
|
|
#include "../routing_algorithms/many_to_many.hpp"
|
2014-09-23 12:46:14 -04:00
|
|
|
#include "../routing_algorithms/map_matching.hpp"
|
2014-11-28 09:33:08 -05:00
|
|
|
#include "../routing_algorithms/shortest_path.hpp"
|
2015-07-13 15:09:19 -04:00
|
|
|
#include "../routing_algorithms/direct_shortest_path.hpp"
|
2012-06-15 12:47:27 -04:00
|
|
|
|
2014-05-22 08:41:27 -04:00
|
|
|
#include <type_traits>
|
|
|
|
|
2014-05-07 12:39:16 -04:00
|
|
|
template <class DataFacadeT> class SearchEngine
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
DataFacadeT *facade;
|
2013-09-19 12:52:42 -04:00
|
|
|
SearchEngineData engine_working_data;
|
2014-05-07 12:39:16 -04:00
|
|
|
|
|
|
|
public:
|
2013-09-19 12:52:42 -04:00
|
|
|
ShortestPathRouting<DataFacadeT> shortest_path;
|
2015-07-13 15:09:19 -04:00
|
|
|
DirectShortestPathRouting<DataFacadeT> direct_shortest_path;
|
2014-05-07 12:39:16 -04:00
|
|
|
AlternativeRouting<DataFacadeT> alternative_path;
|
2014-05-16 10:09:40 -04:00
|
|
|
ManyToManyRouting<DataFacadeT> distance_table;
|
2014-09-23 12:46:14 -04:00
|
|
|
MapMatching<DataFacadeT> map_matching;
|
2011-12-31 10:18:52 -05:00
|
|
|
|
2014-05-07 12:39:16 -04:00
|
|
|
explicit SearchEngine(DataFacadeT *facade)
|
2014-09-23 12:46:14 -04:00
|
|
|
: facade(facade),
|
|
|
|
shortest_path(facade, engine_working_data),
|
2015-07-13 15:09:19 -04:00
|
|
|
direct_shortest_path(facade, engine_working_data),
|
2014-09-23 12:46:14 -04:00
|
|
|
alternative_path(facade, engine_working_data),
|
|
|
|
distance_table(facade, engine_working_data),
|
|
|
|
map_matching(facade, engine_working_data)
|
2014-05-07 12:39:16 -04:00
|
|
|
{
|
2014-06-05 12:55:22 -04:00
|
|
|
static_assert(!std::is_pointer<DataFacadeT>::value, "don't instantiate with ptr type");
|
2015-02-19 03:19:51 -05:00
|
|
|
static_assert(std::is_object<DataFacadeT>::value,
|
|
|
|
"don't instantiate with void, function, or reference");
|
2014-05-07 12:39:16 -04:00
|
|
|
}
|
2011-12-31 10:18:52 -05:00
|
|
|
|
2013-09-19 12:52:42 -04:00
|
|
|
~SearchEngine() {}
|
|
|
|
};
|
2011-12-31 10:18:52 -05:00
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#endif // SEARCH_ENGINE_HPP
|