Line data Source code
1 : /*! 2 : * \file esys/repo/tui/workerstate.cpp 3 : * \brief 4 : * 5 : * \cond 6 : * __legal_b__ 7 : * 8 : * Copyright (c) 2026 Michel Gillet 9 : * Distributed under the MIT License. 10 : * (See accompanying file LICENSE.txt or 11 : * copy at https://opensource.org/licenses/MIT) 12 : * 13 : * __legal_e__ 14 : * \endcond 15 : * 16 : */ 17 : 18 : #include "esys/repo/esysrepo_prec.h" 19 : #include "esys/repo/tui/workerstate.h" 20 : 21 : namespace esys::repo::tui 22 : { 23 : 24 0 : WorkerState::WorkerState() = default; 25 : 26 3 : WorkerState::WorkerState(int id) 27 3 : : m_id(id) 28 : { 29 3 : } 30 : 31 3 : WorkerState::~WorkerState() = default; 32 : 33 0 : void WorkerState::set_id(int id) 34 : { 35 0 : m_id = id; 36 0 : } 37 : 38 0 : int WorkerState::get_id() const 39 : { 40 0 : return m_id; 41 : } 42 : 43 4 : void WorkerState::set_busy(bool busy) 44 : { 45 4 : m_busy = busy; 46 4 : } 47 : 48 15 : bool WorkerState::get_busy() const 49 : { 50 15 : return m_busy; 51 : } 52 : 53 4 : void WorkerState::set_repo_index(std::optional<std::size_t> repo_index) 54 : { 55 4 : m_repo_index = repo_index; 56 4 : } 57 : 58 3 : std::optional<std::size_t> WorkerState::get_repo_index() const 59 : { 60 3 : return m_repo_index; 61 : } 62 : 63 4 : void WorkerState::set_last_event(const std::string &last_event) 64 : { 65 4 : m_last_event = last_event; 66 4 : } 67 : 68 0 : const std::string &WorkerState::get_last_event() const 69 : { 70 0 : return m_last_event; 71 : } 72 : 73 5 : void WorkerState::set_errored(bool errored) 74 : { 75 5 : m_errored = errored; 76 5 : } 77 : 78 1 : bool WorkerState::get_errored() const 79 : { 80 1 : return m_errored; 81 : } 82 : 83 : } // namespace esys::repo::tui