com.jogamp.gluegen.cgram.types

## Class FunctionType

- java.lang.Object
- - com.jogamp.gluegen.cgram.types.Type
  - - com.jogamp.gluegen.cgram.types.FunctionType

- All Implemented Interfaces:
    Cloneable

      public class FunctionType
      extends Type
      implements Cloneable

  Describes a function type, used to model both function declarations and (via PointerType) function pointers.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FunctionType(String name, SizeThunk size, Type returnType, int cvAttributes)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addArgument(Type argumentType, String argumentName)` Add an argument's name and type.
    `FunctionType` | `asFunction()` Casts this to a FunctionType or returns null if not a FunctionType.
    `Object` | `clone()`
    `boolean` | `equals(Object arg)` Equality test for Types.
    `String` | `getArgumentName(int i)` Returns the name of the ith argument.
    `Type` | `getArgumentType(int i)` Returns the type of the ith argument.
    `int` | `getNumArguments()`
    `Type` | `getReturnType()` Returns the return type of this function.
    `void` | `setArgumentName(int i, String name)`
    `String` | `toString()` Returns a string representation of this type.
    `String` | `toString(String functionName)`
    `String` | `toString(String functionName, boolean emitNativeTag)`
    `void` | `visit(TypeVisitor arg)` Visit this type and all of the component types of this one; for example, the return type and argument types of a FunctionType.

    - ### Methods inherited from class com.jogamp.gluegen.cgram.types.Type

      `arrayDimension, asArray, asBit, asCompound, asDouble, asEnum, asFloat, asInt, asPointer, asVoid, getBaseElementType, getCVAttributes, getCVAttributesString, getCVVariant, getDebugString, getName, getName, getSize, getSize, hashCode, hasTypedefName, isArray, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isFunctionPointer, isInt, isPointer, isPrimitive, isVoid, isVolatile, pointerDepth, setName`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### FunctionType

          public FunctionType(String name,
                      SizeThunk size,
                      Type returnType,
                      int cvAttributes)

  - ### Method Detail

    - #### clone

          public Object clone()

      Overrides:
        `clone` in class `Type`

    - #### equals

          public boolean equals(Object arg)

      Description copied from class: `Type`
      Equality test for Types.
      Overrides:
        `equals` in class `Type`

    - #### asFunction

          public FunctionType asFunction()

      Description copied from class: `Type`
      Casts this to a FunctionType or returns null if not a FunctionType.
      Overrides:
        `asFunction` in class `Type`

    - #### getReturnType

          public Type getReturnType()

      Returns the return type of this function.

    - #### getNumArguments

          public int getNumArguments()

    - #### getArgumentName

          public String getArgumentName(int i)

      Returns the name of the ith argument. May return null if no argument names were available during parsing.

    - #### getArgumentType

          public Type getArgumentType(int i)

      Returns the type of the ith argument.

    - #### addArgument

          public void addArgument(Type argumentType,
                         String argumentName)

      Add an argument's name and type. Use null for unknown argument names.

    - #### setArgumentName

          public void setArgumentName(int i,
                             String name)

    - #### toString

          public String toString()

      Description copied from class: `Type`
      Returns a string representation of this type. This string is not necessarily suitable for use as a type specifier; for example, it will contain an expanded description of structs/unions.
      Overrides:
        `toString` in class `Type`

    - #### toString

          public String toString(String functionName)

    - #### toString

          public String toString(String functionName,
                        boolean emitNativeTag)

    - #### visit

          public void visit(TypeVisitor arg)

      Description copied from class: `Type`
      Visit this type and all of the component types of this one; for example, the return type and argument types of a FunctionType.
      Overrides:
        `visit` in class `Type`