LCOV - code coverage report
Current view: top level - src/Module/Stateful/Controller/Controller_cyclic - Controller_cyclic.cpp (source / functions) Hit Total Coverage
Test: streampu_clean.info Lines: 14 26 53.8 %
Date: 2025-01-11 12:25:42 Functions: 3 7 42.9 %

          Line data    Source code
       1             : #include <string>
       2             : 
       3             : #include "Module/Stateful/Controller/Controller_cyclic/Controller_cyclic.hpp"
       4             : 
       5             : using namespace spu;
       6             : using namespace spu::module;
       7             : 
       8           1 : Controller_cyclic::Controller_cyclic(const size_t n_paths, const size_t init_path)
       9             :   : Controller(init_path % n_paths)
      10           1 :   , n_paths(n_paths)
      11             : {
      12           1 :     const std::string name = "Controller_cyclic";
      13           1 :     this->set_name(name);
      14           1 :     this->tasks[0]->set_replicability(true);
      15           1 : }
      16             : 
      17             : Controller_cyclic*
      18          48 : Controller_cyclic::clone() const
      19             : {
      20          48 :     auto m = new Controller_cyclic(*this);
      21          48 :     m->deep_copy(*this);
      22          48 :     return m;
      23             : }
      24             : 
      25             : size_t
      26           0 : Controller_cyclic::get_n_paths() const
      27             : {
      28           0 :     return this->n_paths;
      29             : }
      30             : 
      31             : void
      32           0 : Controller_cyclic::set_n_paths(const size_t n_paths)
      33             : {
      34           0 :     this->n_paths = n_paths;
      35           0 :     this->path = this->path % this->n_paths;
      36           0 : }
      37             : 
      38             : void
      39           0 : Controller_cyclic::set_path(const size_t path)
      40             : {
      41           0 :     this->path = path % this->n_paths;
      42           0 : }
      43             : 
      44             : void
      45           0 : Controller_cyclic::reset()
      46             : {
      47           0 :     this->path = this->init_path % this->n_paths;
      48           0 : }
      49             : 
      50             : void
      51          49 : Controller_cyclic::_control(int8_t* out, const size_t frame_id)
      52             : {
      53          49 :     out[0] = this->path = this->path % this->n_paths;
      54          49 :     this->path++;
      55          49 : }

Generated by: LCOV version 1.14