1// SizeIndex.h 2 3#ifndef SIZE_INDEX_H 4#define SIZE_INDEX_H 5 6#include "Index.h" 7#include "NodeListener.h" 8#include "TwoKeyAVLTree.h" 9 10// SizeIndex 11class SizeIndex : public Index, private NodeListener { 12public: 13 SizeIndex(Volume *volume); 14 virtual ~SizeIndex(); 15 16 virtual int32 CountEntries() const; 17 18 virtual status_t Changed(Node *node, off_t oldSize); 19 20private: 21 virtual void NodeAdded(Node *node); 22 virtual void NodeRemoved(Node *node); 23 24protected: 25 virtual AbstractIndexEntryIterator *InternalGetIterator(); 26 virtual AbstractIndexEntryIterator *InternalFind(const uint8 *key, 27 size_t length); 28 29private: 30 class Iterator; 31 class IteratorList; 32 class NodeTree; 33 friend class Iterator; 34 35private: 36 void _AddIterator(Iterator *iterator); 37 void _RemoveIterator(Iterator *iterator); 38 39private: 40 NodeTree *fNodes; 41 IteratorList *fIterators; 42}; 43 44#endif // SIZE_INDEX_H 45