2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-03-04 12:15:18 +01:00
|
|
|
|
|
|
|
|
#include "status.h"
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QSharedData>
|
|
|
|
|
#include <QString>
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2011-05-18 17:05:49 +02:00
|
|
|
namespace Valgrind {
|
|
|
|
|
namespace XmlProtocol {
|
2011-03-04 12:15:18 +01:00
|
|
|
|
|
|
|
|
class Status::Private : public QSharedData
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-12-10 08:11:18 +01:00
|
|
|
State state = Running;
|
2011-03-04 12:15:18 +01:00
|
|
|
QString time;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Status::Status()
|
|
|
|
|
: d(new Private)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-10 08:11:18 +01:00
|
|
|
Status::Status(const Status &other) = default;
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2018-12-10 08:11:18 +01:00
|
|
|
Status::~Status() = default;
|
2011-03-04 12:15:18 +01:00
|
|
|
|
|
|
|
|
void Status::swap(Status &other)
|
|
|
|
|
{
|
|
|
|
|
qSwap(d, other.d);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Status &Status::operator=(const Status &other)
|
|
|
|
|
{
|
|
|
|
|
Status tmp(other);
|
|
|
|
|
swap(tmp);
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Status::operator==(const Status &other) const
|
|
|
|
|
{
|
|
|
|
|
return d->state == other.d->state && d->time == other.d->time;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Status::setState(State state)
|
|
|
|
|
{
|
|
|
|
|
d->state = state;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Status::State Status::state() const
|
|
|
|
|
{
|
|
|
|
|
return d->state;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Status::setTime(const QString &time)
|
|
|
|
|
{
|
|
|
|
|
d->time = time;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString Status::time() const
|
|
|
|
|
{
|
|
|
|
|
return d->time;
|
|
|
|
|
}
|
2011-05-18 17:05:49 +02:00
|
|
|
|
|
|
|
|
} // namespace XmlProtocol
|
|
|
|
|
} // namespace Valgrind
|