Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d5638c0001ce0549507af2b14bab990a024a74b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*******************************************************************************
 * Copyright (c) 2014 Google, Inc and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 * 	   Sergey Prigogin (Google) - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.ui.extensions;

import org.eclipse.core.runtime.CoreException;

import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.ICElement;

/**
 * Interface for classes implementing the org.eclipse.cdt.ui.callHierarchyProviders extension
 * point.
 *
 * <p>
 * <strong>EXPERIMENTAL</strong>. This class or interface has been added as
 * part of a work in progress. There is no guarantee that this API will work or
 * that it will remain the same. Please do not use this API without consulting
 * with the CDT team.
 *
 * @since 5.8
 */
public interface ICallHierarchyProvider {
	/**
	 * Adds the calling functions and the corresponding call points located in files not covered
	 * by the CDT index to the call hierarchy results.
	 *
	 * @param callee the function being called
	 * @param linkageID the ID of the linkage to search for calling functions or -1 to search
	 *     all linkages.
	 * @param index the index, for which the caller is holding a read lock
	 * @param result the accumulator to add the results to
	 * @throws CoreException may be thrown in case of an error
	 */
	void findCalledBy(ICElement callee, int linkageID, IIndex index, ICalledByResult result)
			throws CoreException;

	/**
	 * Adds the called functions and the corresponding call points for a function defined in a file
	 * not covered by the CDT index to the call hierarchy results.
	 *
	 * @param caller the function to get the called functions for
	 * @param index the index, for which the caller is holding a read lock
	 * @param result the accumulator to add the results to
	 * @throws CoreException may be thrown in case of an error
	 */
	void findCalls(ICElement caller, IIndex index, ICallToResult result) throws CoreException;

	/**
	 * Checks if an element representing a function is owned by the call hierarchy provider.
	 *
	 * @param element the element to check
	 * @return {@code true} if the element is owned by this provider.
	 */
	boolean ownsElement(ICElement element);
}

Back to the top