LCOV - code coverage report
Current view: top level - Mock - TriangleGeneratorFilter.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 1 1 100.0 %
Date: 2021-02-18 20:07:22 Functions: 5 14 35.7 %

          Line data    Source code
       1             : /**
       2             :  * \file TriangleGeneratorFilter.h
       3             :  */
       4             : 
       5             : #ifndef ATK_MOCK_TRIANGLEGENERATORFILTER_H
       6             : #define ATK_MOCK_TRIANGLEGENERATORFILTER_H
       7             : 
       8             : #include <ATK/Core/TypedBaseFilter.h>
       9             : #include <ATK/Core/TypeTraits.h>
      10             : #include <ATK/Mock/config.h>
      11             : 
      12             : namespace ATK
      13             : {
      14             :   /// A triangle signal generator for test purposes
      15             :   template<class DataType_>
      16             :   class ATK_MOCK_EXPORT TriangleGeneratorFilter final : public TypedBaseFilter<DataType_>
      17             :   {
      18             :   public:
      19             :     /// Simplify parent calls
      20             :     using Parent = TypedBaseFilter<DataType_>;
      21             :     using typename Parent::DataType;
      22             :     using Parent::outputs;
      23             :     using Parent::output_sampling_rate;
      24             : 
      25             :     /// Constructor
      26             :     TriangleGeneratorFilter();
      27             :     /// Destructor
      28         110 :     ~TriangleGeneratorFilter() override = default;
      29             :     
      30             :     /// Sets the amplitude of the triangle
      31             :     void set_amplitude(DataType_ amplitude);
      32             :     /// Sets the frequency of the triangle
      33             :     void set_frequency(int frequency);
      34             :     
      35             :   protected:
      36             :     void process_impl(gsl::index size) const final;
      37             : 
      38             :   private:
      39             :     mutable double state = 0;
      40             :     mutable bool ascending = true;
      41             :     DataType_ amplitude{1};
      42             :     int frequency{1};
      43             :   };
      44             : }
      45             : 
      46             : #endif

Generated by: LCOV version TK-3.3.0-4-gdba42eea