C# Class ScrewTurn.Wiki.SearchEngine.IndexStorerBase

Implements a base class for an index storer.
Instance and static members are thread-safe.
Inheritance: IDisposable
Afficher le fichier Open project: mono/ScrewTurnWiki Class Usage Examples

Protected Properties

Свойство Type Description
dataCorrupted bool
disposed bool
index IInMemoryIndex
indexChangedHandler EventHandler
reasonForDataCorruption System.Exception

Méthodes publiques

Méthode Description
Dispose ( ) : void

Disposes the current object.

IndexStorerBase ( IInMemoryIndex index ) : System

Initializes a new instance of the IndexStorerBase class.

LoadIndex ( ) : void

Loads the index from the data store the first time.

Méthodes protégées

Méthode Description
DeleteData ( DumpedChange data, object state ) : void

Deletes data from the data storage.

Find ( DumpedWord word, IEnumerable list ) : bool

Determines whether a DumpedWord is contained in a list.

Find ( DumpedWordMapping mapping, IEnumerable list ) : bool

Determines whether a DumpedWordMapping is contained in a list.

IndexChangedHandler ( object sender, IndexChangedEventArgs e ) : void

Handles the IInMemoryIndex.IndexChanged events.

InitDataStore ( object state ) : void

Initializes the data storage.

LoadIndexInternal ( DumpedDocument &documents, DumpedWord &words, DumpedWordMapping &mappings ) : void

Loads the index from the data store the first time.

SaveData ( DumpedChange data, object state ) : IndexStorerResult

Stores new data into the data storage.

When saving a new document, the document ID in data.Mappings must be replaced with the currect document ID, generated by the concrete implementation of this method. data.Words should have IDs numbered from uint.MaxValue downwards. The method re-numbers the words appropriately.

Method Details

DeleteData() protected abstract méthode

Deletes data from the data storage.
protected abstract DeleteData ( DumpedChange data, object state ) : void
data DumpedChange The data to delete.
state object A state object passed from the index.
Résultat void

Dispose() public méthode

Disposes the current object.
public Dispose ( ) : void
Résultat void

Find() protected static méthode

Determines whether a DumpedWord is contained in a list.
protected static Find ( DumpedWord word, IEnumerable list ) : bool
word DumpedWord The word.
list IEnumerable The list.
Résultat bool

Find() protected static méthode

Determines whether a DumpedWordMapping is contained in a list.
protected static Find ( DumpedWordMapping mapping, IEnumerable list ) : bool
mapping DumpedWordMapping The mapping.
list IEnumerable The list.
Résultat bool

IndexChangedHandler() protected méthode

Handles the IInMemoryIndex.IndexChanged events.
protected IndexChangedHandler ( object sender, IndexChangedEventArgs e ) : void
sender object The sender.
e IndexChangedEventArgs The event arguments.
Résultat void

IndexStorerBase() public méthode

Initializes a new instance of the IndexStorerBase class.
If is null.
public IndexStorerBase ( IInMemoryIndex index ) : System
index IInMemoryIndex The index to manage.
Résultat System

InitDataStore() protected abstract méthode

Initializes the data storage.
protected abstract InitDataStore ( object state ) : void
state object A state object passed from the index.
Résultat void

LoadIndex() public méthode

Loads the index from the data store the first time.
public LoadIndex ( ) : void
Résultat void

LoadIndexInternal() protected abstract méthode

Loads the index from the data store the first time.
protected abstract LoadIndexInternal ( DumpedDocument &documents, DumpedWord &words, DumpedWordMapping &mappings ) : void
documents DumpedDocument The dumped documents.
words DumpedWord The dumped words.
mappings DumpedWordMapping The dumped word mappings.
Résultat void

SaveData() protected abstract méthode

Stores new data into the data storage.
When saving a new document, the document ID in data.Mappings must be replaced with the currect document ID, generated by the concrete implementation of this method. data.Words should have IDs numbered from uint.MaxValue downwards. The method re-numbers the words appropriately.
protected abstract SaveData ( DumpedChange data, object state ) : IndexStorerResult
data DumpedChange The data to store.
state object A state object passed by the index.
Résultat IndexStorerResult

Property Details

dataCorrupted protected_oe property

true if the index data seems corrupted.
protected bool dataCorrupted
Résultat bool

disposed protected_oe property

Indicates whether the object was disposed.
protected bool disposed
Résultat bool

index protected_oe property

The index bound to this storer.
protected IInMemoryIndex index
Résultat IInMemoryIndex

indexChangedHandler protected_oe property

The event handler for the IInMemoryIndex.IndexChanged of the bound index.
protected EventHandler indexChangedHandler
Résultat EventHandler

reasonForDataCorruption protected_oe property

Contains the exception occurred during index setup.
protected Exception,System reasonForDataCorruption
Résultat System.Exception