forked from qt-creator/qt-creator
Nanotracer: Add copy for object token
Change-Id: I8d11284db1b38eeff6f271495f3095b49415f78c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
@@ -421,9 +421,25 @@ public:
|
|||||||
|
|
||||||
ObjectToken() = default;
|
ObjectToken() = default;
|
||||||
|
|
||||||
ObjectToken(const ObjectToken &other) = delete;
|
ObjectToken(const ObjectToken &other)
|
||||||
|
: m_name{other.m_name}
|
||||||
|
, m_category{other.m_category}
|
||||||
|
{
|
||||||
|
if (other.m_id)
|
||||||
|
m_id = m_category->beginObject(m_name).m_id;
|
||||||
|
}
|
||||||
|
|
||||||
ObjectToken &operator=(const ObjectToken &other) = delete;
|
ObjectToken &operator=(const ObjectToken &other)
|
||||||
|
{
|
||||||
|
if (this != &other) {
|
||||||
|
~ObjectToken();
|
||||||
|
if (other.m_id) {
|
||||||
|
m_category = other.m_category;
|
||||||
|
m_name = other.m_name;
|
||||||
|
m_id = other.m_category->beginObject(other.m_name).m_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ObjectToken(ObjectToken &&other) noexcept
|
ObjectToken(ObjectToken &&other) noexcept
|
||||||
: m_name{std::move(other.m_name)}
|
: m_name{std::move(other.m_name)}
|
||||||
|
|||||||
Reference in New Issue
Block a user