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

          Line data    Source code
       1             : /*!
       2             :  * \file
       3             :  * \brief Class tools::Reporter_probe.
       4             :  */
       5             : #ifndef REPORTER_PROBE_HPP_
       6             : #define REPORTER_PROBE_HPP_
       7             : 
       8             : #include <cstddef>
       9             : #include <initializer_list>
      10             : #include <ios>
      11             : #include <iostream>
      12             : #include <map>
      13             : #include <mutex>
      14             : #include <string>
      15             : #include <typeindex>
      16             : #include <vector>
      17             : 
      18             : #include "Tools/Interface/Interface_get_set_n_frames.hpp"
      19             : #include "Tools/Reporter/Reporter.hpp"
      20             : 
      21             : namespace spu
      22             : {
      23             : namespace module
      24             : {
      25             : class AProbe;
      26             : }
      27             : namespace tools
      28             : {
      29             : 
      30             : class Reporter_probe
      31             :   : public Reporter
      32             :   , public Interface_get_set_n_frames
      33             : {
      34             :     friend module::AProbe;
      35             : 
      36             :   protected:
      37             :     std::vector<module::AProbe*> probes;
      38             : 
      39             :     std::vector<size_t> head;
      40             :     std::vector<size_t> tail;
      41             :     std::vector<std::vector<std::vector<int8_t>>> buffer;
      42             :     std::vector<std::type_index> datatypes;
      43             :     std::vector<std::ios_base::fmtflags> format_flags;
      44             :     std::vector<size_t> precisions;
      45             :     std::vector<size_t> column_sizes;
      46             :     std::vector<size_t> data_sizes;
      47             :     std::map<std::string, int> name_to_col;
      48             :     std::map<int, std::string> col_to_name;
      49             :     size_t n_frames;
      50             :     std::vector<std::mutex> mtx;
      51             : 
      52             :   public:
      53             :     Reporter_probe(const std::string& group_name, const std::string& group_description);
      54             : 
      55             :     explicit Reporter_probe(const std::string& group_name);
      56             : 
      57           0 :     virtual ~Reporter_probe() = default;
      58             : 
      59             :     virtual report_t report(bool final = false);
      60             : 
      61             :     virtual void reset();
      62             : 
      63             :     void set_n_frames(const size_t n_frames);
      64             : 
      65             :     size_t get_n_frames() const;
      66             : 
      67             :     void set_col_unit(const std::string& unit, const module::AProbe& prb);
      68             :     void set_col_buff_size(const size_t buffer_size, const module::AProbe& prb);
      69             :     void set_col_fmtflags(const std::ios_base::fmtflags ff, const module::AProbe& prb);
      70             :     void set_col_prec(const size_t precision, const module::AProbe& prb);
      71             :     void set_col_size(const size_t col_size, const module::AProbe& prb);
      72             : 
      73             :     void set_cols_unit(const std::string& unit);
      74             :     void set_cols_buff_size(const size_t buffer_size);
      75             :     void set_cols_fmtflags(const std::ios_base::fmtflags ff);
      76             :     void set_cols_prec(const size_t precision);
      77             :     void set_cols_size(const size_t col_size);
      78             : 
      79             :     void register_probes(const std::vector<module::AProbe*>& probes);
      80             : 
      81             :   protected:
      82             :     void register_probe(module::AProbe& probe,
      83             :                         const size_t data_size,
      84             :                         const std::type_index data_type,
      85             :                         const std::string& unit,
      86             :                         const size_t buffer_size,
      87             :                         const std::ios_base::fmtflags ff,
      88             :                         const size_t precision);
      89             : 
      90             :     virtual void probe(const module::AProbe& probe, const void* data, const size_t frame_id);
      91             : 
      92             :     void create_probe_checks(const std::string& name);
      93             : 
      94             :     template<typename T>
      95             :     size_t col_size(const int col);
      96             : 
      97             :     template<typename T>
      98             :     bool push(const int col, const T* data);
      99             : 
     100             :     template<typename T>
     101             :     bool pull(const int col, T* data);
     102             : 
     103             :     size_t get_probe_index(const module::AProbe& prb);
     104             : 
     105             :   private:
     106             :     template<typename T>
     107             :     bool format_values(const int col, std::stringstream& temp_stream);
     108             : };
     109             : }
     110             : }
     111             : 
     112             : #ifndef DOXYGEN_SHOULD_SKIP_THIS
     113             : #include "Tools/Reporter/Probe/Reporter_probe.hxx"
     114             : #endif
     115             : 
     116             : #endif /* REPORTER_PROBE_HPP_ */

Generated by: LCOV version 1.14