Relational Algebra Engine
Loading...
Searching...
No Matches
Typedefs | Functions
tuple.h File Reference
#include "attribute.h"
#include "set.h"
Include dependency graph for tuple.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef Set Tuple
 

Functions

Tuple * tuple_create (void)
 Create a new Tuple.
 
void tuple_destroy (Tuple *t)
 Destroy a Tuple and free its memory.
 
int tuple_add_attribute (Tuple *t, Attribute *attr)
 Add an Attribute to a Tuple.
 
void tuple_print (const Tuple *t)
 Print a Tuple to stdout.
 
Attribute * tuple_find_attribute (Tuple *t, const char *name)
 Find an Attribute in a Tuple by name.
 
int tuple_equals (Tuple *a, Tuple *b)
 Check if two Tuples are equal (all attributes match).
 

Typedef Documentation

◆ Tuple

typedef Set Tuple

Function Documentation

◆ tuple_add_attribute()

int tuple_add_attribute ( Tuple *  t,
Attribute *  attr 
)

Add an Attribute to a Tuple.

Parameters
tPointer to the Tuple.
attrPointer to the Attribute to add.
Returns
1 if added, 0 if already present, -1 on error.

◆ tuple_create()

Tuple * tuple_create ( void  )

Create a new Tuple.

Returns
Pointer to new Tuple, or NULL on failure.

◆ tuple_destroy()

void tuple_destroy ( Tuple *  t)

Destroy a Tuple and free its memory.

Parameters
tPointer to the Tuple to destroy.

◆ tuple_equals()

int tuple_equals ( Tuple *  a,
Tuple *  b 
)

Check if two Tuples are equal (all attributes match).

Parameters
aPointer to first Tuple.
bPointer to second Tuple.
Returns
1 if equal, 0 otherwise.

◆ tuple_find_attribute()

Attribute * tuple_find_attribute ( Tuple *  t,
const char *  name 
)

Find an Attribute in a Tuple by name.

Parameters
tPointer to the Tuple.
nameName of the Attribute to find.
Returns
Pointer to the found Attribute, or NULL if not found.

◆ tuple_print()

void tuple_print ( const Tuple *  t)

Print a Tuple to stdout.

Parameters
tPointer to the Tuple to print.