1//----------------------------------------------------------------------
2//  This software is part of the Haiku distribution and is covered
3//  by the MIT License.
4//---------------------------------------------------------------------
5
6#include <DiskDeviceVisitor.h>
7
8/*!	\class BDiskDeviceVisitor
9	\brief Base class of visitors used for BDiskDevice and
10		   BPartition iteration.
11
12	BDiskDeviceRoster and BDiskDevice provide iteration methods,
13	that work together with an instance of a derived class of
14	BDiskDeviceVisitor. For each encountered BDiskDevice and
15	BPartition the respective Visit() method is invoked. The return value
16	of that method specifies whether the iteration shall be terminated at
17	that point.
18*/
19
20// constructor
21/*!	\brief Creates a new disk device visitor.
22*/
23BDiskDeviceVisitor::BDiskDeviceVisitor()
24{
25}
26
27// destructor
28/*!	\brief Free all resources associated with this object.
29
30	Does nothing.
31*/
32BDiskDeviceVisitor::~BDiskDeviceVisitor()
33{
34}
35
36// Visit
37/*!	\brief Invoked when a BDiskDevice is visited.
38
39	If the method returns \c true, the iteration is terminated at this point,
40	on \c false continued.
41
42	Overridden by derived classes.
43	This class' version does nothing and it returns \c false.
44
45	\param device The visited disk device.
46	\return \c true, if the iteration shall be terminated at this point,
47			\c false otherwise.
48*/
49bool
50BDiskDeviceVisitor::Visit(BDiskDevice *device)
51{
52	return false;
53}
54
55// Visit
56/*!	\brief Invoked when a BPartition is visited.
57
58	If the method returns \c true, the iteration is terminated at this point,
59	on \c false continued.
60
61	Overridden by derived classes.
62	This class' version does nothing and it returns \c false.
63
64	\param partition The visited partition.
65	\param level The level of the partition in the partition tree.
66	\return \c true, if the iteration shall be terminated at this point,
67			\c false otherwise.
68*/
69bool
70BDiskDeviceVisitor::Visit(BPartition *partition, int32 level)
71{
72	return false;
73}
74
75