xref: /haiku/headers/private/storage/DiskDevicePrivate.h (revision 99d027cd0238c1d86da86d7c3f4200509ccc61a6)
1 /*
2  * Copyright 2003-2006, Haiku Inc.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold, bonefish@users.sf.net
7  */
8 #ifndef _DISK_DEVICE_PRIVATE_H
9 #define _DISK_DEVICE_PRIVATE_H
10 
11 
12 #include <DiskDeviceDefs.h>
13 #include <DiskDeviceVisitor.h>
14 
15 class BMessenger;
16 class BPath;
17 
18 
19 namespace BPrivate {
20 
21 // PartitionFilter
22 class PartitionFilter {
23 public:
24 	virtual ~PartitionFilter();
25 	virtual bool Filter(BPartition *partition, int32 level) = 0;
26 };
27 
28 // PartitionFilterVisitor
29 class PartitionFilterVisitor : public BDiskDeviceVisitor {
30 public:
31 	PartitionFilterVisitor(BDiskDeviceVisitor *visitor,
32 						   PartitionFilter *filter);
33 
34 	virtual bool Visit(BDiskDevice *device);
35 	virtual bool Visit(BPartition *partition, int32 level);
36 
37 private:
38 	BDiskDeviceVisitor	*fVisitor;
39 	PartitionFilter		*fFilter;
40 };
41 
42 // IDFinderVisitor
43 class IDFinderVisitor : public BDiskDeviceVisitor {
44 public:
45 	IDFinderVisitor(partition_id id);
46 
47 	virtual bool Visit(BDiskDevice *device);
48 	virtual bool Visit(BPartition *partition, int32 level);
49 
50 private:
51 	partition_id		fID;
52 };
53 
54 }	// namespace BPrivate
55 
56 using BPrivate::PartitionFilter;
57 using BPrivate::PartitionFilterVisitor;
58 using BPrivate::IDFinderVisitor;
59 
60 #endif	// _DISK_DEVICE_PRIVATE_H
61