comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
Subject: Re: Sequental IO and pointers
Date: Sun, 27 Nov 2005 09:02:53 -0500
Date: 2005-11-27T09:02:53-05:00	[thread overview]
Message-ID: <uek52mbn6.fsf@acm.org> (raw)
In-Reply-To: 1133054249.548646.294110@g44g2000cwa.googlegroups.com

ejijott@gmail.com writes:

> pastebin snippet at http://pastebin.com/439265

For code this short, it is better to include it in the post, rather
than putting on a website; that makes it easier to refer to in replies.

> I've posted before in this group and I would just like to say thanks
> for all the help im getting :)

You're welcome - gratitude is appreciated :).

> Can I actually export my Storage/Node types as defined in my code
> snippet? 

Well, you can, but importing won't make sense; the pointers will not
be valid.

> Or would I have to add another type which is used to export only the
> item, len and count variables and then when importing my data I feed
> this in to my variable of type Storage?

You don't need another type, just modify Save to not output the
pointer. 

Then in Restore (which you don't show), you need to rebuild the linked
data structure. That is the hard part; how does Restore know what
objects are linked? Typically Save must output some object ID, which
is _not_ the pointer.

-- 
-- Stephe



  parent reply	other threads:[~2005-11-27 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-27  1:17 Sequental IO and pointers ejijott
2005-11-27  1:19 ` ejijott
2005-11-27 14:02 ` Stephen Leake [this message]
2005-11-27 18:10   ` ejijott
2005-11-27 18:54     ` ejijott
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox