/* * ======================================================== * * hCore * Copyright Mahrouss Logic, all rights reserved. * * ======================================================== */ #pragma once #include #include namespace hCore { class NVMEPacket; class NVMEDevice : public IDevice { public: NVMEDevice(void(*Out)(NVMEPacket outpacket), void(*In)(NVMEPacket inpacket), void(*Cleanup)(void)) : IDevice(Out, In), fCleanup(Cleanup) {} virtual ~NVMEDevice() { if (fCleanup) fCleanup(); } public: NVMEDevice &operator=(const NVMEDevice &) = default; NVMEDevice(const NVMEDevice &) = default; virtual const char *Name() const; public: OwnPtr operator()(UInt32 dmaLow, UInt32 dmaHigh, SizeT sz); private: void(*fCleanup)(void); }; } // namespace hCore