xref: /haiku/headers/private/storage/DiskDevicePrivate.h (revision 95bac3fda53a4cb21880712d7b43f8c21db32a2e)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //---------------------------------------------------------------------
5 
6 #ifndef _DISK_DEVICE_PRIVATE_H
7 #define _DISK_DEVICE_PRIVATE_H
8 
9 #include <DiskDeviceDefs.h>
10 #include <DiskDeviceVisitor.h>
11 
12 class BMessenger;
13 class BPath;
14 
15 namespace BPrivate {
16 
17 // PartitionFilter
18 class PartitionFilter {
19 public:
20 	virtual bool Filter(BPartition *partition, int32 level) = 0;
21 };
22 
23 // PartitionFilterVisitor
24 class PartitionFilterVisitor : public BDiskDeviceVisitor {
25 public:
26 	PartitionFilterVisitor(BDiskDeviceVisitor *visitor,
27 						   PartitionFilter *filter);
28 
29 	virtual bool Visit(BDiskDevice *device);
30 	virtual bool Visit(BPartition *partition, int32 level);
31 
32 private:
33 	BDiskDeviceVisitor	*fVisitor;
34 	PartitionFilter		*fFilter;
35 };
36 
37 // IDFinderVisitor
38 class IDFinderVisitor : public BDiskDeviceVisitor {
39 public:
40 	IDFinderVisitor(partition_id id);
41 
42 	virtual bool Visit(BDiskDevice *device);
43 	virtual bool Visit(BPartition *partition, int32 level);
44 
45 private:
46 	partition_id		fID;
47 };
48 
49 }	// namespace BPrivate
50 
51 using BPrivate::PartitionFilter;
52 using BPrivate::PartitionFilterVisitor;
53 using BPrivate::IDFinderVisitor;
54 
55 #endif	// _DISK_DEVICE_PRIVATE_H
56