Class IndexerCallbacks

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class IndexerCallbacks
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    A group of callbacks used by indexSourceFile and indexTranslationUnit.

    Member documentation

    • abortQuery – called periodically to check whether indexing should be aborted. Should return 0 to continue, and non-zero to abort.
    • diagnostic – called at the end of indexing; passes the complete diagnostic set.
    • ppIncludedFile – called when a file gets #included/#imported
    • importedASTFile – Called when a AST file (PCH or module) gets imported.

      AST files will not get indexed (there will not be callbacks to index all the entities in an AST file). The recommended action is that, if the AST file is not already indexed, to initiate a new indexing job specific to the AST file.

    • startedTranslationUnit – called at the beginning of indexing a translation unit
    • indexEntityReference – called to index a reference of an entity

    Layout

    
     struct IndexerCallbacks {
         int (*abortQuery) (CXClientData client_data, void *reserved);
         void (*diagnostic) (CXClientData client_data, CXDiagnosticSet diagnosticSet, void *reserved);
         CXIdxClientFile (*enteredMainFile) (CXClientData client_data, CXFile mainFile, void *reserved);
         CXIdxClientFile (*ppIncludedFile) (CXClientData client_data, CXIdxIncludedFileInfo const *info);
         CXIdxClientASTFile (*importedASTFile) (CXClientData client_data, CXIdxImportedASTFileInfo const *info);
         CXIdxClientContainer (*startedTranslationUnit) (CXClientData client_data, void *reserved);
         void (*indexDeclaration) (CXClientData client_data, CXIdxDeclInfo const *info);
         void (*indexEntityReference) (CXClientData client_data, CXIdxEntityRefInfo const *info);
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • ABORTQUERY, DIAGNOSTIC, ENTEREDMAINFILE, PPINCLUDEDFILE, IMPORTEDASTFILE, STARTEDTRANSLATIONUNIT, INDEXDECLARATION, INDEXENTITYREFERENCE

        The struct member offsets.
    • Constructor Detail

      • IndexerCallbacks

        public IndexerCallbacks​(java.nio.ByteBuffer container)
        Creates a IndexerCallbacks instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • abortQuery

        public IndexerAbortQuery abortQuery()
        Returns the value of the abortQuery field.
      • diagnostic

        public IndexerDiagnostic diagnostic()
        Returns the value of the diagnostic field.
      • enteredMainFile

        public IndexerEnteredMainFile enteredMainFile()
        Returns the value of the enteredMainFile field.
      • ppIncludedFile

        public IndexerIncludedFile ppIncludedFile()
        Returns the value of the ppIncludedFile field.
      • importedASTFile

        public IndexerImportedASTFile importedASTFile()
        Returns the value of the importedASTFile field.
      • indexDeclaration

        public IndexerIndexDeclaration indexDeclaration()
        Returns the value of the indexDeclaration field.
      • indexEntityReference

        public IndexerIndexEntityReference indexEntityReference()
        Returns the value of the indexEntityReference field.
      • malloc

        public static IndexerCallbacks malloc()
        Returns a new IndexerCallbacks instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static IndexerCallbacks calloc()
        Returns a new IndexerCallbacks instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static IndexerCallbacks create()
        Returns a new IndexerCallbacks instance allocated with BufferUtils.
      • create

        public static IndexerCallbacks create​(long address)
        Returns a new IndexerCallbacks instance for the specified memory address.
      • createSafe

        @Nullable
        public static IndexerCallbacks createSafe​(long address)
        Like create, but returns null if address is NULL.
      • createSafe

        @Nullable
        public static IndexerCallbacks.Buffer createSafe​(long address,
                                                         int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static IndexerCallbacks mallocStack()
        Returns a new IndexerCallbacks instance allocated on the thread-local MemoryStack.
      • callocStack

        public static IndexerCallbacks callocStack()
        Returns a new IndexerCallbacks instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static IndexerCallbacks mallocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new IndexerCallbacks instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static IndexerCallbacks callocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new IndexerCallbacks instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static IndexerCallbacks.Buffer callocStack​(int capacity)
        Returns a new IndexerCallbacks.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static IndexerCallbacks.Buffer mallocStack​(int capacity,
                                                          org.lwjgl.system.MemoryStack stack)
        Returns a new IndexerCallbacks.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static IndexerCallbacks.Buffer callocStack​(int capacity,
                                                          org.lwjgl.system.MemoryStack stack)
        Returns a new IndexerCallbacks.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity