MobilityDB 1.3
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
temporal.h File Reference
#include <postgres.h>
#include <meos.h>
#include <meos_geo.h>
#include "temporal/doublen.h"
#include "temporal/meos_catalog.h"

Go to the source code of this file.

Data Structures

union  bboxunion
 Structure to represent all types of bounding boxes. More...
 

Macros

#define ALWAYS   false
 
#define BBOX_TEST   true
 Symbolic constants for the synchronization and the aggregation functions. More...
 
#define BBOX_TEST_NO   false
 
#define BORDER_EXC   false
 
#define BORDER_INC   true
 Symbolic constants for the restriction functions with boxes. More...
 
#define C_COLLATION_OID   950
 
#define CONTINUOUS   false
 
#define CROSSINGS   true
 Symbolic constants for the synchronization and the aggregation functions. More...
 
#define CROSSINGS_NO   false
 
#define DATUM_FREE(value, basetype)
 
#define DATUM_FREE_IF_COPY(value, basetype, n)
 
#define DatumGetDouble2P(X)   ((double2 *) DatumGetPointer(X))
 
#define DatumGetDouble3P(X)   ((double3 *) DatumGetPointer(X))
 
#define DatumGetDouble4P(X)   ((double4 *) DatumGetPointer(X))
 
#define DatumGetTemporalP(X)   ((Temporal *) DatumGetPointer(X))
 
#define DatumGetTextP(X)   ((text *) DatumGetPointer(X))
 
#define DEFAULT_BIGINTSPAN_ORIGIN   (0)
 
#define DEFAULT_COLLATION_OID   100
 Basic functions for temporal types of any subtype. More...
 
#define DEFAULT_FLOATSPAN_ORIGIN   (0.0)
 
#define DEFAULT_INTSPAN_ORIGIN   (0)
 
#define DEFAULT_TIME_ORIGIN   (JAN_3_2000)
 
#define DISCONTINUOUS   true
 Symbolic constants for lifting. More...
 
#define DIST_EPSILON   1.0e-06
 Precision for distance operations. More...
 
#define Double2PGetDatum(X)   PointerGetDatum(X)
 
#define Double3PGetDatum(X)   PointerGetDatum(X)
 
#define Double4PGetDatum(X)   PointerGetDatum(X)
 
#define EVER   true
 Symbolic constants for the ever/always functions. More...
 
#define GET_MAX   false
 
#define GET_MIN   true
 Symbolic constants for the restriction and the aggregation functions. More...
 
#define INVERT   true
 Symbolic constants for lifting. More...
 
#define INVERT_NO   false
 
#define JAN_3_2000   (2 * USECS_PER_DAY)
 
#define MEOS_EPSILON   1.0e-06
 Floating point precision. More...
 
#define MEOS_FP_EQ(A, B)   (fabs((A)-(B)) <= MEOS_EPSILON)
 
#define MEOS_FP_GE(A, B)   (((A) + MEOS_EPSILON) >= (B))
 
#define MEOS_FP_GT(A, B)   (((A) - MEOS_EPSILON) > (B))
 
#define MEOS_FP_LE(A, B)   (((A) - MEOS_EPSILON) <= (B))
 
#define MEOS_FP_LT(A, B)   (((A) + MEOS_EPSILON) < (B))
 
#define MEOS_FP_NE(A, B)   (fabs((A)-(B)) > MEOS_EPSILON)
 
#define MEOS_WKB_BYTE_SIZE   1
 
#define MEOS_WKB_DATE_SIZE   4
 
#define MEOS_WKB_DOUBLE_SIZE   8
 
#define MEOS_WKB_GEODETICFLAG   0x20
 
#define MEOS_WKB_GET_INTERP(flags)   (((flags) & MEOS_WKB_INTERPFLAGS) >> 2)
 
#define MEOS_WKB_INT2_SIZE   2
 
#define MEOS_WKB_INT4_SIZE   4
 
#define MEOS_WKB_INT8_SIZE   8
 
#define MEOS_WKB_INTERPFLAGS   0x0C
 
#define MEOS_WKB_LOWER_INC   0x01
 
#define MEOS_WKB_ORDERED   0x01
 
#define MEOS_WKB_SET_INTERP(flags, value)   ((flags) = (((flags) & ~MEOS_WKB_INTERPFLAGS) | ((value & 0x0003) << 2)))
 
#define MEOS_WKB_SRIDFLAG   0x40
 
#define MEOS_WKB_TFLAG   0x02
 
#define MEOS_WKB_TIMESTAMP_SIZE   8
 
#define MEOS_WKB_UPPER_INC   0x02
 
#define MEOS_WKB_XFLAG   0x01
 
#define MEOS_WKB_ZFLAG   0x10
 
#define MERGE   true
 Symbolic constants for the make functions. More...
 
#define MERGE_NO   false
 
#define NDR   1 /* little endian */
 
#define NO_Z   false
 
#define NORMALIZE   true
 
#define NORMALIZE_NO   false
 
#define ORDER   true
 Symbolic constants for sets and for normalizing spans. More...
 
#define ORDER_NO   false
 
#define PG_DATUM_NEEDS_DETOAST(datum)
 
#define PG_FREE_IF_COPY_P(ptrsrc, ptrori)
 This macro is based on PG_FREE_IF_COPY, except that it accepts two pointers. More...
 
#define PG_GETARG_TEMPORAL_P(X)   ((Temporal *) PG_GETARG_VARLENA_P(X))
 
#define PG_GETARG_TINSTANT_P(X)   ((TInstant *) PG_GETARG_VARLENA_P(X))
 
#define PG_GETARG_TSEQUENCE_P(X)   ((TSequence *) PG_GETARG_VARLENA_P(X))
 
#define PG_GETARG_TSEQUENCESET_P(X)   ((TSequenceSet *) PG_GETARG_VARLENA_P(X))
 
#define PG_RETURN_TEMPORAL_P(X)   PG_RETURN_POINTER(X)
 
#define PG_RETURN_TINSTANT_P(X)   PG_RETURN_POINTER(X)
 
#define PG_RETURN_TSEQUENCE_P(X)   PG_RETURN_POINTER(X)
 
#define PG_RETURN_TSEQUENCESET_P(X)   PG_RETURN_POINTER(X)
 
#define POSIX_COLLATION_OID   951
 
#define QUOTES   true
 Symbolic constants for the output of string elements. More...
 
#define QUOTES_NO   false
 
#define REST_AT   true
 Symbolic constants for the restriction functions. More...
 
#define REST_MINUS   false
 
#define RTAfterStrategyNumber   30 /* for #>> */
 
#define RTBackStrategyNumber   34 /* for />> */
 
#define RTBeforeStrategyNumber   29 /* for <<# */
 
#define RTFrontStrategyNumber   33 /* for <</ */
 
#define RTOverAfterStrategyNumber   31 /* for #&> */
 
#define RTOverBackStrategyNumber   35 /* for /&> */
 
#define RTOverBeforeStrategyNumber   28 /* for &<# */
 
#define RTOverFrontStrategyNumber   32 /* for &</ */
 
#define SPACES   true
 Symbolic constants for the output of string elements. More...
 
#define SPACES_NO   false
 
#define TemporalPGetDatum(X)   PointerGetDatum(X)
 
#define TGEO   false
 
#define TIME_SEL   false
 
#define TIME_SEL   false
 
#define TInstantPGetDatum(X)   PointerGetDatum(X)
 
#define TPOINT   true
 Symbolic constants for the temporal point/geo functions. More...
 
#define TSequencePGetDatum(X)   PointerGetDatum(X)
 
#define TSequenceSetPGetDatum(X)   PointerGetDatum(X)
 
#define UNARY_UNION   true
 Symbolic constants for trajectory function. More...
 
#define UNARY_UNION_NO   false
 
#define UNUSED   __attribute__((unused))
 
#define UPPER_EXC   true
 Symbolic constants for the restriction functions. More...
 
#define VALUE_SEL   true
 Symbolic constants for the span selectivity functions. More...
 
#define WITH_Z   true
 Symbolic constants for spatial relationships. More...
 
#define XDR   0 /* big endian */
 

Typedefs

typedef union bboxunion bboxunion
 Structure to represent all types of bounding boxes. More...
 
typedef Datum(* datum_func1) (Datum)
 
typedef Datum(* datum_func2) (Datum, Datum)
 
typedef Datum(* datum_func3) (Datum, Datum, Datum)
 
typedef char *(* outfunc) (Datum value, meosType type, int maxdd)
 
typedef int(* qsort_comparator) (const void *a, const void *b)
 
typedef int(* tpfunc_base) (Datum, Datum, Datum, TimestampTz, TimestampTz, TimestampTz *, TimestampTz *)
 
typedef int(* tpfunc_temp) (Datum, Datum, Datum, Datum, Datum, TimestampTz, TimestampTz, TimestampTz *, TimestampTz *)
 
typedef Datum(* varfunc) (Datum,...)
 

Enumerations

enum  MEOS_WKB_TSUBTYPE { MEOS_WKB_TINSTANT = 1 , MEOS_WKB_TSEQUENCE = 2 , MEOS_WKB_TSEQUENCESET = 3 }
 
enum  SetOper { UNION , INTER , MINUS }
 Enumeration for the set operations of span and temporal types. More...
 
enum  SyncMode { SYNCHRONIZE_NOCROSS , SYNCHRONIZE_CROSS }
 Enumeration for the intersection/synchronization functions. More...
 
enum  TemporalFamily { TEMPORALTYPE , TNUMBERTYPE , TSPATIALTYPE }
 Enumeration for the families of temporal types. More...
 

Functions

bool ensure_common_dimension (int16 flags1, int16 flags2)
 Ensure that two temporal values have at least one common dimension. More...
 
bool ensure_continuous (const Temporal *temp)
 Ensure that the subtype of temporal type is a sequence (set) More...
 
bool ensure_has_not_Z (meosType type, int16 flags)
 Ensure that a MEOS type has not Z dimension. More...
 
bool ensure_has_T (meosType type, int16 flags)
 Ensure that a MEOS type has Z dimension. More...
 
bool ensure_has_X (meosType type, int16 flags)
 Ensure that a MEOS type has X dimension. More...
 
bool ensure_has_Z (meosType type, int16 flags)
 Ensure that a MEOS type has Z dimension. More...
 
bool ensure_linear_interp (int16 flags)
 Ensure that a temporal value has linear interpolation. More...
 
bool ensure_nonlinear_interp (int16 flags)
 Ensure that a temporal value does not have linear interpolation. More...
 
bool ensure_not_negative (int i)
 Ensure that a number is positive or zero. More...
 
bool ensure_not_negative_datum (Datum size, meosType basetype)
 Ensure that a number is not negative. More...
 
bool ensure_not_null (void *ptr)
 Ensure that the pointer is not null. More...
 
bool ensure_one_not_null (void *ptr1, void *ptr2)
 Ensure that at least one of the pointers is not null. More...
 
bool ensure_one_true (bool hasshift, bool haswidth)
 Ensure that at least one of the values is true. More...
 
bool ensure_positive (int i)
 Ensure that a number is positive. More...
 
bool ensure_positive_datum (Datum size, meosType basetype)
 Ensure that a number is strictly positive. More...
 
bool ensure_positive_duration (const Interval *duration)
 Ensure that an interval is a positive duration. More...
 
bool ensure_same_continuous_interp (int16 flags1, int16 flags2)
 Ensure that two temporal values have the same continuous interpolation. More...
 
bool ensure_same_interp (const Temporal *temp1, const Temporal *temp2)
 Ensure that two temporal values have the same interpolation. More...
 
bool ensure_same_temporal_type (const Temporal *temp1, const Temporal *temp2)
 Ensure that two temporal values have the same temporal type. More...
 
bool ensure_temporal_isof_basetype (const Temporal *temp, meosType basetype)
 Ensure that a temporal value has a given base type. More...
 
bool ensure_temporal_isof_subtype (const Temporal *temp, tempSubtype type)
 Ensure that a temporal value is of a given subtype. More...
 
bool ensure_temporal_isof_type (const Temporal *temp, meosType type)
 Ensure that a temporal value is of a temporal type. More...
 
bool ensure_valid_day_duration (const Interval *duration)
 Ensure that a day interval for binning is valid. More...
 
bool ensure_valid_interp (meosType temptype, interpType interp)
 Ensure that an interpolation is valid. More...
 
bool ensure_valid_temporal_set (const Temporal *temp, const Set *s)
 Ensure that a temporal number and a set have the same span type. More...
 
bool ensure_valid_temporal_temporal (const Temporal *temp1, const Temporal *temp2)
 Ensure that a temporal number and a temporal box have the same span type. More...
 
bool ensure_valid_tnumber_numspan (const Temporal *temp, const Span *s)
 Ensure that a temporal number and a span have the same span type. More...
 
bool ensure_valid_tnumber_numspanset (const Temporal *temp, const SpanSet *ss)
 Ensure that a temporal number and a span set have the same span type. More...
 
bool ensure_valid_tnumber_tbox (const Temporal *temp, const TBox *box)
 Ensure that a temporal number and a temporal box have the same span type. More...
 
bool ensure_valid_tnumber_tnumber (const Temporal *temp1, const Temporal *temp2)
 Ensure that two temporal numbers have the same span type. More...
 
bool intersection_temporal_temporal (const Temporal *temp1, const Temporal *temp2, SyncMode mode, Temporal **inter1, Temporal **inter2)
 Return the temporal intersection of two temporal values. More...
 
char * mobilitydb_full_version (void)
 Return the versions of the MobilityDB extension and its dependencies. More...
 
char * mobilitydb_version (void)
 Return the version of the MobilityDB extension. More...
 
bool not_negative_datum (Datum size, meosType basetype)
 Return true if a number is not negative. More...
 
int32 pg_atoi (const char *s, int size, int c)
 
bool positive_datum (Datum size, meosType basetype)
 Return true if a number is strictly positive. More...
 
bool positive_duration (const Interval *duration)
 Return true if an interval is a positive duration. More...
 
datum_func2 round_fn (meosType basetype)
 Return the function for rounding a base type. More...
 
void * temporal_bbox_ptr (const Temporal *temp)
 Return a pointer to the precomputed bounding box of a temporal value. More...
 
bool temporal_bbox_restrict_value (const Temporal *temp, Datum value)
 Return true if the bounding box of a temporal value contains a base value. More...