// Device.h: interface for the CDevice class.
//


#pragma once

class CDevice
{
	protected:
		ULONGLONG           m_tickCount; // Device ticks
		CDevice            *m_pParent;

	public:
		CDevice();
		virtual ~CDevice();

		void AttachParent(CDevice *pParent)
		{
			m_pParent = pParent;
		};
		// Method for count device ticks
		void                Reset();
		virtual void        NextTick();

		// Virtual method called after reset command
		virtual void        OnReset() = NULL;

		// Methods for Set/Get byte/word
		virtual bool        GetByte(uint16_t addr, uint8_t *pValue) = NULL;
		virtual bool        GetWord(uint16_t addr, uint16_t *pValue) = NULL;
		virtual bool        SetByte(uint16_t addr, uint8_t value) = NULL;
		virtual bool        SetWord(uint16_t addr, uint16_t value) = NULL;
};

