bool set(T v) { if(v==pending) return false; pending = v; ++serial; return true; }
bool commit(unsigned short s) { if(s!=serial) return false; current = pending; return true; }
+ void rollback() { pending = current; ++serial; }
operator T() const { return current; }
};
unsigned address;
unsigned bits;
ControlledVariable<unsigned> state;
+ unsigned uncertain;
unsigned target;
Msp::Time::TimeDelta active_time;
Msp::FS::Path state_file;
ControlledVariable<bool> power;
+ bool halted;
LocomotiveMap locomotives;
MfxInfoArray mfx_info;
virtual void set_power(bool);
virtual bool get_power() const { return power; }
virtual void halt(bool);
- virtual bool is_halted() const { return false; }
+ virtual bool is_halted() const { return halted; }
virtual const char *enumerate_protocols(unsigned) const;
private: