([Encoder -_objectWillBeInProgress:]): New method.
([Encoder -_objectNoLongerInProgress:]): New method. Depending on
whether we are doing GNU or OpenStep style forward references one of
these two methods will create a backward reference to the object by
calling -_coderInternalCreateReferenceForObject:. This will effect
whether encoding make forward or backward references to objects in
progress. GNU uses forward references, which is robust even when the
object's -initWithCoder substitutes another object for self.
([Encoder -_encodeObject:withName:isBycopy:isForwardReference:]): Use
new methods. Don't call -_coderInternalCreateReferenceForObject here,
let one of the ...InProgress methods do it.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1481 72102866-910b-0410-8b05-ffd578937521
if object satisfies a forward reference *after* encoding it. This is
necessary because the encoding of subobjects may generate forward
references. (In a sense, this undoes the last change, but it is
significantly different in that we test whether the object is in the
object_2_fref table *after* encoding the object; before we looked in
the table before encoding the object.) As a consequence,
the CODER_OBJECT_FORWARD_SATISFIER tag is no longer necessary; this
was used to tag an object before it was encoded, but now we understand
that we cannot know whether this object satisfies a forward reference
until after it has been encoded. Thus, for all objects we encode an
unsigned int after encoding the object itself. This unsigned int is
either the forward reference number of zero, depending on whether this
object satisfies any forward references.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1358 72102866-910b-0410-8b05-ffd578937521
this object satisfies a forward reference, remove it from the
object_2_fref table before encoding the object, since, in the process
of encoding the object, we may generate more references to this
object, and we don't want to interpret this as another forward
reference satisfier; previously an object could get encoded as a
forward reference satisfier more than once.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1355 72102866-910b-0410-8b05-ffd578937521
:cStreamFormatVersion:]): Initialize new ivar.
([Encoder -_coderCreateForwardReferenceForObject:]): Use new ivar to
`gensym' a new forward reference.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1351 72102866-910b-0410-8b05-ffd578937521
object_2_xref, not const_ptr_2_xref.
([Encoder -_encodeObject:withName:isBycopy:isForwardReference:]):
Create the in_progress_table with NSNonOwnedPointerMapKeyCallBacks,
not NSObject..; needed by distributed objects so we don't get infinite
loop with proxy objects.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1059 72102866-910b-0410-8b05-ffd578937521