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 <DiskDeviceVisitor.h> 10 #include <SupportDefs.h> 11 12 class BMessenger; 13 14 namespace BPrivate { 15 16 // PartitionFilter 17 class PartitionFilter { 18 public: 19 virtual bool Filter(BPartition *partition) = 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); 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); 43 44 private: 45 partition_id fID; 46 }; 47 48 status_t get_disk_device_messenger(BMessenger *messenger); 49 50 } // namespace BPrivate 51 52 using BPrivate::PartitionFilter; 53 using BPrivate::PartitionFilterVisitor; 54 using BPrivate::IDFinderVisitor; 55 using BPrivate::get_disk_device_messenger; 56 57 #endif // _DISK_DEVICE_PRIVATE_H 58