vrpRouting  0.3
get_check_data.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 File: get_check_data.h
3 
4 Copyright (c) 2015 Celia Virginia Vergara Castillo
6 
7 ------
8 
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 
23  ********************************************************************PGR-GNU*/
24 
25 #ifndef INCLUDE_C_COMMON_GET_CHECK_DATA_H_
26 #define INCLUDE_C_COMMON_GET_CHECK_DATA_H_
27 #pragma once
28 
30 #include "c_types/column_info_t.h"
31 #include "c_types/typedefs.h"
32 
34 bool column_found(int colNumber);
35 
38  Column_info_t info[],
39  int info_size);
40 
42 char
44  HeapTuple *tuple,
45  TupleDesc *tupdesc,
46  Column_info_t info,
47  char default_value);
48 
50 int64_t*
52  HeapTuple *tuple,
53  TupleDesc *tupdesc,
54  Column_info_t info,
55  size_t *the_size);
56 
58 int64_t*
60  HeapTuple *tuple,
61  TupleDesc *tupdesc,
62  Column_info_t info,
63  size_t *the_size);
64 
66 int64_t*
68  HeapTuple *tuple,
69  TupleDesc *tupdesc,
70  Column_info_t info,
71  size_t *the_size);
72 
74 uint32_t*
76  HeapTuple *tuple,
77  TupleDesc *tupdesc,
78  Column_info_t info,
79  size_t *the_size);
80 
82 double
84  HeapTuple *tuple,
85  TupleDesc *tupdesc,
86  Column_info_t info);
87 
89 char*
91  HeapTuple *tuple,
92  TupleDesc *tupdesc,
93  Column_info_t info);
94 
96 int32_t
98  HeapTuple *tuple,
99  TupleDesc *tupdesc,
100  Column_info_t info);
101 
106 
108 TTimestamp get_TTimestamp(HeapTuple*, TupleDesc*, Column_info_t, TTimestamp);
109 
112 
114 TTimestamp get_TTimestamp_plain(HeapTuple*, TupleDesc*, Column_info_t, TTimestamp);
115 
118 /* @} */
119 
123 TInterval get_TInterval(HeapTuple*, TupleDesc*, Column_info_t, TInterval);
124 
126 TInterval get_PositiveTInterval(HeapTuple*, TupleDesc*, Column_info_t, TInterval);
127 
129 TInterval get_TInterval_plain(HeapTuple*, TupleDesc*, Column_info_t, TInterval);
130 
133 /* @} */
134 
136 Id get_Id(HeapTuple*, TupleDesc*, Column_info_t, Id);
137 
139 Idx get_Idx(HeapTuple*, TupleDesc*, Column_info_t, Idx);
140 
142 StepType get_StepType(HeapTuple *, TupleDesc *, Column_info_t, StepType);
143 
145 MatrixIndex get_MatrixIndex(HeapTuple*, TupleDesc*, Column_info_t, MatrixIndex);
146 
148 Duration get_Duration(HeapTuple*, TupleDesc*, Column_info_t, Duration);
149 
151 TravelCost get_Cost(HeapTuple*, TupleDesc*, Column_info_t, TravelCost);
152 
154 char get_Kind(HeapTuple*, TupleDesc*, Column_info_t, char);
155 
157 Priority get_Priority(HeapTuple*, TupleDesc*, Column_info_t, Priority);
158 
160 Distance get_Distance(HeapTuple*, TupleDesc*, Column_info_t, Distance);
161 
163 Amount get_Amount(HeapTuple*, TupleDesc*, Column_info_t, Amount);
164 
166 PAmount get_PositiveAmount(HeapTuple*, TupleDesc*, Column_info_t, PAmount);
167 
169 Coordinate spi_getCoordinate(HeapTuple*, TupleDesc*, Column_info_t, Coordinate);
170 
171 
172 #endif // INCLUDE_C_COMMON_GET_CHECK_DATA_H_
get_Priority
Priority get_Priority(HeapTuple *, TupleDesc *, Column_info_t, Priority)
get Priority from data
Definition: get_check_data.c:747
get_Distance
Distance get_Distance(HeapTuple *, TupleDesc *, Column_info_t, Distance)
get Distance from data
Definition: get_check_data.c:771
timestamp_without_timezone
TTimestamp timestamp_without_timezone(TTimestamp timestamp)
Converts timestamp to timestamp without timezone.
Definition: get_check_data.c:847
column_found
bool column_found(int colNumber)
Check whether the colNumber represent any specific column or NULL (SPI_ERROR_NOATTRIBUTE).
Definition: get_check_data.c:900
spi_getCoordinate
Coordinate spi_getCoordinate(HeapTuple *, TupleDesc *, Column_info_t, Coordinate)
get a coordinate value
Definition: get_check_data.c:819
get_Id
Id get_Id(HeapTuple *, TupleDesc *, Column_info_t, Id)
get Id from data
Definition: get_check_data.c:562
postgres_connection.h
get_TInterval
TInterval get_TInterval(HeapTuple *, TupleDesc *, Column_info_t, TInterval)
gets an interval value from postgres type INTERVAL
Definition: get_check_data.c:492
get_Idx
Idx get_Idx(HeapTuple *, TupleDesc *, Column_info_t, Idx)
get Idx from data
Definition: get_check_data.c:581
get_TTimestamp
TTimestamp get_TTimestamp(HeapTuple *, TupleDesc *, Column_info_t, TTimestamp)
gets a timestamp value from postgres type TIMESTAMP
Definition: get_check_data.c:457
spi_getPositiveBigIntArr_allowEmpty
int64_t * spi_getPositiveBigIntArr_allowEmpty(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, size_t *the_size)
Function returns the values of specified columns in array.
Definition: get_check_data.c:377
get_PositiveTInterval
TInterval get_PositiveTInterval(HeapTuple *, TupleDesc *, Column_info_t, TInterval)
gets an interval value from postgres type INTERVAL > 0
Definition: get_check_data.c:511
Id
int64_t Id
Definition: typedefs.h:78
get_MatrixIndex
MatrixIndex get_MatrixIndex(HeapTuple *, TupleDesc *, Column_info_t, MatrixIndex)
get MatrixIndex from data
Definition: get_check_data.c:658
typedefs.h
spi_getBigIntArr_allowEmpty
int64_t * spi_getBigIntArr_allowEmpty(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, size_t *the_size)
Function returns the values of specified columns in array.
Definition: get_check_data.c:354
spi_getText
char * spi_getText(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info)
gets string representation of the value of specified column.
Definition: get_check_data.c:832
spi_getMaxTasks
int32_t spi_getMaxTasks(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info)
gets the vehicle max tasks value
Definition: get_check_data.c:320
TravelCost
uint32_t TravelCost
Definition: typedefs.h:82
TTimestamp
int64_t TTimestamp
Definition: typedefs.h:71
get_Kind
char get_Kind(HeapTuple *, TupleDesc *, Column_info_t, char)
get Kind from data
Definition: get_check_data.c:725
Coordinate
double Coordinate
Definition: typedefs.h:73
Amount
int64_t Amount
Definition: typedefs.h:74
Idx
uint64_t Idx
Definition: typedefs.h:79
get_PositiveTTimestamp_plain
TTimestamp get_PositiveTTimestamp_plain(HeapTuple *, TupleDesc *, Column_info_t, TTimestamp)
gets a timestamp value from ANY-INTEGER > 0
Definition: get_check_data.c:441
get_PositiveAmount
PAmount get_PositiveAmount(HeapTuple *, TupleDesc *, Column_info_t, PAmount)
get positive Amount from data
Definition: get_check_data.c:638
MatrixIndex
int64_t MatrixIndex
Definition: typedefs.h:80
spi_getPositiveIntArr_allowEmpty
uint32_t * spi_getPositiveIntArr_allowEmpty(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, size_t *the_size)
Function returns the values of specified columns in array.
Definition: get_check_data.c:393
Duration
uint32_t Duration
Definition: typedefs.h:81
get_PositiveTTimestamp
TTimestamp get_PositiveTTimestamp(HeapTuple *, TupleDesc *, Column_info_t, TTimestamp)
gets a timestamp value from postgres type TIMESTAMP >= 1970-01-01 00:00:00
Definition: get_check_data.c:476
get_StepType
StepType get_StepType(HeapTuple *, TupleDesc *, Column_info_t, StepType)
get StepType from data
Definition: get_check_data.c:596
column_info_t.h
spi_getBigIntArr
int64_t * spi_getBigIntArr(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, size_t *the_size)
Function returns the values of specified columns in array.
Definition: get_check_data.c:336
pgr_fetch_column_info
void pgr_fetch_column_info(Column_info_t info[], int info_size)
Function tells expected type of each column and then check the correspondence type of each column.
Definition: get_check_data.c:905
get_TInterval_plain
TInterval get_TInterval_plain(HeapTuple *, TupleDesc *, Column_info_t, TInterval)
gets an interval value from ANY-INTEGER
Definition: get_check_data.c:527
PAmount
uint32_t PAmount
Definition: typedefs.h:75
Distance
uint32_t Distance
Definition: typedefs.h:84
Priority
uint32_t Priority
Definition: typedefs.h:83
TInterval
int64_t TInterval
Definition: typedefs.h:72
get_Amount
Amount get_Amount(HeapTuple *, TupleDesc *, Column_info_t, Amount)
get Amount from data
Definition: get_check_data.c:619
spi_getFloat8
double spi_getFloat8(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info)
gets value of specified column in double type.
Definition: get_check_data.c:782
get_PositiveTInterval_plain
TInterval get_PositiveTInterval_plain(HeapTuple *, TupleDesc *, Column_info_t, TInterval)
gets an interval value from ANY-INTEGER > 0
Definition: get_check_data.c:546
spi_getChar
char spi_getChar(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, char default_value)
get value of specified column in char type.
Definition: get_check_data.c:298
get_Cost
TravelCost get_Cost(HeapTuple *, TupleDesc *, Column_info_t, TravelCost)
get TravelCost from data
Definition: get_check_data.c:704
Column_info_t
Definition: column_info_t.h:52
get_TTimestamp_plain
TTimestamp get_TTimestamp_plain(HeapTuple *, TupleDesc *, Column_info_t, TTimestamp)
gets a timestamp value from ANY-INTEGER
Definition: get_check_data.c:422
StepType
int32_t StepType
Definition: typedefs.h:86
get_Duration
Duration get_Duration(HeapTuple *, TupleDesc *, Column_info_t, Duration)
get Duration from data
Definition: get_check_data.c:681