MobilityDB 1.3
Loading...
Searching...
No Matches
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-2025, 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-2025, 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 <meos.h>
41#include "temporal/temporal.h"
42
43/*****************************************************************************/
44
45/* General functions */
46
47extern void tinstant_set(TInstant *inst, Datum value, TimestampTz t);
48extern double tnumberinst_double(const TInstant *inst);
49
50/* Input/output functions */
51
52extern char *tinstant_to_string(const TInstant *inst, int maxdd,
53 outfunc value_out);
54
55/* Restriction Functions */
56
57extern bool tinstant_restrict_values_test(const TInstant *inst,
58 const Set *s, bool atfunc);
59extern bool tnumberinst_restrict_span_test(const TInstant *inst,
60 const Span *s, bool atfunc);
61extern bool tnumberinst_restrict_spanset_test(const TInstant *inst,
62 const SpanSet *ss, bool atfunc);
63extern bool tinstant_restrict_tstzset_test(const TInstant *inst,
64 const Set *s, bool atfunc);
65extern bool tinstant_restrict_tstzspanset_test(const TInstant *inst,
66 const SpanSet *ss, bool atfunc);
67
68/* Intersection function */
69
70extern bool intersection_tinstant_tinstant(const TInstant *inst1,
71 const TInstant *inst2, TInstant **inter1, TInstant **inter2);
72
73/*****************************************************************************/
74
75#endif
char *(* outfunc)(Datum value, meosType type, int maxdd)
Definition: temporal.h:277
bool tnumberinst_restrict_span_test(const TInstant *inst, const Span *s, bool atfunc)
Return true if a temporal number instant satisfies the restriction to (the complement of) a span of b...
Definition: temporal_restrict.c:727
double tnumberinst_double(const TInstant *inst)
Return the value of a temporal number instant converted to a double.
Definition: tinstant.c:113
bool tinstant_restrict_tstzset_test(const TInstant *inst, const Set *s, bool atfunc)
Return true if a temporal instant satisfies the restriction to (the complement of) a timestamptz set.
Definition: temporal_restrict.c:815
bool intersection_tinstant_tinstant(const TInstant *inst1, const TInstant *inst2, TInstant **inter1, TInstant **inter2)
Temporally intersect two temporal instants.
Definition: tinstant.c:510
bool tinstant_restrict_tstzspanset_test(const TInstant *inst, const SpanSet *ss, bool atfunc)
Return true if a temporal instant satisfies the restriction to (the complement of) a timestamptz set.
Definition: temporal_restrict.c:866
void tinstant_set(TInstant *inst, Datum value, TimestampTz t)
Basic functions for temporal instants.
Definition: tinstant.c:101
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:155
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: temporal_restrict.c:759
bool tinstant_restrict_values_test(const TInstant *inst, const Set *s, bool atfunc)
Return true if a temporal instant satisfies the restriction to (the complement of) a set of base valu...
Definition: temporal_restrict.c:681
External API of the Mobility Engine Open Source (MEOS) library.
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
Structure to represent sets of values.
Definition: meos.h:80
Structure to represent span sets.
Definition: meos.h:108
Structure to represent spans (a.k.a.
Definition: meos.h:94
Structure to represent temporal values of instant subtype.
Definition: meos.h:185