45 this->m_data =
new T[this->
m_size]{};
75 for (
int i = 0; i <
size; i++)
76 this->m_data[i] =
data[i];
82 if (
this == &other)
return *
this;
96 for (
int i = 0; i <
size; i++)
97 if (this->m_data[i] != other.
data()[i])
The Tuple is a templated class inheriting from the most basic class Variant.
Definition tuple.h:27
T * data()
Gets the data array of the Tuple.
Definition tuple.h:60
virtual ~Tuple()
Definition tuple.h:48
void setData(const T *data)
Sets the data array of the Variant.
Definition tuple.h:72
int m_size
The number of elements that the data array of the Tuple holds.
Definition tuple.h:36
T * m_data
The data array of the Tuple.
Definition tuple.h:35
Tuple(int size)
Constructs a Tuple object with a specified number of elements, and initialize all elements to 0.
Definition tuple.h:41
bool operator!=(const Tuple &other) const
Compares the Tuple with another one, and returns false if they are equal, otherwise returns true.
Definition tuple.h:104
int size() const
Gets the number of elements of the Tuple.
Definition tuple.h:54
const T * data() const
Gets the data array of the Tuple, and the data could not be modified upon which this function is call...
Definition tuple.h:66
bool operator==(const Tuple &other) const
Compares the Tuple with another one, and returns true if they are equal, otherwise returns false.
Definition tuple.h:90
Tuple< T > & operator=(const Tuple &other)
Copys the data of another Tuple to the one on which the operator is invoked.
Definition tuple.h:80
The Variant class is the most basic class of other mathamatic classes.
Definition variant.h:26
std::string m_type
Definition variant.h:28
const std::string & type() const