30 #include <boost/regex.hpp>
32 using boost::regex_match;
35 #include <boost/algorithm/string/join.hpp>
37 #if BOOST_VERSION < 105600
38 #include <boost/units/detail/utility.hpp>
39 using boost::units::detail::demangle;
41 using boost::core::demangle;
47 std::ostream& operator<<(std::ostream& s, const std::vector<T>& v) {
52 while (++it != v.end()) {
70 : m_values(std::move(values)), m_column_info{column_info} {
74 if (m_values.size() != m_column_info->size()) {
75 throw Elements::Exception() <<
"Wrong number of row values (" << m_values.size() <<
" instead of " << m_column_info->size();
78 auto& value_type = m_values[i].type();
79 auto& column_type = column_info->getDescription(i).type;
80 auto& column_name = column_info->getDescription(i).name;
82 throw Elements::Exception() <<
"Incompatible cell type for " << column_name <<
": expected " << demangle(column_type.name())
83 <<
", got " << demangle(value_type.name());
86 regex vertical_whitespace{
".*\\v.*"};
87 for (
auto cell : m_values) {
95 <<
"vertical whitespace characters";
106 return m_values.size();
110 if (index >= m_values.size()) {
113 return m_values[index];
121 return m_values[*index];
125 return m_values.cbegin();
129 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.