#ifndef REGISTER_H #define REGISTER_H #include "model/hardware/core/register/Field.h" #include "model/hardware/device/SonoDevice.h" class Register { private: virtual void prepareData(quint32) { } virtual void receiveData(void) { } quint32 cumulativeValue; protected: quint32 _bar; quint32 _offset; quint32 _baseOffset; quint32 _arrayLength; quint32 _value; bool _isUpdated; QList _fields; SonoDevice* _device; public: //Constructor for general Registers: single and array Register(quint8 bar, quint32 offset, SonoDevice* device, quint32 arrayLength = 0); virtual ~Register(); quint32 getValue(); void setValue(quint32 value); void changeOffset(quint32 offset); quint32 getCurrentOffset(void) const; bool isUpdated(); void clearCumulative(void); void update(); void updateLong(); void updateArray(bool isVariable = false, quint16 arrayLength = 0); void updateArrayLong(quint8 interval, quint32 arrayLength, bool _isCumulative=false); void sync(); void syncArray(); }; #endif //REGISTER_H