36 #ifndef __TINSTANT_H__ 37 #define __TINSTANT_H__ 40 #include <catalog/pg_type.h> 41 #include <utils/array.h> 42 #include <utils/rangetypes.h> 107 Datum value,
bool atfunc);
109 const Datum *values,
int count,
bool atfunc);
111 const Datum *values,
int count,
bool atfunc);
113 const RangeType *range,
bool atfunc);
115 const RangeType *range,
bool atfunc);
117 RangeType **normranges,
int count,
bool atfunc);
119 RangeType **normranges,
int count,
bool atfunc);
121 TimestampTz t,
bool atfunc);
123 TimestampTz t, Datum *result);
129 const Period *p,
bool atfunc);
void tinstant_period(Period *p, const TInstant *inst)
Returns the bounding period on which the temporal instant value is defined.
Definition: tinstant.c:463
TInstant * tfloatinst_to_tintinst(const TInstant *inst)
Cast the temporal float value as a temporal integer value.
Definition: tinstant.c:358
bool tinstant_ever_eq(const TInstant *inst, Datum value)
Returns true if temporal value is ever equal to the base value.
Definition: tinstant.c:533
bool tinstant_eq(const TInstant *inst1, const TInstant *inst2)
Returns true if the two temporal instant values are equal.
Definition: tinstant.c:871
Structure to represent periods.
Definition: timetypes.h:52
TInstant * tinstant_restrict_values(const TInstant *inst, const Datum *values, int count, bool atfunc)
Restricts the temporal value to the array of base values.
Definition: tinstant.c:627
bool tinstant_always_eq(const TInstant *inst, Datum value)
Returns true if temporal value is always equal to the base value.
Definition: tinstant.c:542
char * tinstant_to_string(const TInstant *inst, char *(*value_out)(Oid, Datum))
Returns the string representation of the temporal value.
Definition: tinstant.c:249
TInstant * tinstant_restrict_timestamp(const TInstant *inst, TimestampTz t, bool atfunc)
Restricts the temporal value to the (complement of the) timestamp.
Definition: tinstant.c:721
bool tinstant_restrict_periodset_test(const TInstant *inst, const PeriodSet *ps, bool atfunc)
Returns true if the temporal value satisfies the restriction to the timestamp set.
Definition: tinstant.c:790
TInstant * tinstant_make(Datum value, TimestampTz t, Oid basetypid)
Construct a temporal instant value from the arguments.
Definition: tinstant.c:120
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: temporal.h:241
bool tinstant_always_le(const TInstant *inst, Datum value)
Returns true if the temporal value is always less than or equal to the base value.
Definition: tinstant.c:582
bool tinstant_restrict_timestampset_test(const TInstant *inst, const TimestampSet *ts, bool atfunc)
Returns true if the temporal value satisfies the restriction to the timestamp set.
Definition: tinstant.c:750
bool tinstant_restrict_values_test(const TInstant *inst, const Datum *values, int count, bool atfunc)
Returns true if the temporal value satisfies the restriction to the (complement of the) array of base...
Definition: tinstant.c:611
TInstant * tinstantset_to_tinstant(const TInstantSet *ti)
Transform the temporal instant set value into a temporal instant value.
Definition: tinstant.c:385
ArrayType * tinstant_instants_array(const TInstant *inst)
Returns the temporal value as an array.
Definition: tinstant.c:507
bool tinstant_intersects_timestampset(const TInstant *inst, const TimestampSet *ts)
Returns true if the temporal value intersects the timestamp set.
Definition: tinstant.c:826
ArrayType * tinstant_values_array(const TInstant *inst)
Returns the base value of the temporal value as an array.
Definition: tinstant.c:429
Datum * tinstant_value_ptr(const TInstant *inst)
Returns a pointer to the base value of the temporal instant value.
Definition: tinstant.c:67
void tinstant_set(TInstant *inst, Datum value, TimestampTz t)
Sets the value and the timestamp of the temporal instant value.
Definition: tinstant.c:230
Basic functions for temporal types of any subtype.
const TInstant ** tinstant_instants(const TInstant *inst, int *count)
Returns the instants of the temporal value as a C array.
Definition: tinstant.c:495
TInstant * tinstant_restrict_period(const TInstant *inst, const Period *p, bool atfunc)
Restricts the temporal value to the period.
Definition: tinstant.c:775
bool intersection_tinstant_tinstant(const TInstant *inst1, const TInstant *inst2, TInstant **inter1, TInstant **inter2)
Temporally intersect the two temporal values.
Definition: tinstant.c:325
Structure to represent period sets.
Definition: timetypes.h:84
uint32 tinstant_hash(const TInstant *inst)
Returns the hash value of the temporal value.
Definition: tinstant.c:922
TInstant * tintinst_to_tfloatinst(const TInstant *inst)
Cast the temporal integer value as a temporal float value.
Definition: tinstant.c:344
ArrayType * tfloatinst_ranges(const TInstant *inst)
Returns the base value of the temporal float value as a range.
Definition: tinstant.c:440
TInstant * tinstant_copy(const TInstant *inst)
Returns a copy of the temporal instant value.
Definition: tinstant.c:213
Structure to represent temporal values of sequence set subtype.
Definition: temporal.h:293
Structure to represent timestamp sets.
Definition: timetypes.h:73
ArrayType * tinstant_timestamps(const TInstant *inst)
Returns the timestamp of the temporal value as an array.
Definition: tinstant.c:485
bool tnumberinst_restrict_ranges_test(const TInstant *inst, RangeType **normranges, int count, bool atfunc)
Returns true if the temporal number satisfies the restriction to the (complement of the) array of ran...
Definition: tinstant.c:685
TInstant * tinstant_restrict_periodset(const TInstant *inst, const PeriodSet *ps, bool atfunc)
Restricts the temporal value to the period set.
Definition: tinstant.c:802
PeriodSet * tinstant_get_time(const TInstant *inst)
Returns the time on which the temporal value is defined as a period set.
Definition: tinstant.c:453
PostGIS definitions that are needed in MobilityDB but are not exported in PostGIS headers...
Structure to represent temporal values of instant set subtype.
Definition: temporal.h:266
bool tinstant_intersects_timestamp(const TInstant *inst, TimestampTz t)
Returns true if the temporal value intersects the timestamp.
Definition: tinstant.c:817
TInstant * tinstant_restrict_timestampset(const TInstant *inst, const TimestampSet *ts, bool atfunc)
Restricts the temporal value to the timestamp set.
Definition: tinstant.c:763
bool tinstant_intersects_periodset(const TInstant *inst, const PeriodSet *ps)
Returns true if the temporal value intersects the period set.
Definition: tinstant.c:848
Datum tinstant_value(const TInstant *inst)
Returns the base value of the temporal value.
Definition: tinstant.c:76
TInstant * tinstant_shift(const TInstant *inst, const Interval *interval)
Shift the time span of the temporal value by the interval.
Definition: tinstant.c:516
TInstant * tsequenceset_to_tinstant(const TSequenceSet *ts)
Transform the temporal sequence set value into a temporal instant value.
Definition: tinstant.c:411
Temporal * tinstant_merge_array(const TInstant **instants, int count)
Merge the array of temporal instant values.
Definition: tinstant.c:192
TInstant * tnumberinst_restrict_ranges(const TInstant *inst, RangeType **normranges, int count, bool atfunc)
Restricts the temporal number to the (complement of the) array of ranges of base values.
Definition: tinstant.c:706
bool tnumberinst_restrict_range_test(const TInstant *inst, const RangeType *range, bool atfunc)
Returns true if the temporal number satisfies the restriction to the (complement of the) range of bas...
Definition: tinstant.c:647
TInstant * tnumberinst_restrict_range(const TInstant *inst, const RangeType *range, bool atfunc)
Restricts the temporal number to the (complement of the) range of base values.
Definition: tinstant.c:669
bool tinstant_always_lt(const TInstant *inst, Datum value)
Returns true if the temporal value is always less than the base value.
Definition: tinstant.c:572
Datum tinstant_value_copy(const TInstant *inst)
Returns a copy of the base value of the temporal instant value.
Definition: tinstant.c:90
TInstant * tsequence_to_tinstant(const TSequence *seq)
Transform the temporal sequence value into a temporal instant value.
Definition: tinstant.c:398
bool tinstant_ever_lt(const TInstant *inst, Datum value)
Returns true if the temporal value is ever less than the base value.
Definition: tinstant.c:553
bool tinstant_value_at_timestamp(const TInstant *inst, TimestampTz t, Datum *result)
Returns the base value of the temporal value at the timestamp.
Definition: tinstant.c:735
void tinstant_write(const TInstant *inst, StringInfo buf)
Write the binary representation of the temporal value into the buffer.
Definition: tinstant.c:276
ArrayType * tinstant_sequences_array(const TInstant *inst)
Returns the sequences of the temporal value as a PostgreSQL array.
Definition: tinstant.c:472
Temporal * tinstant_merge(const TInstant *inst1, const TInstant *inst2)
Merge two temporal instant values.
Definition: tinstant.c:178
bool tinstant_ever_le(const TInstant *inst, Datum value)
Returns true if the temporal value is ever less than or equal to the base value.
Definition: tinstant.c:563
bool tinstant_intersects_period(const TInstant *inst, const Period *p)
Returns true if the temporal value intersects the period.
Definition: tinstant.c:839
Structure to represent temporal values of sequence subtype.
Definition: temporal.h:279
int tinstant_cmp(const TInstant *inst1, const TInstant *inst2)
Returns -1, 0, or 1 depending on whether the first temporal value is less than, equal, or greater than the second one.
Definition: tinstant.c:892
TInstant * tinstant_read(StringInfo buf, Oid basetypid)
Returns a new temporal value from its binary representation read from the buffer. ...
Definition: tinstant.c:297
TInstant * tinstant_restrict_value(const TInstant *inst, Datum value, bool atfunc)
Restricts the temporal value to (the complement of) the base value.
Definition: tinstant.c:595
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253