2003-02-09 02:32:51 +03:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef _DISK_DEVICE_PRIVATE_H
|
|
|
|
#define _DISK_DEVICE_PRIVATE_H
|
|
|
|
|
|
|
|
#include <DiskDeviceVisitor.h>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2003-02-16 21:03:59 +03:00
|
|
|
class BMessenger;
|
|
|
|
|
2003-02-09 02:32:51 +03:00
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
// PartitionFilter
|
|
|
|
class PartitionFilter {
|
|
|
|
public:
|
|
|
|
virtual bool Filter(BPartition *partition) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
// PartitionFilterVisitor
|
|
|
|
class PartitionFilterVisitor : public BDiskDeviceVisitor {
|
|
|
|
public:
|
|
|
|
PartitionFilterVisitor(BDiskDeviceVisitor *visitor,
|
|
|
|
PartitionFilter *filter);
|
|
|
|
|
|
|
|
virtual bool Visit(BDiskDevice *device);
|
|
|
|
virtual bool Visit(BPartition *partition);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BDiskDeviceVisitor *fVisitor;
|
|
|
|
PartitionFilter *fFilter;
|
|
|
|
};
|
|
|
|
|
|
|
|
// IDFinderVisitor
|
|
|
|
class IDFinderVisitor : public BDiskDeviceVisitor {
|
|
|
|
public:
|
2003-06-10 03:02:16 +04:00
|
|
|
IDFinderVisitor(partition_id id);
|
2003-02-09 02:32:51 +03:00
|
|
|
|
|
|
|
virtual bool Visit(BDiskDevice *device);
|
|
|
|
virtual bool Visit(BPartition *partition);
|
|
|
|
|
|
|
|
private:
|
2003-06-10 03:02:16 +04:00
|
|
|
partition_id fID;
|
2003-02-09 02:32:51 +03:00
|
|
|
};
|
|
|
|
|
2003-02-16 21:03:59 +03:00
|
|
|
status_t get_disk_device_messenger(BMessenger *messenger);
|
|
|
|
|
2003-02-09 02:32:51 +03:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
using BPrivate::PartitionFilter;
|
|
|
|
using BPrivate::PartitionFilterVisitor;
|
|
|
|
using BPrivate::IDFinderVisitor;
|
2003-02-16 21:03:59 +03:00
|
|
|
using BPrivate::get_disk_device_messenger;
|
2003-02-09 02:32:51 +03:00
|
|
|
|
|
|
|
#endif // _DISK_DEVICE_PRIVATE_H
|