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 13class LastModifiedIndex : public Index, private NodeListener { 14public: 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 22private: 23 virtual void NodeAdded(Node *node); 24 virtual void NodeRemoved(Node *node); 25 26protected: 27 virtual AbstractIndexEntryIterator *InternalGetIterator(); 28 virtual AbstractIndexEntryIterator *InternalFind(const uint8 *key, 29 size_t length); 30 31private: 32 class Iterator; 33 class IteratorList; 34 class NodeTree; 35 friend class Iterator; 36 37private: 38 void _AddIterator(Iterator *iterator); 39 void _RemoveIterator(Iterator *iterator); 40 41private: 42 NodeTree *fNodes; 43 IteratorList *fIterators; 44}; 45 46#endif // LAST_MODIFIED_INDEX_H 47