PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
trsp.c File Reference
#include "postgres.h"
#include "executor/spi.h"
#include "funcapi.h"
#include "catalog/pg_type.h"
#include "fmgr.h"
#include "trsp.h"

Go to the source code of this file.

Classes

struct  edge_columns
 
struct  restrict_columns
 

Macros

#define DBG(format,...)   do { ; } while (0)
 
#define TUPLIMIT   1000
 

Typedefs

typedef struct edge_columns edge_columns_t
 
typedef struct restrict_columns restrict_columns_t
 

Functions

static int compute_trsp (char *sql, int dovertex, int start_id, double start_pos, int end_id, double end_pos, bool directed, bool has_reverse_cost, char *restrict_sql, path_element_t **path, int *path_count)
 
static void fetch_edge (HeapTuple *tuple, TupleDesc *tupdesc, edge_columns_t *edge_columns, edge_t *target_edge)
 
static int fetch_edge_columns (SPITupleTable *tuptable, edge_columns_t *edge_columns, bool has_reverse_cost)
 
static void fetch_restrict (HeapTuple *tuple, TupleDesc *tupdesc, restrict_columns_t *restrict_columns, restrict_t *rest)
 
static int fetch_restrict_columns (SPITupleTable *tuptable, restrict_columns_t *restrict_columns)
 
static int finish (int code, int ret)
 
 PG_FUNCTION_INFO_V1 (turn_restrict_shortest_path_vertex)
 
 PG_FUNCTION_INFO_V1 (turn_restrict_shortest_path_edge)
 
static char * text2char (text *in)
 
PGDLLEXPORT Datum turn_restrict_shortest_path_edge (PG_FUNCTION_ARGS)
 
PGDLLEXPORT Datum turn_restrict_shortest_path_vertex (PG_FUNCTION_ARGS)
 

Macro Definition Documentation

#define DBG (   format,
  ... 
)    do { ; } while (0)
#define TUPLIMIT   1000

Definition at line 26 of file trsp.c.

Referenced by compute_trsp().

Typedef Documentation

typedef struct edge_columns edge_columns_t

Function Documentation

static int compute_trsp ( char *  sql,
int  dovertex,
int  start_id,
double  start_pos,
int  end_id,
double  end_pos,
bool  directed,
bool  has_reverse_cost,
char *  restrict_sql,
path_element_t **  path,
int *  path_count 
)
static
static void fetch_edge ( HeapTuple *  tuple,
TupleDesc *  tupdesc,
edge_columns_t edge_columns,
edge_t target_edge 
)
static
static int fetch_edge_columns ( SPITupleTable *  tuptable,
edge_columns_t edge_columns,
bool  has_reverse_cost 
)
static
static void fetch_restrict ( HeapTuple *  tuple,
TupleDesc *  tupdesc,
restrict_columns_t restrict_columns,
restrict_t rest 
)
static
static int fetch_restrict_columns ( SPITupleTable *  tuptable,
restrict_columns_t restrict_columns 
)
static

Definition at line 78 of file trsp.c.

References restrict_columns::target_id, restrict_columns::to_cost, and restrict_columns::via_path.

Referenced by compute_trsp().

static int finish ( int  code,
int  ret 
)
static

Definition at line 61 of file trsp.c.

References DBG.

Referenced by compute_trsp().

PG_FUNCTION_INFO_V1 ( turn_restrict_shortest_path_vertex  )
PG_FUNCTION_INFO_V1 ( turn_restrict_shortest_path_edge  )
static char* text2char ( text *  in)
static

Definition at line 51 of file trsp.c.

Referenced by turn_restrict_shortest_path_edge(), and turn_restrict_shortest_path_vertex().

PGDLLEXPORT Datum turn_restrict_shortest_path_edge ( PG_FUNCTION_ARGS  )

Definition at line 691 of file trsp.c.

References compute_trsp(), path_element_t::cost, DBG, path, path_count, and text2char().

PGDLLEXPORT Datum turn_restrict_shortest_path_vertex ( PG_FUNCTION_ARGS  )

Definition at line 560 of file trsp.c.

References compute_trsp(), path_element_t::cost, DBG, path, path_count, and text2char().