2013-09-17 12:35:43 -04:00
|
|
|
/*
|
|
|
|
open source routing machine
|
|
|
|
Copyright (C) Dennis Luxen, others 2010
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU AFFERO General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
or see http://www.gnu.org/licenses/agpl.txt.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QUERY_DATA_FACADE_H
|
|
|
|
#define QUERY_DATA_FACADE_H
|
|
|
|
|
|
|
|
//Exposes all data access interfaces to the algorithms via base class ptr
|
|
|
|
|
|
|
|
#include "../../DataStructures/Coordinate.h"
|
|
|
|
#include "../../DataStructures/PhantomNodes.h"
|
|
|
|
#include "../../DataStructures/TurnInstructions.h"
|
2013-09-18 11:49:49 -04:00
|
|
|
#include "../../Util/OSRMException.h"
|
2013-09-17 12:35:43 -04:00
|
|
|
#include "../../typedefs.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2013-09-17 12:45:33 -04:00
|
|
|
template<class EdgeDataT>
|
2013-09-17 12:55:53 -04:00
|
|
|
class BaseDataFacade {
|
2013-09-17 12:35:43 -04:00
|
|
|
public:
|
2013-09-17 12:55:53 -04:00
|
|
|
BaseDataFacade() { }
|
|
|
|
virtual ~BaseDataFacade() { }
|
2013-09-17 12:35:43 -04:00
|
|
|
|
|
|
|
//search graph access
|
2013-09-17 12:45:33 -04:00
|
|
|
virtual unsigned GetNumberOfNodes() const = 0;
|
|
|
|
|
|
|
|
virtual unsigned GetNumberOfEdges() const = 0;
|
|
|
|
|
|
|
|
virtual unsigned GetOutDegree( const NodeID n ) const = 0;
|
|
|
|
|
|
|
|
virtual NodeID GetTarget( const EdgeID e ) const = 0;
|
|
|
|
|
|
|
|
virtual EdgeDataT &GetEdgeData( const EdgeID e ) = 0;
|
|
|
|
|
|
|
|
virtual const EdgeDataT &GetEdgeData( const EdgeID e ) const = 0;
|
|
|
|
|
|
|
|
virtual EdgeID BeginEdges( const NodeID n ) const = 0;
|
|
|
|
|
|
|
|
virtual EdgeID EndEdges( const NodeID n ) const = 0;
|
|
|
|
|
|
|
|
//searches for a specific edge
|
|
|
|
virtual EdgeID FindEdge( const NodeID from, const NodeID to ) const = 0;
|
|
|
|
|
|
|
|
virtual EdgeID FindEdgeInEitherDirection(
|
|
|
|
const NodeID from,
|
|
|
|
const NodeID to
|
|
|
|
) const = 0;
|
|
|
|
|
|
|
|
virtual EdgeID FindEdgeIndicateIfReverse(
|
|
|
|
const NodeID from,
|
|
|
|
const NodeID to,
|
|
|
|
bool & result
|
|
|
|
) const = 0;
|
|
|
|
|
2013-09-17 12:55:53 -04:00
|
|
|
<<<<<<< HEAD
|
2013-09-17 12:45:33 -04:00
|
|
|
>>>>>>> added graph data access
|
|
|
|
|
|
|
|
virtual unsigned GetNumberOfEdges() const = 0;
|
2013-09-17 12:55:53 -04:00
|
|
|
=======
|
|
|
|
//node and edge information access
|
|
|
|
virtual FixedPointCoordinate GetCoordinateOfNode(
|
|
|
|
const unsigned id
|
|
|
|
) const = 0;
|
|
|
|
>>>>>>> plugging in base facade ptr
|
2013-09-17 12:45:33 -04:00
|
|
|
|
|
|
|
virtual unsigned GetOutDegree( const NodeID n ) const = 0;
|
|
|
|
|
|
|
|
virtual NodeID GetTarget( const EdgeID e ) const = 0;
|
|
|
|
|
|
|
|
virtual EdgeDataT &GetEdgeData( const EdgeID e ) = 0;
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
virtual const EdgeDataT &GetEdgeData( const EdgeID e ) const = 0;
|
|
|
|
|
|
|
|
virtual EdgeID BeginEdges( const NodeID n ) const = 0;
|
|
|
|
=======
|
|
|
|
virtual bool LocateClosestEndPointForCoordinate(
|
|
|
|
const FixedPointCoordinate& input_coordinate,
|
|
|
|
FixedPointCoordinate& result,
|
|
|
|
const unsigned zoom_level = 18
|
|
|
|
) const = 0;
|
|
|
|
>>>>>>> added graph data access
|
|
|
|
|
|
|
|
virtual EdgeID EndEdges( const NodeID n ) const = 0;
|
|
|
|
|
|
|
|
//searches for a specific edge
|
|
|
|
virtual EdgeID FindEdge( const NodeID from, const NodeID to ) const = 0;
|
|
|
|
|
|
|
|
virtual EdgeID FindEdgeInEitherDirection(
|
|
|
|
const NodeID from,
|
|
|
|
const NodeID to
|
|
|
|
) const = 0;
|
2013-09-17 12:55:53 -04:00
|
|
|
<<<<<<< HEAD
|
2013-09-17 12:45:33 -04:00
|
|
|
|
|
|
|
virtual EdgeID FindEdgeIndicateIfReverse(
|
|
|
|
const NodeID from,
|
|
|
|
const NodeID to,
|
|
|
|
bool & result
|
|
|
|
) const = 0;
|
2013-09-17 12:55:53 -04:00
|
|
|
=======
|
|
|
|
};
|
|
|
|
>>>>>>> plugging in base facade ptr
|
2013-09-17 12:45:33 -04:00
|
|
|
|
2013-09-17 12:35:43 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QUERY_DATA_FACADE_H
|