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