obj = nelson.lang.HandlePlaceholder()
| Parameter | Description |
|---|---|
| obj | a scalar handle object. |
nelson.lang.HandlePlaceholder is a concrete handle class used when an API must return a handle object but no live target is available.
A placeholder object created with the constructor is a normal valid handle until it is deleted.
Weak references with no assigned target return an invalid handle whose class is nelson.lang.HandlePlaceholder.
The class does not define user properties or methods beyond the common handle operations.
Use this class as a neutral handle class when the original target class is unknown or not relevant.
A constructed placeholder object and an invalid placeholder handle are different values. The constructed object is valid until deleted; an invalid placeholder handle is never valid.
Placeholder handles can be checked with isvalid, compared by class name with class, and used anywhere a generic handle placeholder is appropriate.
The class is intentionally empty. It is not a container for user data.
p = nelson.lang.HandlePlaceholder();
class(p)
isvalid(p)
delete(p)
isvalid(p)
w = nelson.lang.WeakReference();
h = w.Handle;
class(h)
isvalid(h)
p = nelson.lang.HandlePlaceholder();
q = nelson.lang.invalidHandle('nelson.lang.HandlePlaceholder');
class(p)
class(q)
isvalid(p)
isvalid(q)
| Version | Description |
|---|---|
| 2.0.0 | initial version |