LCOV - code coverage report
Current view: top level - include/Module/Delayer - Delayer.hpp (source / functions) Hit Total Coverage
Test: streampu_clean.info Lines: 0 1 0.0 %
Date: 2024-06-12 12:04:18 Functions: 0 20 0.0 %

          Line data    Source code
       1             : #ifndef DELAYER_HPP_
       2             : #define DELAYER_HPP_
       3             : 
       4             : #include <iostream>
       5             : #include <string>
       6             : #include <vector>
       7             : 
       8             : #include "Module/Module.hpp"
       9             : 
      10             : namespace spu
      11             : {
      12             : namespace module
      13             : {
      14             : namespace dly
      15             : {
      16             : enum class tsk : uint8_t
      17             : {
      18             :     memorize,
      19             :     produce,
      20             :     SIZE
      21             : };
      22             : 
      23             : namespace sck
      24             : {
      25             : enum class memorize : uint8_t
      26             : {
      27             :     in,
      28             :     status
      29             : };
      30             : enum class produce : uint8_t
      31             : {
      32             :     out,
      33             :     status
      34             : };
      35             : }
      36             : }
      37             : 
      38             : template<typename D = int>
      39             : class Delayer : public Module
      40             : {
      41             :   public:
      42             :     inline runtime::Task& operator[](const dly::tsk t);
      43             :     inline runtime::Socket& operator[](const dly::sck::memorize s);
      44             :     inline runtime::Socket& operator[](const dly::sck::produce s);
      45             :     inline runtime::Socket& operator[](const std::string& tsk_sck);
      46             : 
      47             :   protected:
      48             :     const size_t size; // Size of one frame (= number of datas in one frame)
      49             :     const D init_val;
      50             :     std::vector<D> data;
      51             : 
      52             :   public:
      53             :     Delayer(const size_t size, const D init_val);
      54           0 :     virtual ~Delayer() = default;
      55             :     virtual Delayer<D>* clone() const;
      56             :     virtual size_t get_size() const;
      57             :     virtual void set_n_frames(const size_t n_frames);
      58             :     void set_data(const std::vector<D>& init);
      59             :     void set_data(const D* init);
      60             : 
      61             :   protected:
      62             :     virtual void _memorize(const D* in, const size_t frame_id);
      63             :     virtual void _produce(D* out, const size_t frame_id);
      64             : };
      65             : 
      66             : }
      67             : }
      68             : 
      69             : #include "Module/Delayer/Delayer.hxx"
      70             : 
      71             : #endif /* DELAYER_HPP_ */

Generated by: LCOV version 1.14