Package org.eclipse.cdt.core.index

## Interface IIndexManager

All Superinterfaces:
  `IPDOMManager`

    public interface IIndexManager
    extends IPDOMManager

Starting point for working with the index. The manager can be obtained via `CCorePlugin.getIndexManager()`.

Since:
  4.0
Restriction:
  This interface is not intended to be implemented by clients.
Restriction:
  This interface is not intended to be extended by clients.

### Field Summary

Fields
`static int` `ADD_DEPENDENCIES` Constant for passing to getIndex methods.
`static int` `ADD_DEPENDENT` Constant for passing to getIndex methods.
`static int` `ADD_EXTENSION_FRAGMENTS_ADD_IMPORT` Constant for passing to getIndex methods.
`static int` `ADD_EXTENSION_FRAGMENTS_CALL_HIERARCHY` Constant for passing to getIndex methods.
`static int` `ADD_EXTENSION_FRAGMENTS_CONTENT_ASSIST` Constant for passing to getIndex methods.
`static int` `ADD_EXTENSION_FRAGMENTS_EDITOR` Constant for passing to getIndex methods.
`static int` `ADD_EXTENSION_FRAGMENTS_INCLUDE_BROWSER` Constant for passing to getIndex methods.
`static int` `ADD_EXTENSION_FRAGMENTS_NAVIGATION` Constant for passing to getIndex methods.
`static int` `ADD_EXTENSION_FRAGMENTS_SEARCH` Constant for passing to getIndex methods.
`static int` `ADD_EXTENSION_FRAGMENTS_TYPE_HIERARCHY` Constant for passing to getIndex methods.
`static int` `FORCE_INDEX_INCLUSION` Include files that are otherwise would be excluded from the index.
`static int` `FOREVER` Constant for indicating that there is no time out period for joining the indexer job.
`static int` `RESET_INDEX_INCLUSION` Causes files previously included in the index due to FORCE_INDEX_INCLUSION to loose their index inclusion privilege.
`static int` `SKIP_PROVIDED` Deprecated. Extension fragments are now used depending on their configuration.
`static int` `UPDATE_ALL` Constant for requesting an update of all translation units.
`static int` `UPDATE_CHECK_CONFIGURATION` Constant for requesting an update of translation units if their configurations have changed.
`static int` `UPDATE_CHECK_CONTENTS_HASH` This flag modifies behavior of UPDATE_CHECK_TIMESTAMPS.
`static int` `UPDATE_CHECK_TIMESTAMPS` Constant for requesting an update of translation units if their timestamps have changed.
`static int` `UPDATE_EXTERNAL_FILES_FOR_PROJECT` Constant for requesting to update the external files for a project, also.
`static int` `UPDATE_UNRESOLVED_INCLUDES` Constant for requesting an update of translation units that had unresolved includes.

### Fields inherited from interface org.eclipse.cdt.core.dom.IPDOMManager

`ID_FAST_INDEXER, ID_FULL_INDEXER, ID_NO_INDEXER`

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `addIndexChangeListener​(IIndexChangeListener listener)` Registers a listener that will be notified whenever the indexer go idle.
`void` `addIndexerSetupParticipant​(IndexerSetupParticipant participant)` Adds a participant for the indexer-setup
`void` `addIndexerStateListener​(IIndexerStateListener listener)` Registers a listener that will be notified whenever the indexer changes its state.
`void` `export​(ICProject project, String location, int options, org.eclipse.core.runtime.IProgressMonitor monitor)` Exports index for usage within a team.
`IIndex` `getIndex​(ICProject project)` Returns the index for the given project.
`IIndex` `getIndex​(ICProject[] projects)` Returns the index for the given projects.
`IIndex` `getIndex​(ICProject[] projects, int options)` Returns the index for the given projects.
`IIndex` `getIndex​(ICProject project, int options)` Returns the index for the given project.
`String` `getIndexerId​(ICProject project)` Returns the id of the indexer working on the project.
`boolean` `isIndexerIdle()` Checks whether the indexer is currently idle.
`boolean` `isIndexerSetupPostponed​(ICProject proj)` Returns whether the indexer-setup for a project is currently postponed.
`boolean` `isProjectContentSynced​(ICProject cproject)`
`boolean` `isProjectIndexed​(ICProject proj)` Returns whether an indexer is selected for the project.
`boolean` `joinIndexer​(int waitMaxMillis, org.eclipse.core.runtime.IProgressMonitor monitor)` Joins the indexer and reports progress.
`void` `reindex​(ICProject project)` Clears the entire index of the project and schedules the indexer.
`void` `removeIndexChangeListener​(IIndexChangeListener listener)` Removes a previously registered index change listener.
`void` `removeIndexerSetupParticipant​(IndexerSetupParticipant participant)` Removes a participant for the indexer-setup
`void` `removeIndexerStateListener​(IIndexerStateListener listener)` Removes a previously registered indexer state listener.
`void` `setIndexerId​(ICProject project, String indexerId)` Changes the indexer working on the project.
`void` `update​(ICElement[] tuSelection, int options)` Updates the index for the given selection of translation units considering the options supplied.

### Methods inherited from interface org.eclipse.cdt.core.dom.IPDOMManager

`getDefaultIndexerId, setDefaultIndexerId`

### Field Detail

#### ADD_DEPENDENCIES

    static final int ADD_DEPENDENCIES

Constant for passing to getIndex methods. This constant, when set, indicates projects referenced by the set of input projects should also be added to the resulting index.

See Also:
  Constant Field Values

#### ADD_DEPENDENT

    static final int ADD_DEPENDENT

Constant for passing to getIndex methods. This constant, when set, indicates projects which reference any of the set of input projects should also be added to the resulting index.

See Also:
  Constant Field Values

#### SKIP_PROVIDED

    @Deprecated
    static final int SKIP_PROVIDED

Deprecated.
Extension fragments are now used depending on their configuration. Use one of the ADD_EXTENSION_XX flags instead.

See Also:
  Constant Field Values
Restriction:
  This field is not intended to be referenced by clients.

#### ADD_EXTENSION_FRAGMENTS_NAVIGATION

    static final int ADD_EXTENSION_FRAGMENTS_NAVIGATION

Constant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for navigation shall be included in the resulting index.

Since:
  5.4
See Also:
  Constant Field Values

#### ADD_EXTENSION_FRAGMENTS_CONTENT_ASSIST

    static final int ADD_EXTENSION_FRAGMENTS_CONTENT_ASSIST

Constant for passing to getIndex methods. This constant, when set, indicates that the each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for content assist shall be included in the resulting index.

Since:
  5.4
See Also:
  Constant Field Values

#### ADD_EXTENSION_FRAGMENTS_ADD_IMPORT

    static final int ADD_EXTENSION_FRAGMENTS_ADD_IMPORT

Constant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for add import shall be included in the resulting index.

Since:
  5.4
See Also:
  Constant Field Values

#### ADD_EXTENSION_FRAGMENTS_CALL_HIERARCHY

    static final int ADD_EXTENSION_FRAGMENTS_CALL_HIERARCHY

Constant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the call hierarchy shall be included in the resulting index.

Since:
  5.4
See Also:
  Constant Field Values

#### ADD_EXTENSION_FRAGMENTS_TYPE_HIERARCHY

    static final int ADD_EXTENSION_FRAGMENTS_TYPE_HIERARCHY

Constant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the type hierarchy shall be included in the resulting index.

Since:
  5.4
See Also:
  Constant Field Values

#### ADD_EXTENSION_FRAGMENTS_INCLUDE_BROWSER

    static final int ADD_EXTENSION_FRAGMENTS_INCLUDE_BROWSER

Constant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the include browser shall be included in the resulting index.

Since:
  5.4
See Also:
  Constant Field Values

#### ADD_EXTENSION_FRAGMENTS_SEARCH

    static final int ADD_EXTENSION_FRAGMENTS_SEARCH

Constant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the search shall be included in the resulting index.

Since:
  5.4
See Also:
  Constant Field Values

#### ADD_EXTENSION_FRAGMENTS_EDITOR

    static final int ADD_EXTENSION_FRAGMENTS_EDITOR

Constant for passing to getIndex methods. This constant, when set, indicates that each index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not disabled for the editor shall be included in the resulting index.

Since:
  5.5
See Also:
  Constant Field Values

#### FOREVER

    static final int FOREVER

Constant for indicating that there is no time out period for joining the indexer job.

See Also:
  `joinIndexer(int, IProgressMonitor)`, Constant Field Values

#### UPDATE_ALL

    static final int UPDATE_ALL

Constant for requesting an update of all translation units.

See Also:
  Constant Field Values

#### UPDATE_CHECK_TIMESTAMPS

    static final int UPDATE_CHECK_TIMESTAMPS

Constant for requesting an update of translation units if their timestamps have changed.

See Also:
  Constant Field Values

#### UPDATE_CHECK_CONFIGURATION

    static final int UPDATE_CHECK_CONFIGURATION

Constant for requesting an update of translation units if their configurations have changed. The flag currently has no effect.

See Also:
  Constant Field Values

#### UPDATE_EXTERNAL_FILES_FOR_PROJECT

    static final int UPDATE_EXTERNAL_FILES_FOR_PROJECT

Constant for requesting to update the external files for a project, also. This flag works only if it is used to update one or more projects. It shall be used together with `UPDATE_ALL` or `UPDATE_CHECK_TIMESTAMPS`.

Since:
  5.1
See Also:
  Constant Field Values

#### UPDATE_CHECK_CONTENTS_HASH

    static final int UPDATE_CHECK_CONTENTS_HASH

This flag modifies behavior of UPDATE_CHECK_TIMESTAMPS. Both, the timestamp and the hash of the contents of a translation unit, have to change in order to trigger re-indexing. Checking for content changes may reduce indexing overhead for projects that use code generation since generated files are sometimes recreated with identical contents.

Since:
  5.2
See Also:
  Constant Field Values

#### FORCE_INDEX_INCLUSION

    static final int FORCE_INDEX_INCLUSION

Include files that are otherwise would be excluded from the index. This flag is sticky for the duration of the Eclipse session. If the files are later updated without this flag, they remain in the index.

Since:
  5.3
See Also:
  Constant Field Values

#### RESET_INDEX_INCLUSION

    static final int RESET_INDEX_INCLUSION

Causes files previously included in the index due to FORCE_INDEX_INCLUSION to loose their index inclusion privilege. The files included only due to FORCE_INDEX_INCLUSION, will be removed from the index.

Since:
  5.4
See Also:
  Constant Field Values

#### UPDATE_UNRESOLVED_INCLUDES

    static final int UPDATE_UNRESOLVED_INCLUDES

Constant for requesting an update of translation units that had unresolved includes.

Since:
  5.4
See Also:
  Constant Field Values

### Method Detail

#### getIndex

    IIndex getIndex​(ICProject project)
             throws org.eclipse.core.runtime.CoreException

Returns the index for the given project.

Parameters:
  `project` - the project to get the index for
Returns:
  an index for the project
Throws:
  `org.eclipse.core.runtime.CoreException`

#### getIndex

    IIndex getIndex​(ICProject[] projects)
             throws org.eclipse.core.runtime.CoreException

Returns the index for the given projects.

Parameters:
  `projects` - the projects to get the index for
Returns:
  an index for the projects
Throws:
  `org.eclipse.core.runtime.CoreException`

#### getIndex

    IIndex getIndex​(ICProject project,
                    int options)
             throws org.eclipse.core.runtime.CoreException

Returns the index for the given project. You can specify to add dependencies or dependent projects.

Parameters:
  `project` - the project to get the index for
  `options` - `0` or a combination of `ADD_DEPENDENCIES` and `ADD_DEPENDENT`.
Returns:
  an index for the project
Throws:
  `org.eclipse.core.runtime.CoreException`

#### getIndex

    IIndex getIndex​(ICProject[] projects,
                    int options)
             throws org.eclipse.core.runtime.CoreException

Returns the index for the given projects. You can specify to add dependencies or dependent projects.

Parameters:
  `projects` - the projects to get the index for
  `options` - `0` or a combination of `ADD_DEPENDENCIES` and `ADD_DEPENDENT`.
Returns:
  an index for the projects
Throws:
  `org.eclipse.core.runtime.CoreException`

#### addIndexChangeListener

    void addIndexChangeListener​(IIndexChangeListener listener)

Registers a listener that will be notified whenever the indexer go idle.

Parameters:
  `listener` - the listener to register.

#### removeIndexChangeListener

    void removeIndexChangeListener​(IIndexChangeListener listener)

Removes a previously registered index change listener.

Parameters:
  `listener` - the listener to unregister.

#### addIndexerStateListener

    void addIndexerStateListener​(IIndexerStateListener listener)

Registers a listener that will be notified whenever the indexer changes its state.

Parameters:
  `listener` - the listener to register.

#### removeIndexerStateListener

    void removeIndexerStateListener​(IIndexerStateListener listener)

Removes a previously registered indexer state listener.

Parameters:
  `listener` - the listener to unregister.

#### joinIndexer

    boolean joinIndexer​(int waitMaxMillis,
                        org.eclipse.core.runtime.IProgressMonitor monitor)

Joins the indexer and reports progress.

Parameters:
  `waitMaxMillis` - time limit in milliseconds after which the method returns with `false`, or `FOREVER`.
  `monitor` - a monitor to report progress.
Returns:
  `true`, if the indexer went idle in the given time.

#### isIndexerIdle

    boolean isIndexerIdle()

Checks whether the indexer is currently idle. The indexer is idle, when there is currently no request to update files of an index and no initialization for a project is performed. However, the indexer becomes idle, when the setup of a project is postponed (check with `isIndexerSetupPostponed(ICProject)`).

#### isProjectIndexed

    boolean isProjectIndexed​(ICProject proj)

Returns whether an indexer is selected for the project.

Since:
  4.0

#### isProjectContentSynced

    boolean isProjectContentSynced​(ICProject cproject)
                            throws org.eclipse.core.runtime.CoreException

Parameters:
  `cproject` - the project to check
Returns:
  whether the content in the project fragment of the specified project's index is complete (contains all sources) and up to date.
Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  6.4

#### isIndexerSetupPostponed

    boolean isIndexerSetupPostponed​(ICProject proj)

Returns whether the indexer-setup for a project is currently postponed. Note, that a postponed setup does not prevent the indexer from becoming idle (`isIndexerIdle()`.

The fact that the indexer-setup for a project is no longer postponed, will be reported using `IndexerSetupParticipant.onIndexerSetup(ICProject)`.

#### getIndexerId

    String getIndexerId​(ICProject project)

Returns the id of the indexer working on the project.

Specified by:
  `getIndexerId` in interface `IPDOMManager`
Since:
  4.0

#### setIndexerId

    void setIndexerId​(ICProject project,
                      String indexerId)

Changes the indexer working on the project.

Specified by:
  `setIndexerId` in interface `IPDOMManager`
Since:
  4.0

#### reindex

    void reindex​(ICProject project)

Clears the entire index of the project and schedules the indexer.

Since:
  4.0

#### update

    void update​(ICElement[] tuSelection,
                int options)
         throws org.eclipse.core.runtime.CoreException

Updates the index for the given selection of translation units considering the options supplied. The selection is defined by an array of translation units, containers and projects. For containers and projects all recursively nested translation units are considered.

Parameters:
  `tuSelection` - the translation units to update.
  `options` - one of `UPDATE_ALL` or `UPDATE_CHECK_TIMESTAMPS` optionally combined with `UPDATE_EXTERNAL_FILES_FOR_PROJECT` and `UPDATE_CHECK_CONTENTS_HASH`.
Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  4.0

#### export

    void export​(ICProject project,
                String location,
                int options,
                org.eclipse.core.runtime.IProgressMonitor monitor)
         throws org.eclipse.core.runtime.CoreException

Exports index for usage within a team.

Parameters:
  `project` - a project for which the PDOM is to be exported.
  `location` - the target location for the database.
  `options` - currently none are supported.
Throws:
  `org.eclipse.core.runtime.CoreException`
Since:
  4.0

#### addIndexerSetupParticipant

    void addIndexerSetupParticipant​(IndexerSetupParticipant participant)

Adds a participant for the indexer-setup

#### removeIndexerSetupParticipant

    void removeIndexerSetupParticipant​(IndexerSetupParticipant participant)

Removes a participant for the indexer-setup