/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nativelibs4java.opencl.proxy;

import org.bridj.NativeObject;
import org.bridj.Pointer;
import static org.bridj.Pointer.*;

public class PointerUtils {
   
    protected static void setSizeT(long peer, long value) {
        pointerToAddress(peer).setSizeT(value);
    }
    
    protected static void setSizeTAtIndex(long peer, int index, long value) {
        pointerToAddress(peer).setSizeTAtIndex(index, value);
    }
    
    protected static void setPointerAtIndex(long peer, int index, Pointer<?> value) {
        pointerToAddress(peer).setPointerAtIndex(index, value);
    }
    
    protected static void setPointerAtIndex(long peer, int index, NativeObject value) {
        //pointerToAddress(peer).setSizeTAtIndex(index, Pointer.getPeer(Pointer.getPointer(value)));
        pointerToAddress(peer).setSizeTAtIndex(index, Pointer.getPeer(Pointer.pointerTo(value)));
    }
    
    protected static long getSizeT(long peer) {
        return pointerToAddress(peer).getSizeT();
    }
    
    protected static <T> Pointer<T> getPointer(long peer, Class<T> targetClass) {
        return pointerToAddress(peer).getPointer(targetClass);
    }
    
    public static <N extends NativeObject> Pointer<N> getPointer(N instance) {
        return pointerTo(instance);
    }
    
    protected static void setInt(long peer, int value) {
        pointerToAddress(peer).setInt(value);
    }
    
    protected static int getInt(long peer) {
        return pointerToAddress(peer).getInt();
    }
}

@@ -792,10 +792,8 @@
     
-//
 poin
@@ -878,32 +878,35 @@
 alue)));%0A       
+ //
  pointerToAddres
@@ -1259,16 +1259,19 @@
     %0A   
+ //
  public 
@@ -1337,24 +1337,27 @@
 tance) %7B%0A   
+ //
      return 
@@ -1376,24 +1376,27 @@
 stance);%0A   
+ //
  %7D%0A    %0A    

fix snapshot build