vrpRouting  0.3
orders_input.h File Reference
#include <stddef.h>
Include dependency graph for orders_input.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct PickDeliveryOrders_t PickDeliveryOrders_t
 

Functions

void get_shipments (char *, PickDeliveryOrders_t **, size_t *)
 Reads the pick-Deliver shipments for timestams and intervals. More...
 
void get_shipments_euclidean (char *, PickDeliveryOrders_t **, size_t *)
 Reads the pick-Deliver shipments for euclidean information. More...
 
void get_shipments_raw (char *, PickDeliveryOrders_t **, size_t *)
 Reads the pick-Deliver shipments for raw data. More...
 

Typedef Documentation

◆ PickDeliveryOrders_t

Definition at line 30 of file orders_input.h.

Function Documentation

◆ get_shipments()

void get_shipments ( char *  sql,
PickDeliveryOrders_t **  rows,
size_t *  total_rows 
)

Reads the pick-Deliver shipments for timestams and intervals.

Parameters
[in]sqlSQL query to execute
[out]rowsC Container that holds the data
[out]total_rowsTotal rows recieved

Definition at line 331 of file orders_input.c.

334  {
335  const int column_count = 10;
336  Column_info_t info[10];
337 
338  for (int i = 0; i < column_count; ++i) {
339  info[i].colNumber = -1;
340  info[i].type = 0;
341  info[i].strict = true;
342  info[i].eType = ANY_INTEGER;
343  }
344 
345  info[0].name = "id";
346  info[1].name = "amount";
347  info[2].name = "p_id";
348  info[3].name = "p_tw_open";
349  info[4].name = "p_tw_close";
350  info[5].name = "p_t_service";
351  info[6].name = "d_id";
352  info[7].name = "d_tw_open";
353  info[8].name = "d_tw_close";
354  info[9].name = "d_t_service";
355 
356  info[3].eType = TIMESTAMP;
357  info[4].eType = TIMESTAMP;
358  info[7].eType = TIMESTAMP;
359  info[8].eType = TIMESTAMP;
360  info[5].eType = INTERVAL;
361  info[9].eType = INTERVAL;
362 
363  /* service is optional*/
364  info[5].strict = false;
365  info[9].strict = false;
366 
367  pgr_get_pd_orders_general(sql, rows, total_rows, info, column_count, 0);
368 }

References ANY_INTEGER, Column_info_t::colNumber, Column_info_t::eType, INTERVAL, Column_info_t::name, pgr_get_pd_orders_general(), Column_info_t::strict, TIMESTAMP, and Column_info_t::type.

Referenced by process().

◆ get_shipments_euclidean()

void get_shipments_euclidean ( char *  sql,
PickDeliveryOrders_t **  rows,
size_t *  total_rows 
)

Reads the pick-Deliver shipments for euclidean information.

Parameters
[in]sqlSQL query to execute
[out]rowsC Container that holds the data
[out]total_rowsTotal rows recieved

Definition at line 414 of file orders_input.c.

417  {
418  const int column_count = 12;
419  Column_info_t info[12];
420 
421  for (int i = 0; i < column_count; ++i) {
422  info[i].colNumber = -1;
423  info[i].type = 0;
424  info[i].strict = true;
425  info[i].eType = ANY_INTEGER;
426  }
427 
428  info[0].name = "id";
429  info[1].name = "amount";
430  info[2].name = "p_open";
431  info[3].name = "p_close";
432  info[4].name = "p_service";
433  info[5].name = "d_open";
434  info[6].name = "d_close";
435  info[7].name = "d_service";
436  info[8].name = "p_x";
437  info[9].name = "p_y";
438  info[10].name = "d_x";
439  info[11].name = "d_y";
440 
441  /* service is optional*/
442  info[4].strict = false;
443  info[7].strict = false;
444 
445  /* (x,y) are ignored*/
446  info[8].eType = ANY_NUMERICAL;
447  info[9].eType = ANY_NUMERICAL;
448  info[10].eType = ANY_NUMERICAL;
449  info[11].eType = ANY_NUMERICAL;
450 
451  pgr_get_pd_orders_general(sql, rows, total_rows, info, column_count, 2);
452 }

References ANY_INTEGER, ANY_NUMERICAL, Column_info_t::colNumber, Column_info_t::eType, Column_info_t::name, pgr_get_pd_orders_general(), Column_info_t::strict, and Column_info_t::type.

Referenced by process().

◆ get_shipments_raw()

void get_shipments_raw ( char *  sql,
PickDeliveryOrders_t **  rows,
size_t *  total_rows 
)

Reads the pick-Deliver shipments for raw data.

Parameters
[in]sqlSQL query to execute
[out]rowsC Container that holds the data
[out]total_rowsTotal rows recieved

Definition at line 376 of file orders_input.c.

379  {
380  const int column_count = 10;
381  Column_info_t info[10];
382 
383  for (int i = 0; i < column_count; ++i) {
384  info[i].colNumber = -1;
385  info[i].type = 0;
386  info[i].strict = true;
387  info[i].eType = ANY_INTEGER;
388  }
389 
390  info[0].name = "id";
391  info[1].name = "amount";
392  info[2].name = "p_open";
393  info[3].name = "p_close";
394  info[4].name = "p_service";
395  info[5].name = "d_open";
396  info[6].name = "d_close";
397  info[7].name = "d_service";
398  info[8].name = "p_id";
399  info[9].name = "d_id";
400 
401  /* service is optional*/
402  info[4].strict = false;
403  info[7].strict = false;
404 
405  pgr_get_pd_orders_general(sql, rows, total_rows, info, column_count, 1);
406 }

References ANY_INTEGER, Column_info_t::colNumber, Column_info_t::eType, Column_info_t::name, pgr_get_pd_orders_general(), Column_info_t::strict, and Column_info_t::type.

Referenced by process().

Column_info_t::colNumber
int colNumber
Definition: column_info_t.h:54
Column_info_t::strict
bool strict
Definition: column_info_t.h:56
Column_info_t::name
char * name
Definition: column_info_t.h:57
INTERVAL
@ INTERVAL
Definition: column_info_t.h:48
Column_info_t::eType
expectType eType
Definition: column_info_t.h:58
ANY_INTEGER
@ ANY_INTEGER
Definition: column_info_t.h:40
ANY_NUMERICAL
@ ANY_NUMERICAL
Definition: column_info_t.h:41
pgr_get_pd_orders_general
static void pgr_get_pd_orders_general(char *pd_orders_sql, PickDeliveryOrders_t **pd_orders, size_t *total_pd_orders, Column_info_t *info, const int column_count, int kind)
Definition: orders_input.c:240
Column_info_t::type
uint64_t type
Definition: column_info_t.h:55
TIMESTAMP
@ TIMESTAMP
Definition: column_info_t.h:47
Column_info_t
Definition: column_info_t.h:52