From d2cd2d85e7c994fcb88a2aee79c3429b0dbb62c6 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Wed, 5 Dec 2012 20:32:11 +0000
Subject: [PATCH] Task #3696: Improved SampleBuffer interface

---
 RTCP/InputProc/src/SampleBufferReader.h | 29 ++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/RTCP/InputProc/src/SampleBufferReader.h b/RTCP/InputProc/src/SampleBufferReader.h
index 22da273eebc..83db4040d4f 100644
--- a/RTCP/InputProc/src/SampleBufferReader.h
+++ b/RTCP/InputProc/src/SampleBufferReader.h
@@ -31,12 +31,35 @@ protected:
   const TimeStamp from, to;
   const size_t blockSize;
 
+  /* process() will call one of these sequences:
+   *
+   * 1. copyNothing(from, to);
+   *
+   * 2. copyStart(from, to, 0);
+   *    foreach(beamlet)
+   *      copyBeamlet(beamlet, 0, from, .., ..);
+   *    foreach(board)
+   *      copyFlags(board, ..);
+   *    copyEnd();
+   *
+   * 3. copyStart(from, to, ..);
+   *    foreach(beamlet) {
+   *      copyBeamlet(beamlet, 0, from, .., ..);
+   *      copyBeamlet(beamlet, 1, .., .., ..);
+   *    }
+   *    foreach(board)
+   *      copyFlags(board, ..);
+   *    copyEnd();
+   *
+   * Two transfers are needed per beamlet if the requested
+   * range wraps around the end of the buffer.
+   */
+
   virtual void copyNothing( const TimeStamp &from, const TimeStamp &to ) { (void)from, (void)to; }
 
-  virtual void copyBeamlet( unsigned beamlet, unsigned transfer, const TimeStamp &from_ts, const T* from, size_t nrSamples ) = 0;
   virtual void copyStart( const TimeStamp &from, const TimeStamp &to, size_t wrap ) { (void)from, (void)to, (void)wrap; }
-
-  virtual void copyFlags  ( unsigned transfer, const SparseSet<int64> &flags ) = 0;
+  virtual void copyBeamlet( unsigned beamlet, unsigned transfer, const TimeStamp &from_ts, const T* from, size_t nrSamples ) = 0;
+  virtual void copyFlags( unsigned board, const SparseSet<int64> &flags ) = 0;
   virtual void copyEnd() {}
 
   void copy( const TimeStamp &from, const TimeStamp &to );
-- 
GitLab