/* SPDX-FileCopyrightText: 2020 Michail Vourlakos SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef GENERICTABLEDATA_H #define GENERICTABLEDATA_H // local #include "genericdata.h" // Qt #include namespace Latte { namespace Data { template class GenericTable { public: GenericTable(); GenericTable(GenericTable &&o); GenericTable(const GenericTable &o); //! Operators GenericTable &operator=(const GenericTable &rhs); GenericTable &operator=(GenericTable &&rhs); GenericTable &operator<<(const T &rhs); GenericTable &operator<<(const GenericTable &rhs); GenericTable &insert(const int &pos, const T &rhs); GenericTable &insertBasedOnName(const T &rhs); GenericTable &insertBasedOnId(const T &rhs); bool operator==(const GenericTable &rhs) const; bool operator!=(const GenericTable &rhs) const; T &operator[](const QString &id); const T operator[](const QString &id) const; T &operator[](const uint &index); const T operator[](const uint &index) const; operator QString() const; bool containsId(const QString &id) const; bool containsName(const QString &name) const; bool isEmpty() const; bool rowExists(const int &row) const; int indexOf(const QString &id) const; int rowCount() const; int sortedPosForName(const QString &name) const; int sortedPosForId(const QString &id) const; QString idForName(const QString &name) const; QStringList ids() const; QStringList names() const; void clear(); void remove(const int &row); void remove(const QString &id); protected: //! #id, record QList m_list; }; } } #endif