#ifndef QUERY_RECORD_HPP #define QUERY_RECORD_HPP #include "matador/sql/column.hpp" #include #include namespace matador::sql { class record { private: using column_by_index = std::vector; using column_index_pair = std::pair, size_t>; using column_by_name_map = std::unordered_map; public: using iterator = column_by_index::iterator; using const_iterator = column_by_index::const_iterator; record() = default; record(std::initializer_list columns); ~record() = default; template < typename Type > void append(const std::string &name, long size = -1) { append(make_column(name, size)); } void append(column col); [[nodiscard]] const column& at(const std::string &name) const; const column& at(size_t index); iterator find(const std::string &column_name); const_iterator find(const std::string &column_name) const; iterator begin(); [[nodiscard]] const_iterator begin() const; [[nodiscard]] const_iterator cbegin() const; iterator end(); [[nodiscard]] const_iterator end() const; [[nodiscard]] const_iterator cend() const; [[nodiscard]] size_t size() const; private: column_by_index columns_; column_by_name_map columns_by_name_; }; } #endif //QUERY_RECORD_HPP