MobilityDB  1.0

◆ timestampset_find_timestamp()

bool timestampset_find_timestamp ( const TimestampSet ts,
TimestampTz  t,
int *  loc 
)

Returns the location of the timestamp in the timestamp set value using binary search.

If the timestamp is found, the index of the timestamp is returned in the output parameter. Otherwise, return a number encoding whether it is before, between two timestamps, or after the timestamp set value. For example, given a value composed of 3 timestamps and a timestamp, the result of the function is as follows:

0 1 2
| | |
1) t^ => loc = 0
2) t^ => loc = 0
3) t^ => loc = 1
4) t^ => loc = 2
5) t^ => loc = 3
Parameters
[in]tsTimestamp set value
[in]tTimestamp
[out]locLocation
Returns
Returns true if the timestamp is contained in the timestamp set value