next up previous contents
Next: GetErrorMessage Up: SSTable Static Method Descriptions Previous: SetIntersect

SetUnion

NAME SetUnion

PROTOTYPE

#include "SSTable.h"

static ReVarPCifArray<int> * SSTable::SetUnion(
           ReVarPCifArray<int> * a, ReVarPCifArray<int> * b);
static ReVarPCifArray<int> * SSTable::SetUnion(
           ReVarPCifArray<int> ** sets, int num);

EXAMPLE

#include "SSTable.h"

SSTable s("MyTable");
...
CifString cs("Target"), col1("column1");
CifString cs2("Target2"), col2("column2");
int errCode = 0;

ReVarPCifArray<int> * iArray = SSTable::SetUnion(s.SearchColumn(cs,
  col1, errCode), s.SearchColumn(cs2, col2, errCode));
PURPOSE

SetUnion(ReVarPCifArray *, ReVarPCifArray *) is a static method that returns the logical union of two sets of integers.
SetUnion(ReVarPCifArray **, int) is a static method that returns the logical union of any number of sets of integers.

RECEIVES

SetUnion(ReVarCifArray<int> *, ReVarCifArray<int> *)
a The first set to take the union with.
b The second set to take the union with.

SetUnion(ReVarCifArray<int> **, int)
sets An array of pointers to sets of integers.
num The number of elements in the given array.

RETURN VALUE

ReVarPCifArray<int> *, a pointer to a set representing the union of all sets passed to it.

REMARKS

These methods are useful for performing multiple column searches with logical OR operations.



Olivera Tosic
12/17/1999