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 14 namespace BPrivate { 15 16 // PartitionFilter 17 class PartitionFilter { 18 public: 19 virtual bool Filter(BPartition *partition, int32 level) = 0; 20 }; 21 22 // PartitionFilterVisitor 23 class PartitionFilterVisitor : public BDiskDeviceVisitor { 24 public: 25 PartitionFilterVisitor(BDiskDeviceVisitor *visitor, 26 PartitionFilter *filter); 27 28 virtual bool Visit(BDiskDevice *device); 29 virtual bool Visit(BPartition *partition, int32 level); 30 31 private: 32 BDiskDeviceVisitor *fVisitor; 33 PartitionFilter *fFilter; 34 }; 35 36 // IDFinderVisitor 37 class IDFinderVisitor : public BDiskDeviceVisitor { 38 public: 39 IDFinderVisitor(partition_id id); 40 41 virtual bool Visit(BDiskDevice *device); 42 virtual bool Visit(BPartition *partition, int32 level); 43 44 private: 45 partition_id fID; 46 }; 47 48 } // namespace BPrivate 49 50 using BPrivate::PartitionFilter; 51 using BPrivate::PartitionFilterVisitor; 52 using BPrivate::IDFinderVisitor; 53 54 #endif // _DISK_DEVICE_PRIVATE_H 55