mirror of
https://github.com/akuker/RASCSI.git
synced 2025-10-03 10:16:21 +00:00
Cleaned up dependencies on controller manager (#964)
* Cleaned up dependencies on controller manager * Removed global fields * Simplified setting up RascsiResponse and RascsiExecutor * Got rid of remaining raw pointers * Use references instead of pointers * Improved encapsulation
This commit is contained in:
@@ -23,7 +23,7 @@ bool ControllerManager::AttachToScsiController(int id, shared_ptr<PrimaryDevice>
|
||||
|
||||
// If there is no LUN yet the first LUN must be LUN 0
|
||||
if (device->GetLun() == 0) {
|
||||
controller = make_shared<ScsiController>(bus, id);
|
||||
controller = make_shared<ScsiController>(shared_from_this(), id);
|
||||
|
||||
if (controller->AddDevice(device)) {
|
||||
controllers[id] = controller;
|
||||
@@ -74,13 +74,6 @@ void ControllerManager::DeleteAllControllers()
|
||||
controllers.clear();
|
||||
}
|
||||
|
||||
void ControllerManager::ResetAllControllers() const
|
||||
{
|
||||
for (const auto& [id, controller] : controllers) {
|
||||
controller->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
shared_ptr<PrimaryDevice> ControllerManager::GetDeviceByIdAndLun(int id, int lun) const
|
||||
{
|
||||
if (const auto& controller = FindController(id); controller != nullptr) {
|
||||
|
Reference in New Issue
Block a user