#include "DepthUpdater.hh"

// Declare this class as a "concrete" Device interface
DevDeclare<DepthUpdater> depth_decl(DepthType);

/*
 * class DepthUpdater
 */
// manipulators :

bool DepthUpdater::update(DepthUpdater::device_type &dev, 
			  DepthUpdater::data_type &data) {
  TimeIF::TimeSpec sample_time;

  return DeviceIF::Ok==dev.depth(&data.depth, &sample_time)
    && DeviceIF::Ok==dev.temp(&data.temp, &sample_time)
    && DeviceIF::Ok==dev.pressure(&data.pressure, &sample_time);
}

void DepthUpdater::initDB(ValDB &db, DepthUpdater::data_type const &data) {
  addEntry(db, "depth", &data.depth);
  addEntry(db, "temp", &data.temp);
  addEntry(db, "pressure", &data.pressure);
}
