[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Keyed Archiver and partial information retrieval
From: |
Uli Kusterer |
Subject: |
Re: Keyed Archiver and partial information retrieval |
Date: |
Wed, 11 Feb 2004 20:30:45 +0100 |
User-agent: |
MT-NewsWatcher/3.3b1 (PPC Mac OS X) |
In article <mailman.2054.1076168530.928.discuss-gnustep@gnu.org>,
Stefan Urbanek <stefan@agentfarms.net> wrote:
> In AgentFarms I would like to store simulation state and several other
> objects like collections of data in archive. Simulation state can be quite
> big (all simulated objects are stored), also the collected data can be large.
> There are situations, where i would like to 'peek' into the stored simulation
> to get essential information about saved state, like simulation time, model
> used, 'thumbnail' of the state, etc...
This sounds like a job for a nice block file format. Have you looked
into IFF files? IFFs basically define how to indicate the start and end
of a block of data in your file. You write them out in their entirety
(and it should be manageable to append to them, I guess), but you can
read them in on a per-block basis.
I'm also working on a more general-purpose block-file format called
"Earthquake" right now (in plain C, but I also have a basically working
ObjC wrapper), which might be useful to you. But IFF is a much simpler
format, so if that fits your bill, you'd definitely want that.
Earthquake right now stores blocks with associated ID numbers in a file
and lets you retrieve them, write to them or resize them, automatically
taking care of moving them arround and keeping track of wasted space as
needed.
So, you could simply serialize your objects to NSData grouped by how you
think you'll want to be reading back in, and then write each such NSData
to a block of the block file.
Just a thought,
-- Uli
http://www.zathras.de