codekingpro/portable-devtools
115k
1/*-------------------------------------------------------------------------2 *3 * multibitmapset.h4 * Lists of Bitmapsets5 *6 * A multibitmapset is useful in situations where members of a set can7 * be identified by two small integers; for example, varno and varattno8 * of a group of Vars within a query. The implementation is a List of9 * Bitmapsets, so that the empty set can be represented by NIL. (But,10 * as with Bitmapsets, that's not the only allowed representation.)11 * The zero-based index of a List element is the first identifying value,12 * and the (also zero-based) index of a bit within that Bitmapset is13 * the second identifying value. There is no expectation that the14 * Bitmapsets should all be the same size.15 *16 * The available operations on multibitmapsets are intended to parallel17 * those on bitmapsets, for example union and intersection. So far only18 * a small fraction of that has been built out; we'll add more as needed.19 *20 *21 * Copyright (c) 2022-2023, PostgreSQL Global Development Group22 *23 * src/include/nodes/multibitmapset.h24 *25 *-------------------------------------------------------------------------26 */27#ifndef MULTIBITMAPSET_H28#define MULTIBITMAPSET_H29 30#include "nodes/bitmapset.h"31#include "nodes/pg_list.h"32 33extern List *mbms_add_member(List *a, int listidx, int bitidx);34extern List *mbms_add_members(List *a, const List *b);35extern List *mbms_int_members(List *a, const List *b);36extern bool mbms_is_member(int listidx, int bitidx, const List *a);37extern Bitmapset *mbms_overlap_sets(const List *a, const List *b);38 39#endif /* MULTIBITMAPSET_H */40 