Line data Source code
1 : /*! 2 : * \file esys/repo/progress/repoprogressevent.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/progress/repoprogressevent.h" 20 : 21 : namespace esys::repo::progress 22 : { 23 : 24 1158 : RepoProgressEvent::RepoProgressEvent() = default; 25 : 26 2319 : RepoProgressEvent::~RepoProgressEvent() = default; 27 : 28 1158 : void RepoProgressEvent::set_repo_index(std::size_t repo_index) 29 : { 30 1158 : m_repo_index = repo_index; 31 1158 : } 32 : 33 1155 : std::size_t RepoProgressEvent::get_repo_index() const 34 : { 35 1155 : return m_repo_index; 36 : } 37 : 38 1158 : void RepoProgressEvent::set_phase(RepoPhase phase) 39 : { 40 1158 : m_phase = phase; 41 1158 : } 42 : 43 3462 : RepoPhase RepoProgressEvent::get_phase() const 44 : { 45 3462 : return m_phase; 46 : } 47 : 48 1158 : void RepoProgressEvent::set_counters(const TransferCounters &counters) 49 : { 50 1158 : m_counters = counters; 51 1158 : } 52 : 53 2312 : const TransferCounters &RepoProgressEvent::get_counters() const 54 : { 55 2312 : return m_counters; 56 : } 57 : 58 1 : TransferCounters &RepoProgressEvent::get_counters() 59 : { 60 1 : return m_counters; 61 : } 62 : 63 1157 : void RepoProgressEvent::set_detail(const std::string &detail) 64 : { 65 1157 : m_detail = detail; 66 1157 : } 67 : 68 3 : const std::string &RepoProgressEvent::get_detail() const 69 : { 70 3 : return m_detail; 71 : } 72 : 73 0 : bool RepoProgressEvent::operator==(const RepoProgressEvent &other) const 74 : { 75 0 : return (m_repo_index == other.m_repo_index) && (m_phase == other.m_phase) && (m_counters == other.m_counters) 76 0 : && (m_detail == other.m_detail); 77 : } 78 : 79 0 : bool RepoProgressEvent::operator!=(const RepoProgressEvent &other) const 80 : { 81 0 : return !operator==(other); 82 : } 83 : 84 : } // namespace esys::repo::progress