2013-06-26 20:05:42 -04:00
|
|
|
/*
|
2013-10-14 07:42:28 -04:00
|
|
|
|
|
|
|
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
are permitted provided that the following conditions are met:
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
*/
|
2013-06-26 20:05:42 -04:00
|
|
|
|
|
|
|
#ifndef OSRM_H
|
|
|
|
#define OSRM_H
|
|
|
|
|
|
|
|
#include "OSRM.h"
|
|
|
|
|
|
|
|
#include "../Plugins/BasePlugin.h"
|
|
|
|
#include "../Plugins/HelloWorldPlugin.h"
|
|
|
|
#include "../Plugins/LocatePlugin.h"
|
|
|
|
#include "../Plugins/NearestPlugin.h"
|
|
|
|
#include "../Plugins/TimestampPlugin.h"
|
|
|
|
#include "../Plugins/ViaRoutePlugin.h"
|
2013-08-14 07:54:59 -04:00
|
|
|
#include "../Server/DataStructures/RouteParameters.h"
|
2013-07-05 16:36:51 -04:00
|
|
|
#include "../Util/InputFileUtil.h"
|
2013-08-08 09:57:16 -04:00
|
|
|
#include "../Util/OSRMException.h"
|
2013-08-19 16:41:46 -04:00
|
|
|
#include "../Util/ProgramOptions.h"
|
2013-08-08 09:57:16 -04:00
|
|
|
#include "../Util/SimpleLogger.h"
|
2013-07-03 10:01:59 -04:00
|
|
|
#include "../Server/BasicDatastructures.h"
|
2013-06-26 20:05:42 -04:00
|
|
|
|
|
|
|
#include <boost/assert.hpp>
|
2013-07-31 16:05:44 -04:00
|
|
|
#include <boost/filesystem.hpp>
|
2013-06-26 20:05:42 -04:00
|
|
|
#include <boost/noncopyable.hpp>
|
|
|
|
#include <boost/thread.hpp>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class OSRM : boost::noncopyable {
|
|
|
|
typedef boost::unordered_map<std::string, BasePlugin *> PluginMap;
|
2013-07-03 10:56:52 -04:00
|
|
|
QueryObjectsStorage * objects;
|
2013-06-26 20:05:42 -04:00
|
|
|
public:
|
2013-09-17 12:37:08 -04:00
|
|
|
OSRM(
|
|
|
|
boost::unordered_map<const std::string,
|
|
|
|
boost::filesystem::path>& paths,
|
|
|
|
const bool use_shared_memory = false
|
|
|
|
);
|
2013-06-26 20:05:42 -04:00
|
|
|
~OSRM();
|
|
|
|
void RunQuery(RouteParameters & route_parameters, http::Reply & reply);
|
|
|
|
private:
|
|
|
|
void RegisterPlugin(BasePlugin * plugin);
|
|
|
|
PluginMap pluginMap;
|
2013-09-17 12:37:08 -04:00
|
|
|
const bool use_shared_memory;
|
2013-06-26 20:05:42 -04:00
|
|
|
};
|
|
|
|
|
2013-08-08 09:57:16 -04:00
|
|
|
#endif //OSRM_H
|