Mantid
Loading...
Searching...
No Matches
Row.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9#include <boost/algorithm/string/predicate.hpp>
11
12Row::Row(RowLocation location, std::vector<Cell> cells) : m_location(std::move(location)), m_cells(std::move(cells)) {}
13
14RowLocation const &Row::location() const { return m_location; }
15
16std::vector<Cell> const &Row::cells() const { return m_cells; }
17std::vector<Cell> &Row::cells() { return m_cells; }
18
19std::ostream &operator<<(std::ostream &os, Row const &row) {
20 os << row.location() << " ";
21 for (auto &&cell : row.cells())
22 os << cell;
23 return os;
24}
25
26bool operator==(Row const &lhs, Row const &rhs) {
27 return lhs.location() == rhs.location() && lhs.cells() == rhs.cells();
28}
29
30bool operator!=(Row const &lhs, Row const &rhs) { return !(lhs == rhs); }
31
32bool operator<(Row const &lhs, Row const &rhs) { return lhs.location() < rhs.location(); }
33
34bool operator<=(Row const &lhs, Row const &rhs) { return lhs < rhs || lhs == rhs; }
35
36bool operator>=(Row const &lhs, Row const &rhs) { return !(lhs < rhs); }
37
38bool operator>(Row const &lhs, Row const &rhs) { return !(lhs <= rhs); }
39} // namespace MantidQt::MantidWidgets::Batch
const std::vector< double > & rhs
std::vector< Cell > m_cells
Definition: Row.h:34
Row(RowLocation location, std::vector< Cell > cells)
Definition: Row.cpp:12
RowLocation const & location() const
Definition: Row.cpp:14
std::vector< Cell > const & cells() const
Definition: Row.cpp:16
EXPORT_OPT_MANTIDQT_COMMON bool operator<=(Row const &lhs, Row const &rhs)
Definition: Row.cpp:34
EXPORT_OPT_MANTIDQT_COMMON bool operator>(Row const &lhs, Row const &rhs)
Definition: Row.cpp:38
EXPORT_OPT_MANTIDQT_COMMON std::ostream & operator<<(std::ostream &os, Cell const &cell)
Definition: Cell.cpp:83
EXPORT_OPT_MANTIDQT_COMMON bool operator<(Row const &lhs, Row const &rhs)
Definition: Row.cpp:32
EXPORT_OPT_MANTIDQT_COMMON bool operator==(Cell const &lhs, Cell const &rhs)
Definition: Cell.cpp:88
EXPORT_OPT_MANTIDQT_COMMON bool operator>=(Row const &lhs, Row const &rhs)
Definition: Row.cpp:36
EXPORT_OPT_MANTIDQT_COMMON bool operator!=(Cell const &lhs, Cell const &rhs)
Definition: Cell.cpp:93
STL namespace.