small refactorings

This commit is contained in:
2021-08-15 13:24:16 +02:00
parent b37b0b55ff
commit b03462da6a
8 changed files with 55 additions and 89 deletions

15
row.cpp
View File

@@ -56,24 +56,19 @@ Row::Row(const Row &other) {
ColumnType col_type = other.m_columns[i]->getColType();
switch (col_type) {
case ColumnType::integer_type :
setIntColumnValue(i,
(static_cast<ColIntegerValue *>(other.m_columns[i].get())->getIntValue()));
setIntColumnValue(i, (static_cast<ColIntegerValue *>(other.m_columns[i].get())->getIntValue()));
break;
case ColumnType::float_type :
setFloatColumnValue(i,
(static_cast<ColDoubleValue *>(other.m_columns[i].get())->getDoubleValue()));
setFloatColumnValue(i, (static_cast<ColDoubleValue *>(other.m_columns[i].get())->getDoubleValue()));
break;
case ColumnType::varchar_type :
setStringColumnValue(i,
(static_cast<ColStringValue *>(other.m_columns[i].get())->getStringValue()));
setStringColumnValue(i, (static_cast<ColStringValue *>(other.m_columns[i].get())->getStringValue()));
break;
case ColumnType::date_type :
setDateColumnValue(i,
(static_cast<ColDateValue *>(other.m_columns[i].get())->getDateValue()));
setDateColumnValue(i, (static_cast<ColDateValue *>(other.m_columns[i].get())->getDateValue()));
break;
case ColumnType::bool_type :
setBoolColumnValue(i,
(static_cast<ColBooleanValue *>(other.m_columns[i].get())->getBoolValue()));
setBoolColumnValue(i, (static_cast<ColBooleanValue *>(other.m_columns[i].get())->getBoolValue()));
break;
default:
throw Exception("unsupported column type");