MobilityDB 1.1
time_aggfuncs.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 __TIME_AGGFUNCS_H__
35#define __TIME_AGGFUNCS_H__
36
37/* MEOS */
38#include "general/span.h"
39#include "general/skiplist.h"
40
41/*****************************************************************************/
42
43extern Datum datum_sum_int32(Datum l, Datum r);
44extern TimestampTz *timestamp_tagg(TimestampTz *times1, int count1,
45 TimestampTz *times2, int count2, int *newcount);
46extern Span **period_tagg(Span **periods1, int count1, Span **periods2,
47 int count2, int *newcount);
48
53extern SkipList *time_tagg_combinefn(SkipList *state1, SkipList *state2);
54
55/*****************************************************************************/
56
57#endif
int64 TimestampTz
Definition: pg_ext_defs.in.h:19
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
unsigned char uint8
Definition: pg_ext_defs.in.h:11
API of the Mobility Engine Open Source (MEOS) library.
Definition: meos.h:56
Structure to represent skiplists that keep the current state of an aggregation.
Definition: meos.h:240
Structure to represent span sets.
Definition: meos.h:83
Structure to represent spans (a.k.a.
Definition: meos.h:70
Definition: pgtz.h:42
Datum datum_sum_int32(Datum l, Datum r)
Aggregate functions for time types.
Definition: time_aggfuncs.c:57
SkipList * time_tagg_combinefn(SkipList *state1, SkipList *state2)
Generic combine function for temporal aggregate of time values.
Definition: time_aggfuncs.c:147
void ensure_same_timetype_skiplist(SkipList *state, uint8 subtype)
Definition: time_aggfuncs.c:401
TimestampTz * timestamp_tagg(TimestampTz *times1, int count1, TimestampTz *times2, int count2, int *newcount)
Definition: time_aggfuncs.c:72
SkipList * period_tagg_transfn(SkipList *state, const Span *p)
SkipList * periodset_tagg_transfn(SkipList *state, const SpanSet *ps)
SkipList * tstzset_tagg_transfn(SkipList *state, const Set *ts)
Span ** period_tagg(Span **periods1, int count1, Span **periods2, int count2, int *newcount)
Generic aggregate function for periods.
Definition: time_aggfuncs.c:111