mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-18 10:30:32 +00:00
40 lines
950 B
C
40 lines
950 B
C
|
//---------------------------------------------------------------------------
|
||
|
//
|
||
|
// SCSI Target Emulator RaSCSI Reloaded
|
||
|
// for Raspberry Pi
|
||
|
//
|
||
|
// Copyright (C) 2022 Uwe Seimet
|
||
|
//
|
||
|
// Keeps track of and manages the controllers
|
||
|
//
|
||
|
//---------------------------------------------------------------------------
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <unordered_map>
|
||
|
|
||
|
class BUS;
|
||
|
class AbstractController;
|
||
|
class PrimaryDevice;
|
||
|
|
||
|
class ControllerManager
|
||
|
{
|
||
|
ControllerManager() {}
|
||
|
~ControllerManager();
|
||
|
|
||
|
public:
|
||
|
// Maximum number of controller devices
|
||
|
static const int DEVICE_MAX = 8;
|
||
|
|
||
|
static ControllerManager& instance();
|
||
|
|
||
|
bool CreateScsiController(BUS *, PrimaryDevice *);
|
||
|
AbstractController *IdentifyController(int) const;
|
||
|
AbstractController *FindController(int) const;
|
||
|
void DeleteAllControllersAndDevices();
|
||
|
void ResetAllControllers();
|
||
|
PrimaryDevice *GetDeviceByIdAndLun(int, int) const;
|
||
|
|
||
|
static std::unordered_map<int, AbstractController *> controllers;
|
||
|
};
|