Implemented some basics of KDiskDeviceManager.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3460 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#define _K_DISK_DEVICE_MANAGER_H
|
||||
|
||||
#include "disk_device_manager.h"
|
||||
#include "List.h"
|
||||
#include "Locker.h"
|
||||
|
||||
namespace BPrivate {
|
||||
namespace DiskDevice {
|
||||
@@ -15,9 +17,12 @@ class KDiskSystem;
|
||||
class KPartition;
|
||||
|
||||
class KDiskDeviceManager {
|
||||
public:
|
||||
KDiskDeviceManager();
|
||||
~KDiskDeviceManager();
|
||||
|
||||
status_t InitCheck() const;
|
||||
|
||||
// Singleton Creation, Deletion, and Access
|
||||
|
||||
static status_t CreateDefault();
|
||||
@@ -37,36 +42,45 @@ class KDiskDeviceManager {
|
||||
KPartition *RegisterPartition(partition_id id, bool noShadow = true);
|
||||
|
||||
// manager must be locked
|
||||
int32 CountDiskDevices() const;
|
||||
KDiskDevice *DiskDeviceAt(int32 index) const;
|
||||
int32 CountDiskDevices();
|
||||
KDiskDevice *DiskDeviceAt(int32 index);
|
||||
|
||||
void PartitionAdded(KPartition *partition); // implementation internal
|
||||
void PartitionRemoved(KPartition *partition); //
|
||||
bool PartitionAdded(KPartition *partition); // implementation internal
|
||||
bool PartitionRemoved(KPartition *partition); //
|
||||
|
||||
// Jobs
|
||||
|
||||
// manager must be locked
|
||||
KDiskDeviceJob *JobWithID(disk_job_id id) const;
|
||||
int32 CountJobs() const;
|
||||
KDiskDeviceJob *JobAt(int32 index) const;
|
||||
KDiskDeviceJob *JobWithID(disk_job_id id);
|
||||
int32 CountJobs();
|
||||
KDiskDeviceJob *JobAt(int32 index);
|
||||
|
||||
// manager must be locked
|
||||
bool AddJobQueue(KDiskDeviceJobQueue *jobQueue) const;
|
||||
int32 CountJobQueues() const;
|
||||
KDiskDeviceJobQueue *JobQueueAt(int32 index) const;
|
||||
bool AddJobQueue(KDiskDeviceJobQueue *jobQueue);
|
||||
int32 CountJobQueues();
|
||||
KDiskDeviceJobQueue *JobQueueAt(int32 index);
|
||||
|
||||
// Disk Systems
|
||||
|
||||
// manager must be locked
|
||||
KDiskSystem *DiskSystemWithName(const char *name);
|
||||
KDiskSystem *DiskSystemWithID(disk_system_id id);
|
||||
int32 CountDiskSystems() const;
|
||||
KDiskSystem *DiskSystemAt(int32 index) const;
|
||||
int32 CountDiskSystems();
|
||||
KDiskSystem *DiskSystemAt(int32 index);
|
||||
|
||||
// Watching
|
||||
|
||||
// TODO: Watching service for the kernel. The userland watching is handled
|
||||
// by the registrar.
|
||||
|
||||
private:
|
||||
KPartition *_FindPartition(partition_id id) const;
|
||||
|
||||
BLocker fLock;
|
||||
List<KDiskDevice*> fDevices; // TODO: Optimize!
|
||||
List<KPartition*> fPartitions; //
|
||||
|
||||
static KDiskDeviceManager *fDefaultManager;
|
||||
};
|
||||
|
||||
} // namespace DiskDevice
|
||||
|
||||
Reference in New Issue
Block a user