001    package org.bridj.ann;
002    
003    import java.lang.annotation.ElementType;
004    import java.lang.annotation.Retention;
005    import java.lang.annotation.RetentionPolicy;
006    import java.lang.annotation.Target;
007    
008    /**
009     * Mark a C++ method as virtual and specify its position in the virtual table.<br>
010     * The virtual table offset is optional but strongly recommended (will fail in many cases without it).<br>
011     * This position is relative to the struct's declared class, not to the parent structures/classes (unlike {@link Field}, which index is absolute).
012     * @author ochafik
013     */
014    @Retention(RetentionPolicy.RUNTIME)
015    @Target(ElementType.METHOD)
016    public @interface Virtual {
017            /**
018             * Optional relative virtual table offset for the C++ method (starts at 0 for each C++ class, even if it has ancestors with virtual methods)
019             */
020        int value() default -1;
021    }