summaryrefslogtreecommitdiff
path: root/lib/common/ReadLoggingStream.h
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2009-04-02 14:02:56 +0200
committerReinhard Tartler <siretart@tauware.de>2009-04-02 14:02:56 +0200
commit76089c3bb5b915241da6d2f8f8c34eb65a78be95 (patch)
tree6b9524a5277ab57762cb01e9ea14131401c44ef5 /lib/common/ReadLoggingStream.h
parent76af1c5e724dc558506be411e85a21122aef840d (diff)
parenta84d45498bd861c9225080232948a99c2e317bb8 (diff)
merge new upstream version
Diffstat (limited to 'lib/common/ReadLoggingStream.h')
-rw-r--r--lib/common/ReadLoggingStream.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/common/ReadLoggingStream.h b/lib/common/ReadLoggingStream.h
index 15c3ef48..b23b542c 100644
--- a/lib/common/ReadLoggingStream.h
+++ b/lib/common/ReadLoggingStream.h
@@ -15,13 +15,27 @@
class ReadLoggingStream : public IOStream
{
+public:
+ class Logger
+ {
+ public:
+ virtual ~Logger() { }
+ virtual void Log(int64_t readSize, int64_t offset,
+ int64_t length, box_time_t elapsed,
+ box_time_t finish) = 0;
+ virtual void Log(int64_t readSize, int64_t offset,
+ int64_t length) = 0;
+ virtual void Log(int64_t readSize, int64_t offset) = 0;
+ };
+
private:
IOStream& mrSource;
IOStream::pos_type mOffset, mLength, mTotalRead;
box_time_t mStartTime;
+ Logger& mrLogger;
public:
- ReadLoggingStream(IOStream& rSource);
+ ReadLoggingStream(IOStream& rSource, Logger& rLogger);
virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite);
virtual pos_type BytesLeftToRead();
@@ -35,7 +49,8 @@ public:
private:
ReadLoggingStream(const ReadLoggingStream &rToCopy)
- : mrSource(rToCopy.mrSource) { /* do not call */ }
+ : mrSource(rToCopy.mrSource), mrLogger(rToCopy.mrLogger)
+ { /* do not call */ }
};
#endif // READLOGGINGSTREAM__H