Program Listing for File aperiodic_waveform.hpp

Return to documentation for file (rcppsw/control/aperiodic_waveform.hpp)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "rcppsw/control/base_waveform.hpp"

/*******************************************************************************
 * Namespaces/Decls
 ******************************************************************************/
namespace rcppsw::control {

/*******************************************************************************
 * Classes
 ******************************************************************************/

class constant_waveform final : public base_waveform {
 public:
  explicit constant_waveform(const struct config::waveform_config* const config)
      : base_waveform(config) {}

  double value(double) override { return amplitude(); }
};

class null_waveform final : public base_waveform {
 public:
  explicit null_waveform(const struct config::waveform_config* const config)
      : base_waveform(config) {}

  double value(double) override { return 0.0; }
};

} /* namespace rcppsw::control */