MobilityDB  1.0
Data Structures | Macros | Enumerations | Functions
skiplist.h File Reference

Skiplist data structure used for performing aggregates. More...

#include <postgres.h>
#include <catalog/pg_type.h>
#include "temporal.h"
Include dependency graph for skiplist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Elem
 Structure to represent elements in the skiplists. More...
 
struct  SkipList
 Structure to represent skiplists that keep the current state of an aggregation. More...
 

Macros

#define SKIPLIST_MAXLEVEL   32
 maximum possible is 47 with current RNG More...
 
#define SKIPLIST_INITIAL_CAPACITY   1024
 
#define SKIPLIST_GROW   1
 double the capacity to expand the skiplist More...
 
#define SKIPLIST_INITIAL_FREELIST   32
 

Enumerations

enum  ElemType { TIMESTAMPTZ, PERIOD, TEMPORAL }
 

Functions

Datum tagg_serialize (PG_FUNCTION_ARGS)
 Serialize the state value. More...
 
Datum tagg_deserialize (PG_FUNCTION_ARGS)
 Deserialize the state value. More...
 
SkipListskiplist_make (FunctionCallInfo fcinfo, void **values, int count, ElemType elemtype)
 Outputs the skiplist in graphviz dot format for visualisation and debugging purposes. More...
 
void * skiplist_headval (SkipList *list)
 Returns the value at the head of the skiplist. More...
 
void skiplist_splice (FunctionCallInfo fcinfo, SkipList *list, void **values, int count, datum_func2 func, bool crossings)
 Splice the skiplist with the array of values using the aggregation function. More...
 
void ** skiplist_values (SkipList *list)
 Returns the values contained in the skiplist. More...
 
void aggstate_set_extra (FunctionCallInfo fcinfo, SkipList *state, void *data, size_t size)
 Reads the state value from the buffer. More...
 
TimestampTz * timestamp_agg (TimestampTz *times1, int count1, TimestampTz *times2, int count2, int *newcount)
 
Period ** period_agg (Period **periods1, int count1, Period **periods2, int count2, int *newcount)
 Generic aggregate function for periods. More...
 
TInstant ** tinstant_tagg (TInstant **instants1, int count1, TInstant **instants2, int count2, Datum(*func)(Datum, Datum), int *newcount)
 
TSequence ** tsequence_tagg (TSequence **sequences1, int count1, TSequence **sequences2, int count2, Datum(*func)(Datum, Datum), bool crossings, int *newcount)
 Generic aggregate function for temporal sequences. More...
 

Detailed Description

Skiplist data structure used for performing aggregates.