C# Class GitSharp.Core.ObjectDatabase

Abstraction of arbitrary object storage. An object database stores one or more Git objects, indexed by their unique ObjectId. Optionally an object database can reference one or more alternates; other ObjectDatabase instances that are searched in addition to the current database. Databases are usually divided into two halves: a half that is considered to be fast to search, and a half that is considered to be slow to search. When alternates are present the fast half is fully searched (recursively through all alternates) before the slow half is considered.
Inheritance: IDisposable
Afficher le fichier Open project: jagregory/GitSharp Class Usage Examples

Protected Properties

Свойство Type Description
NoAlternates GitSharp.Core.ObjectDatabase[]

Méthodes publiques

Méthode Description
Dispose ( ) : void
OpenObjectInAllPacks ( ICollection @out, GitSharp.Core.WindowCursor windowCursor, AnyObjectId objectId ) : void

Open the object from all packs containing it. If any alternates are present, their packs are also considered.

OpenObjectInAllPacksImplementation ( ICollection @out, GitSharp.Core.WindowCursor windowCursor, AnyObjectId objectId ) : void

Open the object from all packs containing it. If any alternates are present, their packs are also considered.

close ( ) : void

Close any resources held by this database and its active alternates.

closeAlternates ( ) : void

Fully close all loaded alternates and clear the alternate list.

closeSelf ( ) : void

Close any resources held by this database only; ignoring alternates. To fully close this database and its referenced alternates, the caller should instead invoke close().

create ( ) : void

Initialize a new object database at this location.

exists ( ) : bool

Gets if this database is already created; If it returns false, the caller should invoke create to create this database location.

getAlternates ( ) : GitSharp.Core.ObjectDatabase[]

Get the alternate databases known to this database.

hasObject ( AnyObjectId objectId ) : bool

Does the requested object exist in this database? Alternates (if present) are searched automatically.

hasObject1 ( AnyObjectId objectId ) : bool

Fast half of hasObject(AnyObjectId).

hasObject2 ( string objectName ) : bool

Slow half of hasObject(AnyObjectId).

loadAlternates ( ) : GitSharp.Core.ObjectDatabase[]

Load the list of alternate databases into memory. This method is invoked by getAlternates() if the alternate list has not yet been populated, or if closeAlternates() has been called on this instance and the alternate list is needed again. If the alternate array is empty, implementors should consider using the constant NoAlternates.

openObject ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader

Open an object from this database. Alternates (if present) are searched automatically.

openObject1 ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader

Fast half of openObject(WindowCursor, AnyObjectId).

openObject2 ( GitSharp.Core.WindowCursor curs, string objectName, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader

Slow half of openObject(WindowCursor, AnyObjectId).

tryAgain1 ( ) : bool

true if the fast-half search should be tried again.

Méthodes protégées

Méthode Description
ObjectDatabase ( ) : System

Initialize a new database instance for access.

closeAlternates ( ObjectDatabase alt ) : void

Private Methods

Méthode Description
OpenObjectImpl1 ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
OpenObjectImpl2 ( GitSharp.Core.WindowCursor curs, string objectName, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
hasObjectImpl1 ( AnyObjectId objectId ) : bool
hasObjectImpl2 ( string objectId ) : bool

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

ObjectDatabase() protected méthode

Initialize a new database instance for access.
protected ObjectDatabase ( ) : System
Résultat System

OpenObjectInAllPacks() public méthode

Open the object from all packs containing it. If any alternates are present, their packs are also considered.
public OpenObjectInAllPacks ( ICollection @out, GitSharp.Core.WindowCursor windowCursor, AnyObjectId objectId ) : void
@out ICollection
windowCursor GitSharp.Core.WindowCursor /// Temporary working space associated with the calling thread. ///
objectId AnyObjectId of object to search for.
Résultat void

OpenObjectInAllPacksImplementation() public méthode

Open the object from all packs containing it. If any alternates are present, their packs are also considered.
public OpenObjectInAllPacksImplementation ( ICollection @out, GitSharp.Core.WindowCursor windowCursor, AnyObjectId objectId ) : void
@out ICollection
windowCursor GitSharp.Core.WindowCursor /// Temporary working space associated with the calling thread. ///
objectId AnyObjectId of object to search for.
Résultat void

close() public méthode

Close any resources held by this database and its active alternates.
public close ( ) : void
Résultat void

closeAlternates() public méthode

Fully close all loaded alternates and clear the alternate list.
public closeAlternates ( ) : void
Résultat void

closeAlternates() protected méthode

protected closeAlternates ( ObjectDatabase alt ) : void
alt ObjectDatabase
Résultat void

closeSelf() public méthode

Close any resources held by this database only; ignoring alternates. To fully close this database and its referenced alternates, the caller should instead invoke close().
public closeSelf ( ) : void
Résultat void

create() public méthode

Initialize a new object database at this location.
public create ( ) : void
Résultat void

exists() public méthode

Gets if this database is already created; If it returns false, the caller should invoke create to create this database location.
public exists ( ) : bool
Résultat bool

getAlternates() public méthode

Get the alternate databases known to this database.
public getAlternates ( ) : GitSharp.Core.ObjectDatabase[]
Résultat GitSharp.Core.ObjectDatabase[]

hasObject() public méthode

Does the requested object exist in this database? Alternates (if present) are searched automatically.
public hasObject ( AnyObjectId objectId ) : bool
objectId AnyObjectId identity of the object to test for existence of.
Résultat bool

hasObject1() public abstract méthode

Fast half of hasObject(AnyObjectId).
public abstract hasObject1 ( AnyObjectId objectId ) : bool
objectId AnyObjectId /// Identity of the object to test for existence of. ///
Résultat bool

hasObject2() public méthode

Slow half of hasObject(AnyObjectId).
public hasObject2 ( string objectName ) : bool
objectName string /// Identity of the object to test for existence of. ///
Résultat bool

loadAlternates() public méthode

Load the list of alternate databases into memory. This method is invoked by getAlternates() if the alternate list has not yet been populated, or if closeAlternates() has been called on this instance and the alternate list is needed again. If the alternate array is empty, implementors should consider using the constant NoAlternates.
/// The alternate list could not be accessed. The empty alternate /// array will be assumed by the caller. ///
public loadAlternates ( ) : GitSharp.Core.ObjectDatabase[]
Résultat GitSharp.Core.ObjectDatabase[]

openObject() public méthode

Open an object from this database. Alternates (if present) are searched automatically.
public openObject ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
curs GitSharp.Core.WindowCursor /// Temporary working space associated with the calling thread. ///
objectId AnyObjectId Identity of the object to open.
Résultat GitSharp.Core.ObjectLoader

openObject1() public abstract méthode

Fast half of openObject(WindowCursor, AnyObjectId).
public abstract openObject1 ( GitSharp.Core.WindowCursor curs, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
curs GitSharp.Core.WindowCursor /// temporary working space associated with the calling thread. ///
objectId AnyObjectId identity of the object to open.
Résultat GitSharp.Core.ObjectLoader

openObject2() public méthode

Slow half of openObject(WindowCursor, AnyObjectId).
public openObject2 ( GitSharp.Core.WindowCursor curs, string objectName, AnyObjectId objectId ) : GitSharp.Core.ObjectLoader
curs GitSharp.Core.WindowCursor /// temporary working space associated with the calling thread. ///
objectName string Name of the object to open.
objectId AnyObjectId identity of the object to open.
Résultat GitSharp.Core.ObjectLoader

tryAgain1() public méthode

true if the fast-half search should be tried again.
public tryAgain1 ( ) : bool
Résultat bool

Property Details

NoAlternates protected_oe static_oe property

Constant indicating no alternate databases exist.
protected static ObjectDatabase[],GitSharp.Core NoAlternates
Résultat GitSharp.Core.ObjectDatabase[]