LCOV - code coverage report
Current view: top level - include/Module/Stateful/Source/User - Source_user_binary.hpp (source / functions) Hit Total Coverage
Test: streampu_clean.info Lines: 1 1 100.0 %
Date: 2025-01-11 12:25:42 Functions: 2 20 10.0 %

          Line data    Source code
       1             : #ifndef SOURCE_USER_BINARY_HPP_
       2             : #define SOURCE_USER_BINARY_HPP_
       3             : 
       4             : #include <fstream>
       5             : #include <memory>
       6             : #include <string>
       7             : #include <vector>
       8             : 
       9             : #include "Module/Stateful/Source/Source.hpp"
      10             : 
      11             : namespace spu
      12             : {
      13             : namespace module
      14             : {
      15             : template<typename B = int32_t>
      16             : class Source_user_binary : public Source<B>
      17             : {
      18             :   private:
      19             :     std::ifstream source_file;
      20             :     const bool auto_reset;
      21             :     const bool fifo_mode;
      22             :     bool done;
      23             :     size_t n_left;
      24             :     std::vector<char> memblk;
      25             :     std::vector<B> left_bits; // to store bits that are left by last call (n_left & n_completing)
      26             : 
      27             :   public:
      28             :     Source_user_binary(const int max_data_size,
      29             :                        const std::string& filename,
      30             :                        const bool auto_reset = true,
      31             :                        const bool fifo_mode = false);
      32          36 :     virtual ~Source_user_binary() = default;
      33             : 
      34             :     virtual bool is_done() const;
      35             : 
      36             :     virtual void reset();
      37             : 
      38             :   protected:
      39             :     void _generate(B* out_data, uint32_t* out_count, const size_t frame_id);
      40             : };
      41             : }
      42             : }
      43             : 
      44             : #endif /* SOURCE_USER_BINARY_HPP_ */

Generated by: LCOV version 1.14