jigdo API
Last update by Admin on 2010-05-23
job/datasource.hh
Go to the documentation of this file.00001 /* $Id: datasource.hh,v 1.3 2003/08/17 15:37:07 atterer Exp $ -*- C++ -*- 00002 __ _ 00003 |_) /| Copyright (C) 2003 | richard@ 00004 | \/¯| Richard Atterer | atterer.net 00005 ¯ '` ¯ 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License, version 2. See 00008 the file COPYING for details. 00009 00010 */ 00016 #ifndef DATASOURCE_HH 00017 #define DATASOURCE_HH 00018 00019 #include <config.h> 00020 00021 #include <job.hh> 00022 #include <makeimagedl.fh> 00023 #include <nocopy.hh> 00024 #include <progress.fh> 00025 //______________________________________________________________________ 00026 00027 namespace Job { 00028 class DataSource; 00029 } 00030 00037 class Job::DataSource : NoCopy { 00038 public: 00039 00044 class IO : public Job::IO { 00045 public: 00046 00047 // Not overriding here: 00048 // virtual IO* job_removeIo(IO* rmIo); 00049 00052 virtual void job_deleted() = 0; 00053 00055 virtual void job_succeeded() = 0; 00056 00059 virtual void job_failed(const string& message) = 0; 00060 00062 virtual void job_message(const string& message) = 0; 00063 00067 virtual void dataSource_dataSize(uint64 n) = 0; 00068 00073 virtual void dataSource_data(const byte* data, unsigned size, 00074 uint64 currentSize) = 0; 00075 }; 00076 //____________________ 00077 00078 IOSource<IO> io; 00079 00080 DataSource() : io() { }; 00081 virtual ~DataSource() { } 00082 00084 virtual void run() = 0; 00085 00087 virtual bool paused() const = 0; 00089 virtual void pause() = 0; 00091 virtual void cont() = 0; 00092 00094 virtual const Progress* progress() const = 0; 00095 00097 virtual const string& location() const = 0; 00098 }; 00099 00100 #endif
Generated on Tue Sep 23 14:27:41 2008 for jigdo by
