blob: 33b82e193021324a5a6282ccd287fa9ad81a0990 [file] [log] [blame]
// Copyright 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THERMALD_TEMPERATURE_SENSOR_COMMON_H_
#define THERMALD_TEMPERATURE_SENSOR_COMMON_H_
#include "thermald/temperature_sensor_interface.h"
#include <string>
#include "base/macros.h"
namespace thermald {
// Common functionality for all types of temperature sensors
class TemperatureSensorCommon : public TemperatureSensorInterface {
public:
TemperatureSensorCommon(const std::string &name) : name_(name) {}
std::string name() const { return name_; }
// Default is always true, specific sensors can override the method to
// provide custom behavior.
virtual bool IsOperational() { return true; }
private:
DISALLOW_COPY_AND_ASSIGN(TemperatureSensorCommon);
const std::string name_;
};
} // namespace thermald
#endif // THERMALD_TEMPERATURE_SENSOR_COMMON_H_