pimpl OSRM lib with std::unique_ptr
This commit is contained in:
parent
881041800b
commit
f6f0de0e38
@ -30,6 +30,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <osrm/ServerPaths.h>
|
#include <osrm/ServerPaths.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
class OSRM_impl;
|
class OSRM_impl;
|
||||||
struct RouteParameters;
|
struct RouteParameters;
|
||||||
|
|
||||||
@ -41,7 +43,7 @@ class Reply;
|
|||||||
class OSRM
|
class OSRM
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
OSRM_impl *OSRM_pimpl_;
|
std::unique_ptr<OSRM_impl> OSRM_pimpl_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit OSRM(const ServerPaths &paths, const bool use_shared_memory = false);
|
explicit OSRM(const ServerPaths &paths, const bool use_shared_memory = false);
|
||||||
|
@ -45,6 +45,7 @@ namespace boost { namespace interprocess { class named_mutex; } }
|
|||||||
#include "../Server/DataStructures/InternalDataFacade.h"
|
#include "../Server/DataStructures/InternalDataFacade.h"
|
||||||
#include "../Server/DataStructures/SharedBarriers.h"
|
#include "../Server/DataStructures/SharedBarriers.h"
|
||||||
#include "../Server/DataStructures/SharedDataFacade.h"
|
#include "../Server/DataStructures/SharedDataFacade.h"
|
||||||
|
#include "../Util/make_unique.hpp"
|
||||||
#include "../Util/SimpleLogger.h"
|
#include "../Util/SimpleLogger.h"
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
@ -155,11 +156,11 @@ void OSRM_impl::RunQuery(RouteParameters &route_parameters, http::Reply &reply)
|
|||||||
// proxy code for compilation firewall
|
// proxy code for compilation firewall
|
||||||
|
|
||||||
OSRM::OSRM(const ServerPaths &paths, const bool use_shared_memory)
|
OSRM::OSRM(const ServerPaths &paths, const bool use_shared_memory)
|
||||||
: OSRM_pimpl_(new OSRM_impl(paths, use_shared_memory))
|
: OSRM_pimpl_(osrm::make_unique<OSRM_impl>(paths, use_shared_memory))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
OSRM::~OSRM() { delete OSRM_pimpl_; }
|
OSRM::~OSRM() { OSRM_pimpl_.reset(); }
|
||||||
|
|
||||||
void OSRM::RunQuery(RouteParameters &route_parameters, http::Reply &reply)
|
void OSRM::RunQuery(RouteParameters &route_parameters, http::Reply &reply)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user