#include <OW_Index.hpp>
Inheritance diagram for OW_NAMESPACE::Index:
Public Types | |
enum | EDuplicateKeysFlag { E_NO_DUPLICATES, E_ALLDUPLICATES } |
Public Member Functions | |
virtual | ~Index () |
Destroy this Index object. | |
virtual void | open (const char *fileName, EDuplicateKeysFlag allowDuplicates=E_NO_DUPLICATES)=0 |
Open the given index file. | |
virtual void | close ()=0 |
Close the underlying index file if it is open. | |
virtual IndexEntry | findFirst (const char *key=0)=0 |
Position the cursor on the 1st entry in the index or the first record with a given key. | |
virtual IndexEntry | findNext ()=0 |
Position the cursor on the next entry in the index. | |
virtual IndexEntry | findPrev ()=0 |
Position the cursor on the previous entry in the index. | |
virtual IndexEntry | find (const char *key)=0 |
Position the cursor on the index entry associated a specified key. | |
virtual bool | add (const char *key, Int32 offset)=0 |
Add an entry to the index. | |
virtual bool | remove (const char *key, Int32 offset=-1L)=0 |
Remove an entry from the index. | |
virtual bool | update (const char *key, Int32 newOffset)=0 |
Update an index entry. | |
virtual void | flush () |
Flush all changes to the underlying index file. | |
Static Public Member Functions | |
static IndexRef | createIndexObject () |
Create dynamically allocated instances of a sub-class of Indexer. |
All Index objects will be used to maintain an index on some file. The only data ever associated with the key of the index will be a long value that will be used as an offset into a file. The implementor of the Index class must implement the createIndexObject class. This class will be called to get new Index objects that will later be deleted by the caller. The intention is for the implementor to create a sub-class of Index and have createIndexObject be the factory for those object.
Definition at line 61 of file OW_Index.hpp.
|
Definition at line 69 of file OW_Index.hpp. |
|
Destroy this Index object. This will close the index file if it is open. Definition at line 43 of file OW_Index.cpp. |
|
Add an entry to the index.
Implemented in OW_NAMESPACE::IndexImpl. |
|
Close the underlying index file if it is open.
Implemented in OW_NAMESPACE::IndexImpl. |
|
Create dynamically allocated instances of a sub-class of Indexer. This method must be implemented by whomever desires to implement an Indexer sub-class.
Definition at line 91 of file OW_IndexImpl.cpp. Referenced by OW_NAMESPACE::HDB::checkFile(), OW_NAMESPACE::AssocDb::checkFile(), OW_NAMESPACE::HDB::createFile(), and OW_NAMESPACE::AssocDb::createFile(). |
|
Position the cursor on the index entry associated a specified key.
Implemented in OW_NAMESPACE::IndexImpl. |
|
Position the cursor on the 1st entry in the index or the first record with a given key.
Implemented in OW_NAMESPACE::IndexImpl. |
|
Position the cursor on the next entry in the index.
Implemented in OW_NAMESPACE::IndexImpl. |
|
Position the cursor on the previous entry in the index.
Implemented in OW_NAMESPACE::IndexImpl. |
|
Flush all changes to the underlying index file.
Reimplemented in OW_NAMESPACE::IndexImpl. Definition at line 48 of file OW_Index.cpp. |
|
Open the given index file.
|
|
Remove an entry from the index.
Implemented in OW_NAMESPACE::IndexImpl. |
|
Update an index entry.
Implemented in OW_NAMESPACE::IndexImpl. |