1#include "duckdb/parser/tableref/crossproductref.hpp"
2
3#include "duckdb/common/serializer.hpp"
4
5using namespace duckdb;
6using namespace std;
7
8bool CrossProductRef::Equals(const TableRef *other_) const {
9 if (!TableRef::Equals(other_)) {
10 return false;
11 }
12 auto other = (CrossProductRef *)other_;
13 return left->Equals(other->left.get()) && right->Equals(other->right.get());
14}
15
16unique_ptr<TableRef> CrossProductRef::Copy() {
17 auto copy = make_unique<CrossProductRef>();
18 copy->left = left->Copy();
19 copy->right = right->Copy();
20 copy->alias = alias;
21 return move(copy);
22}
23
24void CrossProductRef::Serialize(Serializer &serializer) {
25 TableRef::Serialize(serializer);
26
27 left->Serialize(serializer);
28 right->Serialize(serializer);
29}
30
31unique_ptr<TableRef> CrossProductRef::Deserialize(Deserializer &source) {
32 auto result = make_unique<CrossProductRef>();
33
34 result->left = TableRef::Deserialize(source);
35 result->right = TableRef::Deserialize(source);
36
37 if (!result->left || !result->right) {
38 return nullptr;
39 }
40
41 return move(result);
42}
43