Eclipse CDT
Pre-release 3.0

org.eclipse.cdt.core.model
Interface IFunctionDeclaration

All Superinterfaces:
ICElement, IDeclaration, ISourceManipulation, ISourceReference
All Known Subinterfaces:
IBinaryFunction, IFunction, IFunctionTemplate, IFunctionTemplateDeclaration, IMethod, IMethodDeclaration, IMethodTemplate, IMethodTemplateDeclaration

public interface IFunctionDeclaration
extends IDeclaration

Represents a function


Field Summary
 
Fields inherited from interface org.eclipse.cdt.core.model.ICElement
C_ARCHIVE, C_BINARY, C_CCONTAINER, C_CLASS, C_CLASS_CTOR, C_CLASS_DECLARATION, C_CLASS_DTOR, C_ENUMERATION, C_ENUMERATOR, C_FIELD, C_FUNCTION, C_FUNCTION_DECLARATION, C_INCLUDE, C_MACRO, C_METHOD, C_METHOD_DECLARATION, C_MODEL, C_NAMESPACE, C_PROJECT, C_STORAGE_EXTERN, C_STORAGE_STATIC, C_STRUCT, C_STRUCT_DECLARATION, C_TEMPLATE_CLASS, C_TEMPLATE_CLASS_DECLARATION, C_TEMPLATE_FUNCTION, C_TEMPLATE_FUNCTION_DECLARATION, C_TEMPLATE_METHOD, C_TEMPLATE_METHOD_DECLARATION, C_TEMPLATE_STRUCT, C_TEMPLATE_STRUCT_DECLARATION, C_TEMPLATE_UNION, C_TEMPLATE_UNION_DECLARATION, C_TEMPLATE_VARIABLE, C_TYPEDEF, C_UNION, C_UNION_DECLARATION, C_UNIT, C_UNKNOWN_DECLARATION, C_USING, C_VARIABLE, C_VARIABLE_DECLARATION, C_VARIABLE_LOCAL, C_VCONTAINER, CPP_FRIEND, CPP_PRIVATE, CPP_PROTECTED, CPP_PUBLIC
 
Method Summary
 String[] getExceptions()
          Returns the type signatures of the exceptions this method throws, in the order declared in the source.
 int getNumberOfParameters()
          Returns the number of parameters of this method.
 String getParameterInitializer(int pos)
          Returns the initializer of parameters position for this method.
 String[] getParameterTypes()
          Returns the type signatures for the parameters of this method.
 String getReturnType()
          Returns the return value of this method.
 String getSignature()
          Returns the signature of the method.
 
Methods inherited from interface org.eclipse.cdt.core.model.IDeclaration
isConst, isStatic, isVolatile
 
Methods inherited from interface org.eclipse.cdt.core.model.ICElement
accept, exists, getAncestor, getCModel, getCProject, getElementName, getElementType, getParent, getPath, getResource, getUnderlyingResource, isReadOnly, isStructureKnown
 
Methods inherited from interface org.eclipse.cdt.core.model.ISourceManipulation
copy, delete, move, rename
 
Methods inherited from interface org.eclipse.cdt.core.model.ISourceReference
getSource, getSourceRange, getTranslationUnit
 

Method Detail

getExceptions

String[] getExceptions()
Returns the type signatures of the exceptions this method throws, in the order declared in the source. Returns an empty array if this method throws no exceptions.

For example, a source method declaring "void f(int a) throw (x1, x2);", would return the array {"x1", "x2"}.

Throws:
CModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
Signature

getNumberOfParameters

int getNumberOfParameters()
Returns the number of parameters of this method.


getParameterInitializer

String getParameterInitializer(int pos)
Returns the initializer of parameters position for this method. Returns an empty string if this argument has no initializer.

For example, a method declared as public void foo(String text, int length=9) would return the array {"9"}.

Throws:
CModelException - if this argument does not exist or if an exception occurs while accessing its corresponding resource.

getParameterTypes

String[] getParameterTypes()
Returns the type signatures for the parameters of this method. Returns an empty array if this method has no parameters. This is a handle-only method.

For example, a source method declared as void foo(string text, int length) would return the array {"string","int"}.

See Also:
Signature

getReturnType

String getReturnType()
Returns the return value of this method.


getSignature

String getSignature()
                    throws CModelException
Returns the signature of the method.

Throws:
CModelException

Eclipse CDT
Pre-release 3.0

Copyright (c) IBM Corp. and others 2004. All Rights Reserved.