/
farado
/
farado-binara
Обзор
Документация
Войти
/
farado
/
farado-binara
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
develop
src/common/elements/workflow.cpp
81 строка
2 KB
Ostapenko Alexey
[common] Удаление лишних include.
20 мар 2024, 18:04
20 мар 2024, 18:04
b11d4b4
Код
Авторство
О чём код?
#include <mutex> #include "workflow.h" namespace Elements { Workflow::Workflow(const Workflow& other) : Element(other) , m_caption(other.m_caption) , m_description(other.m_description) { } bool Workflow::isSame(Element* const other) const { const auto otherElement = dynamic_cast<Workflow const*>(other); if (nullptr == otherElement) return false; return bool( m_id == otherElement->m_id && m_caption == otherElement->m_caption && m_description == otherElement->m_description ); } Common::Json Workflow::toJson() const { std::shared_lock locker(m_lock); Common::Json result; result["id"] = m_id; result["elementType"] = unsigned(elementType()); result["caption"] = m_caption; result["description"] = m_description; return result; } void Workflow::fromJson(const Common::Json& json) { std::shared_lock locker(m_lock); m_id = json["id"].get<unsigned>(); m_caption = json["caption"].get<std::string>(); m_description = json["description"].get<std::string>(); } Element* Workflow::clone() const { return new Workflow(*this); } ElementType Workflow::elementType() const { return ElementType::Workflow; } std::string Workflow::caption() const { std::shared_lock locker(m_lock); return m_caption; } void Workflow::setCaption(const std::string& value) { std::unique_lock locker(m_lock); m_caption = value; } std::string Workflow::description() const { std::shared_lock locker(m_lock); return m_description; } void Workflow::setDescription(const std::string& value) { std::unique_lock locker(m_lock); m_description = value; } } // namespace Elements