indexes WIP
This commit is contained in:
24
row.h
24
row.h
@@ -36,7 +36,7 @@ namespace usql {
|
||||
|
||||
int compare(ColValue &other) override;
|
||||
|
||||
virtual ~ColNullValue() = default;
|
||||
~ColNullValue() override = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace usql {
|
||||
|
||||
long m_integer;
|
||||
|
||||
virtual ~ColIntegerValue() = default;
|
||||
~ColIntegerValue() override = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace usql {
|
||||
|
||||
int compare(ColValue &other) override;
|
||||
|
||||
virtual ~ColDoubleValue() = default;
|
||||
~ColDoubleValue() override = default;
|
||||
|
||||
double m_double;
|
||||
};
|
||||
@@ -109,7 +109,7 @@ namespace usql {
|
||||
|
||||
int compare(ColValue &other) override;
|
||||
|
||||
virtual ~ColDateValue() = default;
|
||||
~ColDateValue() override = default;
|
||||
|
||||
long m_date; // seconds since epoch for now
|
||||
};
|
||||
@@ -127,7 +127,7 @@ namespace usql {
|
||||
|
||||
int compare(ColValue &other) override;
|
||||
|
||||
virtual ~ColBooleanValue() = default;
|
||||
~ColBooleanValue() override = default;
|
||||
|
||||
bool m_bool;
|
||||
};
|
||||
@@ -137,7 +137,7 @@ namespace usql {
|
||||
class Row {
|
||||
|
||||
public:
|
||||
explicit Row(int cols_count) : m_columns(cols_count) {};
|
||||
explicit Row(int cols_count, bool visible) : m_columns(cols_count), m_visible(visible) {};
|
||||
Row(const Row &other);
|
||||
|
||||
Row &operator=(Row other);
|
||||
@@ -169,16 +169,22 @@ namespace usql {
|
||||
return (ColValue &) *std::get_if<ColDateValue>(&m_columns[i]);
|
||||
case 5:
|
||||
return (ColValue &) *std::get_if<ColBooleanValue>(&m_columns[i]);
|
||||
default:
|
||||
throw Exception("should not happen");
|
||||
}
|
||||
throw Exception("should not happen");
|
||||
}
|
||||
|
||||
int compare(const Row &other) const;
|
||||
[[nodiscard]] int compare(const Row &other) const;
|
||||
|
||||
void print(const std::vector<ColDefNode> &col_defs);
|
||||
static int print_get_column_size(const ColDefNode &col_def);
|
||||
|
||||
[[nodiscard]] bool is_visible() const { return m_visible; };
|
||||
void set_visible() { m_visible = true; };
|
||||
void set_deleted() { m_visible = true; };
|
||||
|
||||
private:
|
||||
// xx std::vector<std::unique_ptr<ColValue>> m_columns;
|
||||
bool m_visible;
|
||||
std::vector<std::variant<ColNullValue, ColIntegerValue, ColDoubleValue, ColStringValue, ColDateValue, ColBooleanValue>> m_columns;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user