File indexing completed on 2024-04-28 17:02:20

0001 /*
0002    This file is part of Massif Visualizer
0003 
0004    Copyright 2010 Milian Wolff <mail@milianw.de>
0005 
0006    This library is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU Lesser General Public
0008    License as published by the Free Software Foundation; either
0009    version 2.1 of the License, or (at your option) version 3, or any
0010    later version accepted by the membership of KDE e.V. (or its
0011    successor approved by the membership of KDE e.V.), which shall
0012    act as a proxy defined in Section 6 of version 3 of the license.
0013 
0014    This library is distributed in the hope that it will be useful,
0015    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017    Lesser General Public License for more details.
0018 
0019    You should have received a copy of the GNU Lesser General Public
0020    License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0021 */
0022 
0023 #include "filedata.h"
0024 #include "snapshotitem.h"
0025 
0026 using namespace Massif;
0027 
0028 FileData::FileData(QObject* parent) : QObject(parent), m_peak(0)
0029 {
0030 }
0031 
0032 FileData::~FileData()
0033 {
0034     qDeleteAll(m_snapshots);
0035 }
0036 
0037 void FileData::setCmd(const QString& cmd)
0038 {
0039     m_cmd = cmd;
0040 }
0041 
0042 QString FileData::cmd() const
0043 {
0044     return m_cmd;
0045 }
0046 
0047 void FileData::setDescription(const QString& description)
0048 {
0049     m_description = description;
0050 }
0051 
0052 QString FileData::description() const
0053 {
0054     return m_description;
0055 }
0056 
0057 void FileData::setTimeUnit(const QString& unit)
0058 {
0059     m_timeUnit = unit;
0060 }
0061 
0062 QString FileData::timeUnit() const
0063 {
0064     return m_timeUnit;
0065 }
0066 
0067 void FileData::addSnapshot(SnapshotItem* snapshot)
0068 {
0069     m_snapshots << snapshot;
0070 }
0071 
0072 QVector< SnapshotItem* > FileData::snapshots() const
0073 {
0074     return m_snapshots;
0075 }
0076 
0077 void FileData::setPeak(SnapshotItem* snapshot)
0078 {
0079     Q_ASSERT(m_snapshots.contains(snapshot));
0080     m_peak = snapshot;
0081 }
0082 
0083 SnapshotItem* FileData::peak() const
0084 {
0085     return m_peak;
0086 }