1 // NameIndex.h 2 3 #ifndef NAME_INDEX_H 4 #define NAME_INDEX_H 5 6 #include "EntryListener.h" 7 #include "Index.h" 8 #include "TwoKeyAVLTree.h" 9 10 class NameIndexEntryIterator; 11 12 // NameIndex 13 class NameIndex : public Index, private EntryListener { 14 public: 15 NameIndex(Volume *volume); 16 virtual ~NameIndex(); 17 18 virtual int32 CountEntries() const; 19 20 virtual status_t Changed(Entry *entry, const char *oldName); 21 22 private: 23 virtual void EntryAdded(Entry *entry); 24 virtual void EntryRemoved(Entry *entry); 25 26 protected: 27 virtual AbstractIndexEntryIterator *InternalGetIterator(); 28 virtual AbstractIndexEntryIterator *InternalFind(const uint8 *key, 29 size_t length); 30 31 private: 32 class EntryTree; 33 friend class NameIndexEntryIterator; 34 35 void _UpdateLiveQueries(Entry* entry, const char* oldName, 36 const char* newName); 37 38 private: 39 EntryTree *fEntries; 40 }; 41 42 #endif // NAME_INDEX_H 43