xref: /haiku/src/add-ons/kernel/file_systems/ramfs/AttributeIterator.h (revision 56eb8e78cc702792e3b032e3f5f45da9e5dbea9e)
1 // AttributeIterator.h
2 
3 #ifndef ATTRIBUTE_ITERATOR_H
4 #define ATTRIBUTE_ITERATOR_H
5 
6 #include <SupportDefs.h>
7 
8 #include "DLList.h"
9 
10 class Attribute;
11 class Node;
12 
13 class AttributeIterator : public DLListLinkImpl<AttributeIterator> {
14 public:
15 	AttributeIterator(Node *node = NULL);
16 	~AttributeIterator();
17 
18 	status_t SetTo(Node *node);
19 	void Unset();
20 
21 	Node *GetNode() const { return fNode; }
22 
23 	status_t Suspend();
24 	status_t Resume();
25 	bool IsSuspended() const { return fSuspended; }
26 
27 	status_t GetNext(Attribute **attribute);
28 	Attribute *GetCurrent() const { return fAttribute; }
29 
30 	status_t Rewind();
31 
32 private:
33 	void SetCurrent(Attribute *attribute, bool isNext);
34 
35 private:
36 	friend class Node;
37 
38 private:
39 	Node							*fNode;
40 	Attribute						*fAttribute;
41 	bool							fSuspended;
42 	bool							fIsNext;
43 	bool							fDone;
44 };
45 
46 #endif	// ATTRIBUTE_ITERATOR_H
47