001    package org.bridj;
002    
003    /**
004     * Class used by JNAerator to represent pointers to unknown structs that were typedef-ed in the following frequent pattern :
005     * <pre>{@code
006     *  typedef struct _A *A;
007     * }</pre>
008     * @author ochafik
009     */
010    public class TypedPointer extends Pointer.OrderedPointer {
011            Pointer<?> copy;
012            
013            private TypedPointer(PointerIO<?> io, long peer) {
014                    super(io, peer, UNKNOWN_VALIDITY, UNKNOWN_VALIDITY, null, 0, null);
015            }
016            public TypedPointer(long address) {
017            this(PointerIO.getPointerInstance(), address);
018            }
019            public TypedPointer(Pointer<?> ptr) {
020            this(PointerIO.getPointerInstance(), ptr.getPeer());
021                    copy = ptr;
022            }
023    }