36 #ifndef __TINSTANTSET_H__ 37 #define __TINSTANTSET_H__ 40 #include <catalog/pg_type.h> 41 #include <utils/array.h> 42 #include <utils/rangetypes.h> 114 const Interval *start,
const Interval *duration);
127 Datum value,
bool atfunc);
129 const Datum *values,
int count,
bool atfunc);
131 const RangeType *range,
bool atfunc);
133 RangeType **normranges,
int count,
bool atfunc);
136 bool min,
bool atfunc);
138 TimestampTz t, Datum *result);
140 TimestampTz t,
bool atfunc);
144 const Period *p,
bool atfunc);
151 const TimestampTz t);
Structure to represent periods.
Definition: timetypes.h:52
ArrayType * tinstantset_instants_array(const TInstantSet *ti)
Returns the instants of the temporal value as an PostgreSQL array.
Definition: tinstantset.c:820
char * tinstantset_to_string(const TInstantSet *ti, char *(*value_out)(Oid, Datum))
Returns the string representation of the temporal value.
Definition: tinstantset.c:470
TInstantSet * tinstantset_restrict_minmax(const TInstantSet *ti, bool min, bool atfunc)
Restricts the temporal value to (the complement of) the minimum/maximum base value.
Definition: tinstantset.c:1231
TInstantSet * tinstantset_from_base_internal(Datum value, Oid basetypid, const TimestampSet *ts)
Construct a temporal instant set value from a base value and a timestamp set.
Definition: tinstantset.c:218
bool tinstantset_intersects_timestampset(const TInstantSet *ti, const TimestampSet *ts)
Returns true if the temporal value intersects the timestamp set.
Definition: tinstantset.c:1474
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: temporal.h:241
Datum tinstantset_min_value(const TInstantSet *ti)
Returns the minimum base value of the temporal value.
Definition: tinstantset.c:686
bool tinstantset_find_timestamp(const TInstantSet *ti, TimestampTz t, int *pos)
Returns the location of the timestamp in the temporal instant set value using binary search...
Definition: tinstantset.c:344
TInstantSet * tinstantset_restrict_value(const TInstantSet *ti, Datum value, bool atfunc)
Restricts the temporal value to the (complement of the) base value.
Definition: tinstantset.c:1060
TInstantSet * tinstantset_make(const TInstant **instants, int count, bool merge)
Construct a temporal instant set value from the array of temporal instant values. ...
Definition: tinstantset.c:185
TInstantSet * tinstantset_make1(const TInstant **instants, int count)
Creating a temporal value from its arguments.
Definition: tinstantset.c:111
void * tinstantset_bbox_ptr(const TInstantSet *ti)
Returns a pointer to the precomputed bounding box of the temporal value.
Definition: tinstantset.c:77
bool tinstantset_value_at_timestamp(const TInstantSet *ti, TimestampTz t, Datum *result)
Returns the base value of the temporal value at the timestamp.
Definition: tinstantset.c:1245
bool tinstantset_ever_le(const TInstantSet *ti, Datum value)
Returns true if the temporal value is ever less than or equal to the base value.
Definition: tinstantset.c:987
TimestampTz tinstantset_start_timestamp(const TInstantSet *ti)
Returns the start timestamp of the temporal value.
Definition: tinstantset.c:834
ArrayType * tinstantset_sequences_array(const TInstantSet *ti)
Returns the sequences of the temporal value as a PostgreSQL array.
Definition: tinstantset.c:794
bool tinstantset_always_eq(const TInstantSet *ti, Datum value)
Returns true if the temporal value is always equal to the base value.
Definition: tinstantset.c:941
TInstantSet * tinstantset_shift_tscale(const TInstantSet *ti, const Interval *start, const Interval *duration)
Shift and/or scale the time span of the temporal value by the two intervals.
Definition: tinstantset.c:878
TimestampTz * tinstantset_timestamps1(const TInstantSet *ti)
Returns the distinct timestamps of the temporal value.
Definition: tinstantset.c:852
TInstantSet * tsequence_to_tinstantset(const TSequence *seq)
Transforms the temporal sequence value into a temporal instant value.
Definition: tinstantset.c:573
const TInstant ** tinstantset_instants(const TInstantSet *ti, int *count)
Returns the instants of the temporal value as a C array.
Definition: tinstantset.c:807
TInstantSet * tinstantset_copy(const TInstantSet *ti)
Returns a copy of the temporal value.
Definition: tinstantset.c:311
Basic functions for temporal types of any subtype.
bool intersection_tinstantset_tinstant(const TInstantSet *ti, const TInstant *inst, TInstant **inter1, TInstant **inter2)
Temporally intersect the two temporal values.
Definition: tinstantset.c:383
bool tinstantset_ever_eq(const TInstantSet *ti, Datum value)
Returns true if the temporal value is ever equal to the base value.
Definition: tinstantset.c:922
Temporal * tinstantset_restrict_timestamp(const TInstantSet *ti, TimestampTz t, bool atfunc)
Restricts the temporal value to (the complement of) the timestamp.
Definition: tinstantset.c:1264
TInstantSet * tinstant_to_tinstantset(const TInstant *inst)
Transform the temporal instant value into a temporal instant set value.
Definition: tinstant.c:376
const TInstant * tinstantset_inst_n(const TInstantSet *ti, int index)
Returns the n-th instant of the temporal value.
Definition: tinstantset.c:66
Structure to represent period sets.
Definition: timetypes.h:84
bool tinstantset_eq(const TInstantSet *ti1, const TInstantSet *ti2)
Returns true if the two temporal instant set values are equal.
Definition: tinstantset.c:1539
int tinstantset_cmp(const TInstantSet *ti1, const TInstantSet *ti2)
Returns -1, 0, or 1 depending on whether the first temporal value is less than, equal, or greater than the second one.
Definition: tinstantset.c:1572
bool tinstantset_intersects_periodset(const TInstantSet *ti, const PeriodSet *ps)
Returns true if the temporal value intersects the period set.
Definition: tinstantset.c:1501
void tinstantset_period(Period *p, const TInstantSet *ti)
Returns the bounding period on which the temporal value is defined.
Definition: tinstantset.c:754
bool intersection_tinstant_tinstantset(const TInstant *inst, const TInstantSet *ti, TInstant **inter1, TInstant **inter2)
Temporally intersect the two temporal values.
Definition: tinstantset.c:403
void tinstantset_write(const TInstantSet *ti, StringInfo buf)
Write the binary representation of the temporal value into the buffer.
Definition: tinstantset.c:492
Datum tinstantset_timespan(const TInstantSet *ti)
Returns the timespan of the timestamp set value.
Definition: tinstantset.c:765
bool intersection_tinstantset_tinstantset(const TInstantSet *ti1, const TInstantSet *ti2, TInstantSet **inter1, TInstantSet **inter2)
Temporally intersect the two temporal values.
Definition: tinstantset.c:417
int tinstantset_values(Datum *result, const TInstantSet *ti)
Returns the base values of the temporal value as a C array.
Definition: tinstantset.c:625
TInstantSet * tinstantset_make_free(TInstant **instants, int count, bool merge)
Construct a temporal instant set value from the array of temporal instant values and free the array a...
Definition: tinstantset.c:201
ArrayType * tfloatinstset_ranges(const TInstantSet *ti)
Returns the base values of the temporal float value as an array of ranges.
Definition: tinstantset.c:653
Structure to represent temporal values of sequence set subtype.
Definition: temporal.h:293
bool tinstantset_always_le(const TInstantSet *ti, Datum value)
Returns true if the temporal value is always less than or equal to the base value.
Definition: tinstantset.c:1026
TInstantSet * tsequenceset_to_tinstantset(const TSequenceSet *ts)
Transforms the temporal sequence set value into a temporal instant set value.
Definition: tinstantset.c:591
const TInstant * tinstantset_min_instant(const TInstantSet *ti)
Returns a pointer to the instant with minimum base value of the temporal value.
Definition: tinstantset.c:1210
Structure to represent timestamp sets.
Definition: timetypes.h:73
bool tinstantset_ever_lt(const TInstantSet *ti, Datum value)
Returns true if the temporal value is ever less than the base value.
Definition: tinstantset.c:967
PeriodSet * tinstantset_get_time(const TInstantSet *ti)
Returns the time on which the temporal value is defined as a period set.
Definition: tinstantset.c:670
bool tinstantset_intersects_period(const TInstantSet *ti, const Period *p)
Returns true if the temporal value intersects the period.
Definition: tinstantset.c:1486
bool tinstantset_intersects_timestamp(const TInstantSet *ti, const TimestampTz t)
Returns true if the temporal value intersects the timestamp.
Definition: tinstantset.c:1464
TInstantSet * tinstantset_read(StringInfo buf, Oid basetypid)
Returns a new temporal value from its binary representation read from the buffer. ...
Definition: tinstantset.c:514
Datum tinstantset_from_base(PG_FUNCTION_ARGS)
Definition: tinstantset.c:229
Structure to represent temporal values of instant set subtype.
Definition: temporal.h:266
Temporal * tinstantset_merge(const TInstantSet *ti1, const TInstantSet *ti2)
Merge the two temporal values.
Definition: tinstantset.c:267
bool tinstantset_always_lt(const TInstantSet *ti, Datum value)
Returns true if the temporal value is always less than the base value.
Definition: tinstantset.c:1006
double tnumberinstset_twavg(const TInstantSet *ti)
Returns the time-weighted average of the temporal number.
Definition: tinstantset.c:1517
void tinstantset_bbox(void *box, const TInstantSet *ti)
Copy in the first argument the bounding box of the temporal value.
Definition: tinstantset.c:87
ArrayType * tinstantset_timestamps(const TInstantSet *ti)
Returns the distinct timestamps of the temporal value as a C array.
Definition: tinstantset.c:864
Datum tinstantset_max_value(const TInstantSet *ti)
Returns the maximum base value of the temporal value.
Definition: tinstantset.c:720
ArrayType * tinstantset_values_array(const TInstantSet *ti)
Returns the base values of the temporal value as a PostgreSQL array.
Definition: tinstantset.c:640
TInstantSet * tinstantset_restrict_periodset(const TInstantSet *ti, const PeriodSet *ps, bool atfunc)
Restricts the temporal value to (the complement of) the period set.
Definition: tinstantset.c:1415
TInstantSet * tinstantset_restrict_period(const TInstantSet *ti, const Period *p, bool atfunc)
Restricts the temporal value to (the complement of) the period.
Definition: tinstantset.c:1382
TInstantSet * tinstantset_append_tinstant(const TInstantSet *ti, const TInstant *inst)
Append an instant to the temporal value.
Definition: tinstantset.c:244
TInstantSet * tinstantset_restrict_timestampset(const TInstantSet *ti, const TimestampSet *ts, bool atfunc)
Restricts the temporal value to the (complement of the) timestamp set.
Definition: tinstantset.c:1307
TimestampTz tinstantset_end_timestamp(const TInstantSet *ti)
Returns the end timestamp of the temporal value.
Definition: tinstantset.c:843
uint32 tinstantset_hash(const TInstantSet *ti)
Returns the hash value of the temporal value.
Definition: tinstantset.c:1607
TInstantSet * tnumberinstset_restrict_range(const TInstantSet *ti, const RangeType *range, bool atfunc)
Restricts the temporal number to the (complement of the) range of base values.
Definition: tinstantset.c:1139
TInstantSet * tinstantset_restrict_values(const TInstantSet *ti, const Datum *values, int count, bool atfunc)
Restricts the temporal value to the (complement of the) array of base values.
Definition: tinstantset.c:1100
Temporal * tinstantset_merge_array(const TInstantSet **tis, int count)
Merge the array of temporal instant values.
Definition: tinstantset.c:285
TInstantSet * tintinstset_to_tfloatinstset(const TInstantSet *ti)
Cast the temporal integer value as a temporal float value.
Definition: tinstantset.c:531
Structure to represent temporal values of sequence subtype.
Definition: temporal.h:279
TInstantSet * tnumberinstset_restrict_ranges(const TInstantSet *ti, RangeType **normranges, int count, bool atfunc)
Restricts the temporal value to the (complement of the) array of ranges of base values.
Definition: tinstantset.c:1173
TInstantSet * tfloatinstset_to_tintinstset(const TInstantSet *ti)
Cast the temporal float value as a temporal integer value.
Definition: tinstantset.c:549
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253