Files
RASCSI/src/raspberrypi/devices/mode_page_device.h
Uwe Seimet 45cd5e58d1 Inheritance hierarchy improvements, reduced dependencies to Disk class (#662)
* Fixed buster compile-time issue

* Host services inherit from ModePageDevice

* Call base class

* Visibility update

* Updated includes

* Updated dispatcher

* Added TODOs

* Logging update

* Code cleanup

* Use namespace instead of class for ScsiDefs

* Renaming

* Cleanup

* Use dispatcher template in order to remove duplicate code

* Updated all dispatchers

* Clean up commands

* Removed duplicate code

* Removed duplicate code

* Updated template definition

* Fixed typo

* Fixed warning

* Code cleanup

* Device list must be static

* Cleanup

* Logging update

* Added comments

* Cleanup

* Base class update

* SCSIBR is not a subclass of Disk anymore, but of PrimaryDevice

* Updated includes

* Fixed compile-time issue on the Pi

* Header file cleanup

* Interface cleanup

* Removed wrong override

* include file cleanup

* Removed obsolete usage of streams

* Removed more stream usages

* Stream usage cleanup

* Include cleanup

* Renaming

* Include cleanup

* Interface update
2022-02-13 13:30:02 -06:00

47 lines
1.0 KiB
C++

//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI (*^..^*)
// for Raspberry Pi
//
// Copyright (C) 2022 Uwe Seimet
//
//---------------------------------------------------------------------------
#pragma once
#include "primary_device.h"
#include <string>
using namespace std;
class ModePageDevice: public PrimaryDevice
{
public:
ModePageDevice(const string&);
virtual ~ModePageDevice() {}
virtual bool Dispatch(SCSIDEV *) override;
virtual int ModeSense6(const DWORD *, BYTE *) = 0;
virtual int ModeSense10(const DWORD *, BYTE *) = 0;
// TODO This method should not be called by SASIDEV
virtual bool ModeSelect(const DWORD *, const BYTE *, int);
private:
typedef PrimaryDevice super;
Dispatcher<ModePageDevice> dispatcher;
void ModeSense6(SASIDEV *);
void ModeSense10(SASIDEV *);
void ModeSelect6(SASIDEV *);
void ModeSelect10(SASIDEV *);
int ModeSelectCheck(const DWORD *, int);
int ModeSelectCheck6(const DWORD *);
int ModeSelectCheck10(const DWORD *);
};