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.
-
getBoolean()
- Accessor for a boolean return value.
-
getByte()
- Accessor for a byte return value.
-
getChar()
- Accessor for a char return value.
-
getDatabase()
- Accessor for a Database return value.
-
getDouble()
- Accessor for a double return value.
-
getFloat()
- Accessor for a float return value.
-
getInt()
- Accessor for a int return value.
-
getLinearObjectReference()
- Accessor for raw addresses that are return values.
-
getLong()
- Accessor for a long return value.
-
getObject()
- Accessor for an Object return value when the return value is not
a peer pointer.
-
getPeerReturnValue()
- Returns an instance of a PeerReturnValue structure that can be used to
hold return values from a C++ function call.
-
getSegment()
- Accessor for a Segment return value.
-
getShort()
- Accessor for a short return value.
-
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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;
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
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.