LCOV - code coverage report
Current view: top level - src/esys/repo/progress - schedulerstateevent.cpp (source / functions) Hit Total Coverage
Test: esysrepo_coverage.info Lines: 19 41 46.3 %
Date: 2026-08-01 10:43:40 Functions: 7 15 46.7 %

          Line data    Source code
       1             : /*!
       2             :  * \file esys/repo/progress/schedulerstateevent.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/schedulerstateevent.h"
      20             : 
      21             : namespace esys::repo::progress
      22             : {
      23             : 
      24           0 : SchedulerStateEvent::SchedulerStateEvent() = default;
      25             : 
      26         359 : SchedulerStateEvent::SchedulerStateEvent(std::size_t pending_queue, std::size_t running_count,
      27         359 :                                          std::size_t active_workers, bool paused, bool backpressure)
      28         359 :     : m_pending_queue(pending_queue)
      29         359 :     , m_running_count(running_count)
      30         359 :     , m_active_workers(active_workers)
      31         359 :     , m_paused(paused)
      32         359 :     , m_backpressure(backpressure)
      33             : {
      34         359 : }
      35             : 
      36         732 : SchedulerStateEvent::~SchedulerStateEvent() = default;
      37             : 
      38           0 : void SchedulerStateEvent::set_pending_queue(std::size_t pending_queue)
      39             : {
      40           0 :     m_pending_queue = pending_queue;
      41           0 : }
      42             : 
      43           4 : std::size_t SchedulerStateEvent::get_pending_queue() const
      44             : {
      45           4 :     return m_pending_queue;
      46             : }
      47             : 
      48           0 : void SchedulerStateEvent::set_running_count(std::size_t running_count)
      49             : {
      50           0 :     m_running_count = running_count;
      51           0 : }
      52             : 
      53           1 : std::size_t SchedulerStateEvent::get_running_count() const
      54             : {
      55           1 :     return m_running_count;
      56             : }
      57             : 
      58           0 : void SchedulerStateEvent::set_active_workers(std::size_t active_workers)
      59             : {
      60           0 :     m_active_workers = active_workers;
      61           0 : }
      62             : 
      63           4 : std::size_t SchedulerStateEvent::get_active_workers() const
      64             : {
      65           4 :     return m_active_workers;
      66             : }
      67             : 
      68           0 : void SchedulerStateEvent::set_paused(bool paused)
      69             : {
      70           0 :     m_paused = paused;
      71           0 : }
      72             : 
      73           4 : bool SchedulerStateEvent::get_paused() const
      74             : {
      75           4 :     return m_paused;
      76             : }
      77             : 
      78           0 : void SchedulerStateEvent::set_backpressure(bool backpressure)
      79             : {
      80           0 :     m_backpressure = backpressure;
      81           0 : }
      82             : 
      83           4 : bool SchedulerStateEvent::get_backpressure() const
      84             : {
      85           4 :     return m_backpressure;
      86             : }
      87             : 
      88           0 : bool SchedulerStateEvent::operator==(const SchedulerStateEvent &other) const
      89             : {
      90           0 :     return m_pending_queue == other.m_pending_queue && m_running_count == other.m_running_count
      91           0 :            && m_active_workers == other.m_active_workers && m_paused == other.m_paused
      92           0 :            && m_backpressure == other.m_backpressure;
      93             : }
      94             : 
      95           0 : bool SchedulerStateEvent::operator!=(const SchedulerStateEvent &other) const
      96             : {
      97           0 :     return !(*this == other);
      98             : }
      99             : 
     100             : } // namespace esys::repo::progress

Generated by: LCOV version 1.14