break out OriginalEdgeData class into its own include
This commit is contained in:
parent
dd104a49f6
commit
ca17efd764
@ -36,6 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "../DataStructures/EdgeBasedNode.h"
|
||||
#include "../DataStructures/HashTable.h"
|
||||
#include "../DataStructures/ImportEdge.h"
|
||||
#include "../DataStructures/OriginalEdgeData.h"
|
||||
#include "../DataStructures/Percent.h"
|
||||
#include "../DataStructures/QueryEdge.h"
|
||||
#include "../DataStructures/TurnInstructions.h"
|
||||
|
@ -28,23 +28,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef QUERYEDGE_H_
|
||||
#define QUERYEDGE_H_
|
||||
|
||||
#include "TurnInstructions.h"
|
||||
#include "../typedefs.h"
|
||||
|
||||
#include <climits>
|
||||
|
||||
struct OriginalEdgeData{
|
||||
explicit OriginalEdgeData(
|
||||
NodeID viaNode,
|
||||
unsigned nameID,
|
||||
TurnInstruction turnInstruction
|
||||
) : viaNode(viaNode), nameID(nameID), turnInstruction(turnInstruction) {}
|
||||
OriginalEdgeData() : viaNode(UINT_MAX), nameID(UINT_MAX), turnInstruction(UCHAR_MAX) {}
|
||||
NodeID viaNode;
|
||||
unsigned nameID;
|
||||
TurnInstruction turnInstruction;
|
||||
};
|
||||
|
||||
struct QueryEdge {
|
||||
NodeID source;
|
||||
NodeID target;
|
||||
@ -64,9 +51,14 @@ struct QueryEdge {
|
||||
}
|
||||
|
||||
bool operator== ( const QueryEdge& right ) const {
|
||||
return ( source == right.source && target == right.target && data.distance == right.data.distance &&
|
||||
data.shortcut == right.data.shortcut && data.forward == right.data.forward && data.backward == right.data.backward
|
||||
&& data.id == right.data.id
|
||||
return (
|
||||
source == right.source &&
|
||||
target == right.target &&
|
||||
data.distance == right.data.distance &&
|
||||
data.shortcut == right.data.shortcut &&
|
||||
data.forward == right.data.forward &&
|
||||
data.backward == right.data.backward &&
|
||||
data.id == right.data.id
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "BaseDataFacade.h"
|
||||
|
||||
#include "../../DataStructures/Coordinate.h"
|
||||
#include "../../DataStructures/OriginalEdgeData.h"
|
||||
#include "../../DataStructures/QueryNode.h"
|
||||
#include "../../DataStructures/QueryEdge.h"
|
||||
#include "../../DataStructures/SharedMemoryVectorWrapper.h"
|
||||
@ -154,9 +155,9 @@ private:
|
||||
(char*)&(current_edge_data),
|
||||
sizeof(OriginalEdgeData)
|
||||
);
|
||||
m_via_node_list[i] = current_edge_data.viaNode;
|
||||
m_name_ID_list[i] = current_edge_data.nameID;
|
||||
m_turn_instruction_list[i] = current_edge_data.turnInstruction;
|
||||
m_via_node_list[i] = current_edge_data.via_node;
|
||||
m_name_ID_list[i] = current_edge_data.name_id;
|
||||
m_turn_instruction_list[i] = current_edge_data.turn_instruction;
|
||||
}
|
||||
edges_input_stream.close();
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
|
||||
RequestHandler::RequestHandler() : routing_machine(NULL) { }
|
||||
|
||||
@ -60,14 +59,14 @@ void RequestHandler::handle_request(const http::Request& req, http::Reply& rep){
|
||||
req.referrer << ( 0 == req.referrer.length() ? "- " :" ") <<
|
||||
req.agent << ( 0 == req.agent.length() ? "- " :" ") << req.uri;
|
||||
|
||||
RouteParameters routeParameters;
|
||||
APIGrammarParser apiParser(&routeParameters);
|
||||
RouteParameters route_parameters;
|
||||
APIGrammarParser api_parser(&route_parameters);
|
||||
|
||||
std::string::iterator it = request.begin();
|
||||
const bool result = boost::spirit::qi::parse(
|
||||
it,
|
||||
request.end(),
|
||||
apiParser
|
||||
api_parser
|
||||
);
|
||||
|
||||
if ( !result || (it != request.end()) ) {
|
||||
@ -93,10 +92,10 @@ void RequestHandler::handle_request(const http::Request& req, http::Reply& rep){
|
||||
routing_machine != NULL,
|
||||
"pointer not init'ed"
|
||||
);
|
||||
routing_machine->RunQuery(routeParameters, rep);
|
||||
routing_machine->RunQuery(route_parameters, rep);
|
||||
return;
|
||||
}
|
||||
} catch(std::exception& e) {
|
||||
} catch(const std::exception& e) {
|
||||
rep = http::Reply::StockReply(http::Reply::internalServerError);
|
||||
SimpleLogger().Write(logWARNING) <<
|
||||
"[server error] code: " << e.what() << ", uri: " << req.uri;
|
||||
|
@ -25,6 +25,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#include "DataStructures/OriginalEdgeData.h"
|
||||
#include "DataStructures/QueryEdge.h"
|
||||
#include "DataStructures/SharedMemoryFactory.h"
|
||||
#include "DataStructures/SharedMemoryVectorWrapper.h"
|
||||
@ -324,9 +325,9 @@ int main( const int argc, const char * argv[] ) {
|
||||
(char*)&(current_edge_data),
|
||||
sizeof(OriginalEdgeData)
|
||||
);
|
||||
via_node_ptr[i] = current_edge_data.viaNode;
|
||||
name_id_ptr[i] = current_edge_data.nameID;
|
||||
turn_instructions_ptr[i] = current_edge_data.turnInstruction;
|
||||
via_node_ptr[i] = current_edge_data.via_node;
|
||||
name_id_ptr[i] = current_edge_data.name_id;
|
||||
turn_instructions_ptr[i] = current_edge_data.turn_instruction;
|
||||
}
|
||||
edges_input_stream.close();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user