MobilityDB 1.1
tinstant.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2023, Université libre de Bruxelles and MobilityDB
5 * contributors
6 *
7 * MobilityDB includes portions of PostGIS version 3 source code released
8 * under the GNU General Public License (GPLv2 or later).
9 * Copyright (c) 2001-2023, PostGIS contributors
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation for any purpose, without fee, and without a written
13 * agreement is hereby granted, provided that the above copyright notice and
14 * this paragraph and the following two paragraphs appear in all copies.
15 *
16 * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
17 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
18 * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
19 * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
20 * OF SUCH DAMAGE.
21 *
22 * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
23 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
25 * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
26 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
27 *
28 *****************************************************************************/
29
34#ifndef __TINSTANT_H__
35#define __TINSTANT_H__
36
37/* PostgreSQL */
38#include <postgres.h>
39/* MEOS */
40#include "general/meos_catalog.h"
41#include "general/temporal.h"
42#include "general/span.h"
43
44/*****************************************************************************/
45
46/* General functions */
47
48extern void tinstant_set(TInstant *inst, Datum value, TimestampTz t);
49extern double tnumberinst_double(const TInstant *inst);
50
51/* Input/output functions */
52
53extern char *tinstant_to_string(const TInstant *inst, int maxdd,
54 outfunc value_out);
55
56/* Restriction Functions */
57
58extern bool tinstant_restrict_values_test(const TInstant *inst,
59 const Set *set, bool atfunc);
60extern bool tnumberinst_restrict_span_test(const TInstant *inst,
61 const Span *span, bool atfunc);
62extern bool tnumberinst_restrict_spanset_test(const TInstant *inst,
63 const SpanSet *ss, bool atfunc);
64extern bool tinstant_restrict_timestampset_test(const TInstant *inst,
65 const Set *ts, bool atfunc);
66extern bool tinstant_restrict_periodset_test(const TInstant *inst,
67 const SpanSet *ps, bool atfunc);
68
69/* Intersection function */
70
71extern bool intersection_tinstant_tinstant(const TInstant *inst1,
72 const TInstant *inst2, TInstant **inter1, TInstant **inter2);
73
74/*****************************************************************************/
75
76#endif
char *(* outfunc)(Datum value, meosType type, int maxdd)
Definition: temporal.h:358
double tnumberinst_double(const TInstant *inst)
Convert the value of temporal number instant to a double.
Definition: tinstant.c:118
bool tinstant_restrict_periodset_test(const TInstant *inst, const SpanSet *ps, bool atfunc)
Return true if a temporal instant satisfies the restriction to (the complement of) a timestamp set.
Definition: tinstant.c:883
bool intersection_tinstant_tinstant(const TInstant *inst1, const TInstant *inst2, TInstant **inter1, TInstant **inter2)
Temporally intersect two temporal instants.
Definition: tinstant.c:960
bool tinstant_restrict_timestampset_test(const TInstant *inst, const Set *ts, bool atfunc)
Return true if a temporal instant satisfies the restriction to (the complement of) a timestamp set.
Definition: tinstant.c:838
void tinstant_set(TInstant *inst, Datum value, TimestampTz t)
Basic functions for temporal instants.
Definition: tinstant.c:108
char * tinstant_to_string(const TInstant *inst, int maxdd, outfunc value_out)
Return the Well-Known Text (WKT) representation of a temporal instant.
Definition: tinstant.c:229
bool tnumberinst_restrict_span_test(const TInstant *inst, const Span *span, bool atfunc)
Return true if a temporal number instant satisfies the restriction to (the complement of) a span of b...
Definition: tinstant.c:750
bool tnumberinst_restrict_spanset_test(const TInstant *inst, const SpanSet *ss, bool atfunc)
Return true if a temporal number satisfies the restriction to (the complement of) an array of spans o...
Definition: tinstant.c:786
bool tinstant_restrict_values_test(const TInstant *inst, const Set *set, bool atfunc)
Return true if a temporal instant satisfies the restriction to (the complement of) an array of base v...
Definition: tinstant.c:712
set(MOBILITYDB_MODULE_PATHNAME "$libdir/lib${MOBILITYDB_LIB_NAME}") set(extschema "@extschema@") configure_file(mobilitydb.control $
Definition: CMakeLists.txt:1
int64 TimestampTz
Definition: pg_ext_defs.in.h:19
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
API of the Mobility Engine Open Source (MEOS) library.
Definition: meos.h:56
Structure to represent span sets.
Definition: meos.h:83
Structure to represent spans (a.k.a.
Definition: meos.h:70
Structure to represent temporal values of instant subtype.
Definition: meos.h:148