LCOV - code coverage report
Current view: top level - include/Module/Stateful/Sink - Sink.hpp (source / functions) Hit Total Coverage
Test: streampu_clean.info Lines: 1 1 100.0 %
Date: 2025-03-14 12:33:06 Functions: 1 20 5.0 %

          Line data    Source code
       1             : /*!
       2             :  * \file
       3             :  * \brief Class module::Sink.
       4             :  */
       5             : #ifndef SINK_HPP
       6             : #define SINK_HPP
       7             : 
       8             : #include <cstdint>
       9             : #include <memory>
      10             : #include <vector>
      11             : 
      12             : #include "Module/Stateful/Stateful.hpp"
      13             : #include "Runtime/Socket/Socket.hpp"
      14             : #include "Runtime/Task/Task.hpp"
      15             : #include "Tools/Interface/Interface_reset.hpp"
      16             : 
      17             : namespace spu
      18             : {
      19             : namespace module
      20             : {
      21             : namespace snk
      22             : {
      23             : enum class tsk : size_t
      24             : {
      25             :     send,
      26             :     send_count,
      27             :     SIZE
      28             : };
      29             : 
      30             : namespace sck
      31             : {
      32             : enum class send : size_t
      33             : {
      34             :     in_data,
      35             :     status
      36             : };
      37             : enum class send_count : size_t
      38             : {
      39             :     in_data,
      40             :     in_count,
      41             :     status
      42             : };
      43             : }
      44             : }
      45             : 
      46             : template<typename B = int>
      47             : class Sink
      48             :   : public Stateful
      49             :   , public tools::Interface_reset
      50             : {
      51             :   public:
      52             :     inline runtime::Task& operator[](const snk::tsk t);
      53             :     inline runtime::Socket& operator[](const snk::sck::send s);
      54             :     inline runtime::Socket& operator[](const snk::sck::send_count s);
      55             :     inline runtime::Socket& operator[](const std::string& tsk_sck);
      56             : 
      57             :   protected:
      58             :     const int max_data_size;
      59             : 
      60             :   public:
      61             :     Sink(const int max_data_size);
      62             : 
      63          19 :     virtual ~Sink() = default;
      64             : 
      65             :     virtual Sink<B>* clone() const;
      66             : 
      67             :     template<class A = std::allocator<B>>
      68             :     void send(const std::vector<B, A>& in_data, const int frame_id = -1, const bool managed_memory = true);
      69             : 
      70             :     void send(const B* in_data, const int frame_id = -1, const bool managed_memory = true);
      71             : 
      72             :     template<class A = std::allocator<B>>
      73             :     void send_count(const std::vector<B, A>& in_data,
      74             :                     const std::vector<uint32_t>& in_count,
      75             :                     const int frame_id = -1,
      76             :                     const bool managed_memory = true);
      77             : 
      78             :     void send_count(const B* in_data, uint32_t* in_count, const int frame_id = -1, const bool managed_memory = true);
      79             : 
      80             :     virtual void reset();
      81             : 
      82             :   protected:
      83             :     virtual void _send(const B* in_data, const size_t frame_id);
      84             :     virtual void _send_count(const B* in_data, const uint32_t* in_count, const size_t frame_id);
      85             : };
      86             : 
      87             : }
      88             : }
      89             : 
      90             : #include "Module/Stateful/Sink/Sink.hxx"
      91             : 
      92             : #endif /* SINK_HPP */

Generated by: LCOV version 1.14