org.cinvoke
Class Ptr

java.lang.Object
  extended byorg.cinvoke.Ptr
All Implemented Interfaces:
java.io.Serializable

public final class Ptr
extends java.lang.Object
implements java.io.Serializable

Used to send or read values the size of a C pointer type. The size of pointer values in C can vary with the current native platform. Declaring native interfaces with this type will always marshal the corresponding values as the correct size.

See Also:
Serialized Form

Constructor Summary
Ptr(long val)
          Initializes a Ptr instance.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 long longValue()
          Returns a marshaled value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ptr

public Ptr(long val)
Initializes a Ptr instance.

Parameters:
val - The value to marshal. Note that not all the bits in the long value are guaranteed to be used by the called platform. Directly using this constructor is discouraged. In particular, the C standard does not guarantee an integer representation for pointer values, so using this constructor may be undefined. The only integer value which is always defined is 0, which is equivalent to the NULL pointer. Otherwise, you should only pass Ptr values to C functions which you have received as return values from other C functions.
Method Detail

longValue

public long longValue()
Returns a marshaled value.

Returns:
The marshaled value. Note that not all the bits in the long value are guaranteed to be used by the called platform. Use of this method is discouraged. In particular, the C standard does not guarantee an integer representation for pointer values, so using this method may be undefined. The only integer value which is always defined is 0, which is equivalent to the NULL pointer. Otherwise, you should only pass Ptr values to C functions which you have received as return values from other C functions.

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()