File indexing completed on 2024-04-21 16:32:05

0001 /* This file is part of Kairo Timer
0002 
0003    SPDX-FileCopyrightText: 2016 (c) Kevin Ottens <ervin@kde.org>
0004 
0005    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 
0007 */
0008 
0009 #include "circuitmodel.h"
0010 
0011 CircuitModel::CircuitModel() = default;
0012 
0013 CircuitModel::CircuitModel(const QString &name, std::initializer_list<TimerModel> content)
0014     : CircuitModel(name, QVector<TimerModel>(content))
0015 {
0016 }
0017 
0018 CircuitModel::CircuitModel(const QString &name, const QVector<TimerModel> &content)
0019     : m_name(name),
0020       m_content(content)
0021 {
0022 }
0023 
0024 bool CircuitModel::operator==(const CircuitModel &other) const
0025 {
0026     return m_name == other.m_name
0027         && m_content == other.m_content;
0028 }
0029 
0030 bool CircuitModel::operator!=(const CircuitModel &other) const
0031 {
0032     return !(*this == other);
0033 }
0034 
0035 QString CircuitModel::name() const
0036 {
0037     return m_name;
0038 }
0039 
0040 bool CircuitModel::isEmpty() const
0041 {
0042     return m_content.isEmpty();
0043 }
0044 
0045 int CircuitModel::size() const
0046 {
0047     return m_content.size();
0048 }
0049 
0050 TimerModel CircuitModel::at(int index) const
0051 {
0052     return m_content.at(index);
0053 }