summaryrefslogtreecommitdiff
path: root/src/RequestGroupEntry.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-10-11 16:58:24 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-10-11 16:58:24 +0000
commit048a2cf59737f761876e81a77e8d064c45c752d7 (patch)
tree65c9d5498aafe6a8c8e640ddfcc43c7013504d0d /src/RequestGroupEntry.h
parente26bbbb9eee140ba24402fe872a752b42f0077de (diff)
2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only.
Diffstat (limited to 'src/RequestGroupEntry.h')
-rw-r--r--src/RequestGroupEntry.h62
1 files changed, 10 insertions, 52 deletions
diff --git a/src/RequestGroupEntry.h b/src/RequestGroupEntry.h
index 157f3048..812720f7 100644
--- a/src/RequestGroupEntry.h
+++ b/src/RequestGroupEntry.h
@@ -36,74 +36,32 @@
#define _D_REQUEST_GROUP_ENTRY_H_
#include "ProgressAwareEntry.h"
-#include "Request.h"
-#include "RequestGroup.h"
+class RequestGroup;
+class Command;
class DownloadCommand;
-class RequestGroupEntry : public ProgressAwareEntry {
+class RequestGroupEntry {
protected:
- int32_t _cuid;
- RequestHandle _currentRequest;
RequestGroup* _requestGroup;
- DownloadCommand* _nextDownloadCommand;
- bool _shouldAddNumConnection;
+ Command* _nextCommand;
public:
- RequestGroupEntry(int32_t cuid,
- const RequestHandle& currentRequest,
- RequestGroup* requestGroup,
- DownloadCommand* nextDownloadCommand = 0):
- _cuid(cuid),
- _currentRequest(currentRequest),
- _requestGroup(requestGroup),
- _nextDownloadCommand(nextDownloadCommand)
- {
- if(nextDownloadCommand) {
- _shouldAddNumConnection = false;
- } else {
- _shouldAddNumConnection = true;
- ++_requestGroup->numConnection;
- }
- }
+ RequestGroupEntry(RequestGroup* requestGroup,
+ Command* nextCommand = 0);
virtual ~RequestGroupEntry();
- virtual int64_t getTotalLength() const
- {
- return _requestGroup->getTotalLength();
- }
-
- int32_t getCUID() const
- {
- return _cuid;
- }
-
- RequestHandle getCurrentRequest() const
- {
- return _currentRequest;
- }
-
RequestGroup* getRequestGroup() const
{
return _requestGroup;
}
- /*
- void setNextDownloadCommand(DownloadCommand* command)
- {
- _nextDownloadCommand = command;
- }
- */
- DownloadCommand* getNextDownloadCommand() const
- {
- return _nextDownloadCommand;
- }
- DownloadCommand* popNextDownloadCommand()
+ Command* getNextCommand() const
{
- DownloadCommand* temp = _nextDownloadCommand;
- _nextDownloadCommand = 0;
- return temp;
+ return _nextCommand;
}
+
+ Command* popNextCommand();
bool operator==(const RequestGroupEntry& entry) const
{