summaryrefslogtreecommitdiff
path: root/lib/common/ReadLoggingStream.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-08-21 10:41:18 +0000
committerChris Wilson <chris+github@qwirx.com>2008-08-21 10:41:18 +0000
commit2019b57dcbba43e8b3feba9385aec4a25bfa55b2 (patch)
treea669d280e5a15a760f70e4a707b0dbdf03c79dcb /lib/common/ReadLoggingStream.h
parentaad61cfb4d89c65cafc698da5aa1b6b06a5a232c (diff)
Pass a RunStatusProvider and a ReadLoggingStream::Logger from
BackupDaemon through BackupClientDirectoryRecord, BackupStoreFile and BackupStoreFileEncodeStream to ReadLoggingStream, to allow progress callbacks during file upload and cancelling upload part-way. Implement ReadLoggingStream::Logger in BackupClientDirectoryRecord::SyncParams, which thunks the notifications back to the ProgressNotifier. Add the SysadminNotifier interface from Boxi. Add NotifyIDMapsSetup() to ProgressNotifier. Change BackupClientDirectoryRecord::SyncParams to store references to the individual callback interfaces rather than BackupDaemon. Initialise all members in BackupDaemon. Add ability for BackupDaemon user to override the ProgressNotifier, LocationResolver, SysadminNotifier and RunStatusProvider that will be used during the backup. Make BackupDaemon::Location class public and provide access to the configured locations for Boxi (dangerous, they could be modified without BackupDaemon knowing it).
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