Alexandria  2.27.0
SDC-CH common library for the Euclid project
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 
34 #include "ElementsKernel/Export.h"
35 
36 #include "NdArray/NdArray.h"
37 #include "Table/ColumnInfo.h"
38 
39 namespace Euclid {
40 namespace Table {
41 
58 
59 public:
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 
149 private:
152 };
153 
161  explicit cell_stream_adaptor(const Row::cell_type& cell) : m_cell(cell){};
162 
164 };
165 
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
std::ostream & operator<<(std::ostream &s, const cell_stream_adaptor &cell)
Definition: Row.cpp:66
const Row::cell_type & m_cell
Definition: Row.h:161
cell_stream_adaptor(const Row::cell_type &cell)
Definition: Row.h:161