[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flexifiles

From: Ben Pfaff
Subject: Re: Flexifiles
Date: Thu, 29 Jun 2006 15:48:43 -0700
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Oops, I missed this email, hence the confused question earlier.

John Darrington <address@hidden> writes:

> 1. struct casefile is now an abstract data type.
> 2. struct fastfile is a derivation of struct casefile. struct
>    flexifile will be another.
> 3. I'm thinking that the methods casefile_sleep, casefile_in_core and
>    casefile_to_disk will be optional.  Concrete casefiles may choose
>    to implement them or not, since they're there only for optimisation
>    purposes. 

Yes, I agree.  I would suggest that casefile_sleep and
casefile_to_disk be implemented as

    casefile_sleep (const struct casefile *cf)
      return cf->sleep ? cf->sleep(cf) : true;

so that they can just be null pointers in implementations.

casefile_in_core should return either a constant false or true
for casefiles that don't implement it, but the actual return
value should depend on the implementation in question, so it
should probably not be stubbed out this way.

> 4. I'm not too sure what to do about casefile_mode_reader.  This is
>    only called from one place (in scratch-writer.c) and I'm not sure
>    that it's really necessary.  It doesn't seem to belong in the base
>    class anyway.  Perhaps it can disappear from the public interface
>    altogether. 

It can disappear, that's fine.  It was just there to assist
assertions, really.

> 5. casefile_get_random_reader will no longer be necessary once this
>    exercise is complete.

Ben Pfaff 
email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]