#ifndef DTSIMPLETHRESHOLD_HH
#define DTSIMPLETHRESHOLD_HH

/****************************************************************************
 *
 * Simple thresholding example of a specific instance of a
 * DecisionTool.  This shows the basic implementation details and is
 * intended for two purposes:
 * 1) test all interfaces
 * 2) provide an example for future DT's
 *
 * The configuration file has a list of all basic measurement types,
 * each with a threshold value.  If the value is less than 0, we skip
 * it.  The others are loaded into a vector of guys to watch.  Each
 * callback, we check those guys against their thresholds.  If the
 * measured value is greater, request a gulp, and log all the current
 * values.
 *
 ****************************************************************************/

#include "DecisionTool.hh"
#include "SmartSamplerData.hh"
#include "STLogger.hh"
#include <vector>

class dtSimpleThreshold : public DecisionTool{
public:
  dtSimpleThreshold(char *nameIn);
  ~dtSimpleThreshold();

  void loadConfig(char *cfgname,SmartSamplerData *ssdIn);
  bool update();
  void reset();

private:
  typedef struct{
    SmartSamplerData::ssd_measurement_t type;
    double initthresh;
    double thresh;
  }STData_t;
  char *name;
  SmartSamplerData *ssd;
  STLogger log;
  typedef std::vector<STData_t>::iterator di_t;
  std::vector<STData_t> cfg;
}; // dtSimpleThreshold

#endif // DTSIMPLETHRESHOLD_HH
