tom.State
only provides the isProxy
method, which
allows one to discern between proxy and non-proxy objects.
boolean isProxy;
tom.State replacementForPortCoder PortEncoder coder;
coder
instead of the
receiving object. This method is repeatedly invoked until an object
returns self
. The default implementation retrieves a proxy from the
coder
's connection
.
Connection connection;
Connection
to which we belong.
int identity;
connection
.
id initWithConnection Connection c identity int ident;
Connection proxy_connection;
int proxy_identity;
tom.State replacementForPortCoder PortEncoder coder;
self
, since we know how to be sent over the wire.
void encodeUsingCoder tom.Encoder coder;
coder
encode us as a proxy; otherwise fail (which is the
case when archiving instead of wiring).
public _builtin_.Any original;
id initWithConnection Connection c identity int i for tom.All object;
redeclare ConnectedConnection connection;
connection
is connected.
boolean isProxy;
tom.InvocationResult forwardSelector selector sel arguments pointer args;
Proxy
.
void dealloc;
connection
from our death. This messages the
Connection
class, since messaging objects from dealloc
methods is
not allowed. We identify ourselves by our identity
since passing
around a dead object (which we are) is asking for trouble.
NonProxy
are never proxies. They
always send a copy over the wire.
id (self) replacementForPortCoder PortEncoder c;
self
as we do not want to be proxied.
id replacementForPortCoder PortEncoder c;
tom.Collection
, through its inheritance of
NonProxy
returns self
when asked its replacementForPortCoder
.
However, a tom.MutableCollection
must be proxied for maintaining the
right semantics. Hence, we redirect the method to our direct (though
repeated) superclass, tom.State
.