X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fsensor.h;h=930b15fff890be651f82cbe1a0453cfb19f7be1a;hb=3e9c210ddc036cd015228504cc0803c909e27f84;hp=e5e1b43eea2dde6be8ebb2e295c7e71ad00c889f;hpb=6c61179fe09af2f5366d50f10aadbf5f83438087;p=r2c2.git diff --git a/source/libmarklin/sensor.h b/source/libmarklin/sensor.h index e5e1b43..930b15f 100644 --- a/source/libmarklin/sensor.h +++ b/source/libmarklin/sensor.h @@ -1,9 +1,17 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef LIBMARKLIN_SENSOR_H_ #define LIBMARKLIN_SENSOR_H_ #include #include -#include +#include +#include namespace Marklin { @@ -11,21 +19,23 @@ class Control; class Sensor { +private: + Control &control; + unsigned addr; + bool state; + Msp::Time::TimeStamp off_timeout; + public: sigc::signal signal_state_changed; Sensor(Control &, unsigned); + unsigned get_address() const { return addr; } bool get_state() const { return state; } + void tick(); private: - Control &control; - unsigned addr; - bool state; - void sensor_event(unsigned, bool); }; -typedef std::list SensorSeq; -typedef std::map SensorMap; } // namespace Marklin