|
|
|
@ -8,41 +8,41 @@ import org.kde.qt.QtSupport;
|
|
|
|
|
|
|
|
|
|
Reference counting for shared objects. If you derive your object
|
|
|
|
|
from this class, then you may use it in conjunction with
|
|
|
|
|
KSharedPtr to control the lifetime of your object.
|
|
|
|
|
Specifically, all classes that derive from KShared have an internal
|
|
|
|
|
TDESharedPtr to control the lifetime of your object.
|
|
|
|
|
Specifically, all classes that derive from TDEShared have an internal
|
|
|
|
|
counter keeping track of how many other objects have a reference to
|
|
|
|
|
their object. If used with KSharedPtr, then your object will
|
|
|
|
|
their object. If used with TDESharedPtr, then your object will
|
|
|
|
|
not be deleted until all references to the object have been
|
|
|
|
|
released.
|
|
|
|
|
You should probably not ever use any of the methods in this class
|
|
|
|
|
directly -- let the KSharedPtr take care of that. Just derive
|
|
|
|
|
your class from KShared and forget about it.
|
|
|
|
|
directly -- let the TDESharedPtr take care of that. Just derive
|
|
|
|
|
your class from TDEShared and forget about it.
|
|
|
|
|
@author Waldo Bastian <bastian@kde.org>
|
|
|
|
|
|
|
|
|
|
@short Reference counting for shared objects.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
public class KShared implements QtSupport {
|
|
|
|
|
public class TDEShared implements QtSupport {
|
|
|
|
|
private long _qt;
|
|
|
|
|
private boolean _allocatedInJavaWorld = true;
|
|
|
|
|
protected KShared(Class dummy){}
|
|
|
|
|
protected TDEShared(Class dummy){}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
Standard constructor. This will initialize the reference count
|
|
|
|
|
on this object to 0.
|
|
|
|
|
@short Standard constructor.
|
|
|
|
|
*/
|
|
|
|
|
public KShared() {
|
|
|
|
|
newKShared();
|
|
|
|
|
public TDEShared() {
|
|
|
|
|
newTDEShared();
|
|
|
|
|
}
|
|
|
|
|
private native void newKShared();
|
|
|
|
|
private native void newTDEShared();
|
|
|
|
|
/**
|
|
|
|
|
Copy constructor. This will <b>not</b> actually copy the objects
|
|
|
|
|
but it will initialize the reference count on this object to 0.
|
|
|
|
|
@short Copy constructor.
|
|
|
|
|
*/
|
|
|
|
|
public KShared(KShared arg1) {
|
|
|
|
|
newKShared(arg1);
|
|
|
|
|
public TDEShared(TDEShared arg1) {
|
|
|
|
|
newTDEShared(arg1);
|
|
|
|
|
}
|
|
|
|
|
private native void newKShared(KShared arg1);
|
|
|
|
|
private native void newTDEShared(TDEShared arg1);
|
|
|
|
|
}
|
|
|
|
|