Programmers Reference - CParameterDevice (1)
class CParameterDevice : public CDevice
#include "ConSys.h"
class KERNEL_EXT CParameterDevice : public CDevice { public: CParameterDevice(); virtual ~CParameterDevice(); public: virtual void Create(CRegistryKey &aDeviceEntry, const UINT aDeviceNo); public: virtual UINT AddressHash(const CParameterAddress const* pAddress) const; // Overwrite this method to implement address space grouping. // The default behavior is hash = a0*1000+a1. virtual UINT FirstTimeRegister(CParameterAddress* pAddress){return 0;}; // This method is called whenever a data server connects to a hashkey // for the first time. // Overwrite this method to modify the value returned bu LastTimeRegister. virtual void LastTimeDeregister(const UINT& keyId){}; // Overwrite this method to implement deinitialization, when a parameter // becomes inactive. public: inline void SignalChange(CParameterAddress* pAddress); // This method notifyes the dataservers of a change of the parameter // Call only this function once for every address group, if possible. // This method is essentialy SignalChange(AddressHash(address)). inline void SignalChange(UINT addressHash); // The same as above public: DECLARE_DYNCREATE(CParameterDevice); public: // It is no more possible to overwrite the de- and registration of // data servers, the base classes must be called virtual BOOLEAN RegisterDataServer(CDeviceServer* aDataServer, const CAddress* aAddress, UINT minPollTime = 0 /* ms */); virtual BOOLEAN DeRegisterDataServer(/*const*/ CDeviceServer* aDataServer); };
The CParameterDevice is a more advances device than the CSimpleDevice. It is also more complicated to use than the CSimpleDevice. If the implementation is very simple, use the CSimpleDevice. Please refer to the Device Cookbook for further information.
References:
Last Modified 10 January 2019