![]() |
vrpRouting
0.3
|
Connecting code with postgres. More...
#include <assert.h>
#include <stdbool.h>
#include "c_common/postgres_connection.h"
#include <utils/array.h>
#include "catalog/pg_type.h"
#include "utils/lsyscache.h"
#include "c_common/debug_macro.h"
#include "c_common/e_report.h"
#include "c_common/time_msg.h"
#include "c_types/vroom/vroom_rt.h"
#include "c_types/vroom/vroom_job_t.h"
#include "c_types/vroom/vroom_shipment_t.h"
#include "c_types/vroom/vroom_vehicle_t.h"
#include "c_types/vroom/vroom_matrix_t.h"
#include "c_common/vroom/jobs_input.h"
#include "c_common/vroom/breaks_input.h"
#include "c_common/vroom/time_windows_input.h"
#include "c_common/vroom/shipments_input.h"
#include "c_common/vroom/vehicles_input.h"
#include "c_common/vroom/matrix_input.h"
#include "drivers/vroom/vroom_driver.h"
Go to the source code of this file.
Macros | |
#define | INT8ARRAYOID 1016 |
Functions | |
PGDLLEXPORT Datum | _vrp_vroom (PG_FUNCTION_ARGS) |
Helps in converting postgres variables to C variables, and returns the result. More... | |
PG_FUNCTION_INFO_V1 (_vrp_vroom) | |
static void | process (char *jobs_sql, char *jobs_tws_sql, char *shipments_sql, char *shipments_tws_sql, char *vehicles_sql, char *breaks_sql, char *breaks_tws_sql, char *matrix_sql, int32_t exploration_level, int32_t timeout, int16_t fn, bool is_plain, Vroom_rt **result_tuples, size_t *result_count) |
Static function, loads the data from postgres to C types for further processing. More... | |
Connecting code with postgres.
Definition in file vroom.c.
PGDLLEXPORT Datum _vrp_vroom | ( | PG_FUNCTION_ARGS | ) |
Helps in converting postgres variables to C variables, and returns the result.
Definition at line 255 of file vroom.c.
References if(), INT8ARRAYOID, and process().
PG_FUNCTION_INFO_V1 | ( | _vrp_vroom | ) |
|
static |
Static function, loads the data from postgres to C types for further processing.
It first connects the C function to the SPI manager. Then converts the postgres array to C array and loads the edges belonging to the graph in C types. Then it calls the function do_vrp_vroom
defined in the vroom_driver.h
file for further processing. Finally, it frees the memory and disconnects the C function to the SPI manager.
jobs_sql | SQL query describing the jobs |
jobs_tw_sql | SQL query describing the time window for jobs |
shipments_sql | SQL query describing the shipments |
shipments_tw_sql | SQL query describing the time windows for shipment |
vehicles_sql | SQL query describing the vehicles |
breaks_sql | SQL query describing the driver breaks. |
breaks_tws_sql | SQL query describing the time windows for break start. |
matrix_sql | SQL query describing the cells of the cost matrix |
exploration_level | Exploration level to use while solving. |
timeout | Timeout value to stop the solving process. |
fn | Value denoting the function used. |
is_plain | Value denoting whether the plain/timestamp function is used. |
result_tuples | the rows in the result |
result_count | the count of rows in the result |
Definition at line 95 of file vroom.c.
References do_vrp_vroom(), get_vroom_breaks(), get_vroom_jobs(), get_vroom_matrix(), get_vroom_shipments(), get_vroom_shipments_time_windows(), get_vroom_time_windows(), get_vroom_vehicles(), pgr_global_report(), pgr_SPI_connect(), pgr_SPI_finish(), and time_msg().
Referenced by _vrp_vroom().