-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTuple.h
More file actions
32 lines (28 loc) · 850 Bytes
/
Tuple.h
File metadata and controls
32 lines (28 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
/**
* A class that represents a single tuple in a Relation.
*/
class Tuple {
private:
int *values;
unsigned int numValues;
public:
/**
* Tuple constructor. Stores a copy of the specified values.
* @param values An array of int values to be copied into the Tuple.
* @param numValues The length of the array.
*/
Tuple(const int *values, unsigned int numValues);
/**
* Tuple destructor. Deallocates internal state.
*/
~Tuple();
/**
* Returns the value at the specified index in the Tuple in O(1) time, or
* throws an std::invalid_argument.
* @param index The index of the desired value.
* @return The value at the specified index.
* @throw std::invalid_argument if index >= the number of values.
*/
int getValue(unsigned int index) const;
};