Git.framework Reference Library

GITCommitEnumerator Class Reference

GITCommitEnumerator Class Reference

Declared in GITCommitEnumerator.h

Overview

An NSEnumerator subclass which provides the ability to iterate or collect the series of parents of a given commit.

The enumerator provides two distinct enumeration modes. The first and default mode is breadth first traversal and is specified via GITCommitEnumeratorBreadthFirstMode passed as the mode argument to either +enumeratorFromCommit:mode: or -initFromCommit:mode: method. The second enumeration mode performs a depth first traversal and is specified via GITCommitEnumeratorDepthFirstMode.

Tasks

Class Methods

enumeratorFromCommit:

+ (GITCommitEnumerator *)enumeratorFromCommit:(GITCommit *)head
Parameters
head

Commit object from which the receiver will enumerate from

Return Value

An enumerator which will start from the head using breadth first traversal

Discussion

Creates and returns an enumerator from the given commit head.

The enumerator is created with the default enumeration mode. The default enumeration mode is GITCommitEnumeratorBreadthFirstMode indicating the use of breadth first traversal algorithm.

See Also
Declared In
GITCommitEnumerator.h

enumeratorFromCommit:mode:

+ (GITCommitEnumerator *)enumeratorFromCommit:(GITCommit *)head mode:(GITCommitEnumeratorMode)mode
Parameters
head

Commit object from which the receiver will enumerate from

mode

A GITCommitEnumeratorMode flag indicating the type of enumeration to be used

Return Value

An enumerator object which will start from the head using the specified mode

Discussion

Creates and returns an enumerator from the given commit head using the provided enumeration mode.

See Also
Declared In
GITCommitEnumerator.h

Instance Methods

initFromCommit:mode:

- (id)initFromCommit:(GITCommit *)head mode:(GITCommitEnumeratorMode)mode
Parameters
head

Commit object from which the receiver will enumerate from

mode

A GITCommitEnumeratorMode flag indicating the type of enumeration to be used

Return Value

An enumerator object initialised with the given commit head and mode

Discussion

Initialises a newly allocated enumerator object initialised with the given commit head and mode.

See Also
Declared In
GITCommitEnumerator.h

Last updated: 2011-2-20