29 #include <boost/algorithm/string/join.hpp>
31 #if BOOST_VERSION < 105600
32 #include <boost/units/detail/utility.hpp>
33 using boost::units::detail::demangle;
35 using boost::core::demangle;
41 std::ostream& operator<<(std::ostream& s, const std::vector<T>& v) {
47 while (it != v.end()) {
66 : m_values(std::move(values)), m_column_info{column_info} {
70 if (m_values.size() != m_column_info->size()) {
71 throw Elements::Exception() <<
"Wrong number of row values (" << m_values.size() <<
" instead of "
72 << m_column_info->size();
75 auto& value_type = m_values[i].type();
76 auto& column_type = column_info->getDescription(i).type;
77 auto& column_name = column_info->getDescription(i).name;
79 throw Elements::Exception() <<
"Incompatible cell type for " << column_name <<
": expected "
80 << demangle(column_type.name()) <<
", got " << demangle(value_type.name());
83 static const regex::regex vertical_whitespace{
".*[\\n\\v\\f\\r].*"};
84 for (
auto cell : m_values) {
92 <<
"vertical whitespace characters";
103 return m_values.size();
107 if (index >= m_values.size()) {
110 return m_values[index];
118 return m_values[*index];
122 return m_values.cbegin();
126 return m_values.cend();
const_iterator end() const
Returns a const iterator to the past-the-end cell of the row.
std::vector< cell_type >::const_iterator const_iterator
std::shared_ptr< ColumnInfo > m_column_info
boost::variant< bool, int32_t, int64_t, float, double, std::string, std::vector< bool >, std::vector< int32_t >, std::vector< int64_t >, std::vector< float >, std::vector< double >, NdArray::NdArray< int32_t >, NdArray::NdArray< int64_t >, NdArray::NdArray< float >, NdArray::NdArray< double > > cell_type
The possible cell types.
const_iterator begin() const
Returns a const iterator to the first cell of the row.
size_t size() const
Returns the number of cells in the row.
const cell_type & operator[](const size_t index) const
Returns the value of the column with the given index (zero based)
std::shared_ptr< ColumnInfo > getColumnInfo() const
Returns a ColumnInfo object describing the columns of the Row.