Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Row.h
Go to the documentation of this file.
1
25#ifndef TABLE_ROW_H
26#define TABLE_ROW_H
27
28#include <boost/variant.hpp>
29#include <iterator>
30#include <memory>
31#include <string>
32#include <vector>
33
35
36#include "NdArray/NdArray.h"
37#include "Table/ColumnInfo.h"
38
39namespace Euclid {
40namespace Table {
41
58
59public:
61 using cell_type =
62 boost::variant<bool, int32_t, int64_t, float, double, std::string, std::vector<bool>, std::vector<int32_t>,
65
67
91
93 virtual ~Row() = default;
94
101 std::shared_ptr<ColumnInfo> getColumnInfo() const;
102
109 size_t size() const;
110
120 const cell_type& operator[](const size_t index) const;
121
131 const cell_type& operator[](const std::string& column) const;
132
139 const_iterator begin() const;
140
147 const_iterator end() const;
148
149private:
152};
153
161 explicit cell_stream_adaptor(const Row::cell_type& cell) : m_cell(cell){};
162
164};
165
166std::ostream& operator<<(std::ostream& out, const cell_stream_adaptor& cell);
167
168} // namespace Table
169} // end of namespace Euclid
170
171#endif /* TABLE_ROW_H */
Represents one row of a Table.
Definition Row.h:57
std::vector< cell_type > m_values
Definition Row.h:150
std::shared_ptr< ColumnInfo > m_column_info
Definition Row.h:151
virtual ~Row()=default
Default destructor.
std::vector< cell_type >::const_iterator const_iterator
Definition Row.h:66
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.
Definition Row.h:64
#define ELEMENTS_API
const Row::cell_type & m_cell
Definition Row.h:163
cell_stream_adaptor(const Row::cell_type &cell)
Definition Row.h:161