views:

350

answers:

2

My main purpose is to have a generic data buffer that I can use for transfers.

I'm thinking of something along the lines of what XCopy did.

Is there something already made out there or a good example one can follow?

+2  A: 

The Tomes of Delphi by Julian Bucknall describes code for circular buffers, the code of which is freely available as a download. I haven't got the book to hand at the moment, so I can't tell you exactly where to look (though I think it might have had something to do with carrying out data compression with a sliding window).

RobS
The sources that you mean can be downloaded here: http://www.boyet.com/Code/ToDADS_source.zip. It looks like you can get the book for $28 here: http://www.lulu.com/content/435417
Wouter van Nifterick
I should add that the book is worth every cent/penny.
RobS
+3  A: 

This is not meant to be a JFGI-response, but I usually find Google CodeSearch very useful when I'm looking for code examples:

http://www.google.com/codesearch?as_q=circular+buffer&as_lang=pascal

It came up with the following:

A search through my lib folder came up with the following:

  • TurboPower AsyncPro has a circular buffer in AxTerm.pas
  • unitStreamTextReader.pas from Colin Wilson's Delphi Components for Delphi 2009 has a circular buffer class
Wouter van Nifterick
+1 for the "teach a man to fish" metaphor analogy instead of just turning the results over.
François
@Wouter: you just gave me a DUH moment... I use Google Search all the time for trivial and non trivial stuff, why the heck didn't I use Google Code to search for stuff, ARGHHHH. Well thanks anywho...
Gustavo Carreno