Class COM.odi.jcpp.PeerReturnValue

java.lang.Object
   |
   +----COM.odi.jcpp.PeerReturnValue

public class PeerReturnValue
extends Object
The PeerReturnValue class wraps the return values from a call to a C++ method. It makes provision for a return value and an exception. If you use the peer generator tool (osjcgen) to generate peer class definitions, you do not need to be concerned with the constructors in this class. If you define peer classes yourself, this class provides the accessors for return values of all supported types.


Method Index

 o getBoolean()
Accessor for a boolean return value.
 o getByte()
Accessor for a byte return value.
 o getChar()
Accessor for a char return value.
 o getDatabase()
Accessor for a Database return value.
 o getDouble()
Accessor for a double return value.
 o getFloat()
Accessor for a float return value.
 o getInt()
Accessor for a int return value.
 o getLinearObjectReference()
Accessor for raw addresses that are return values.
 o getLong()
Accessor for a long return value.
 o getObject()
Accessor for an Object return value when the return value is not a peer pointer.
 o getPeerReturnValue()
Returns an instance of a PeerReturnValue structure that can be used to hold return values from a C++ function call.
 o getSegment()
Accessor for a Segment return value.
 o getShort()
Accessor for a short return value.
 o noteAsPersistent(CPlusPlus)
Forms an association between the returned linearObjectReference and the Java peer object so that the Java peer object becomes a valid Java peer object.

Methods

 o getBoolean
  public boolean getBoolean()
Accessor for a boolean return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getByte
  public byte getByte()
Accessor for a byte return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getShort
  public short getShort()
Accessor for a short return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getInt
  public int getInt()
Accessor for a int return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getLong
  public long getLong()
Accessor for a long return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getChar
  public char getChar()
Accessor for a char return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getFloat
  public float getFloat()
Accessor for a float return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getDouble
  public double getDouble()
Accessor for a double return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getDatabase
  public Database getDatabase()
Accessor for a Database return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getSegment
  public Segment getSegment()
Accessor for a Segment return value. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. It then converts the return value to a Java return type. The accessor then causes the PeerReturnValue object to be recycled. Finally, the accessor returns the Java return value.

 o getObject
  public Object getObject()
Accessor for an Object return value when the return value is not a peer pointer. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. The accessor causes the PeerReturnValue object to be recycled.

 o getLinearObjectReference
  public byte[] getLinearObjectReference()
Accessor for raw addresses that are return values. This method first checks if there is a pending exception that needs to be thrown, and throws it if there is one. These raw addresses are in the form of linear object references, also called linear addresses, which are typically used to construct peer pointer instances.

Returns:
Linear representation of the object reference. WARNING: the array returned is owned by this PeerReturnValue which is subject to re-use immediately. Calls to this method should be synchronized on the current object manager until the caller is done with the return value;
 o noteAsPersistent
  public void noteAsPersistent(CPlusPlus object)
Forms an association between the returned linearObjectReference and the Java peer object so that the Java peer object becomes a valid Java peer object. Typically, you invoke this method after you allocate a C++ object and run its constructors. At that point, you must associate a Java peer object with the new C++ object.

Just like the other accessor methods, this method checks if there is a pending exception that needs to be thrown, and throws it if there is one. Also, this method recycles the result.

Parameters:
object - The Java peer object
 o getPeerReturnValue
  public static PeerReturnValue getPeerReturnValue()
Returns an instance of a PeerReturnValue structure that can be used to hold return values from a C++ function call. If an instance of PeerReturnValue is available, this method returns an available instance. If an instance is not available, this method creates a new one and returns it.


Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.