1 /* 2 * Copyright 2007, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * All rights reserved. Distributed under the terms of the MIT license. 4 */ 5 #ifndef LAST_MODIFIED_INDEX_H 6 #define LAST_MODIFIED_INDEX_H 7 8 #include "Index.h" 9 #include "NodeListener.h" 10 #include "TwoKeyAVLTree.h" 11 12 // LastModifiedIndex 13 class LastModifiedIndex : public Index, private NodeListener { 14 public: 15 LastModifiedIndex(Volume *volume); 16 virtual ~LastModifiedIndex(); 17 18 virtual int32 CountEntries() const; 19 20 virtual status_t Changed(Node *node, time_t oldModified); 21 22 private: 23 virtual void NodeAdded(Node *node); 24 virtual void NodeRemoved(Node *node); 25 26 protected: 27 virtual AbstractIndexEntryIterator *InternalGetIterator(); 28 virtual AbstractIndexEntryIterator *InternalFind(const uint8 *key, 29 size_t length); 30 31 private: 32 class Iterator; 33 class IteratorList; 34 class NodeTree; 35 friend class Iterator; 36 37 private: 38 void _AddIterator(Iterator *iterator); 39 void _RemoveIterator(Iterator *iterator); 40 41 private: 42 NodeTree *fNodes; 43 IteratorList *fIterators; 44 }; 45 46 #endif // LAST_MODIFIED_INDEX_H 47