2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Removed SegmentManFactory class.
	* src/AbstractSegmentManFactory.h
	* src/DefaultSegmentManFactory.cc
	* src/DefaultSegmentManFactory.h
	* src/Makefile.am
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/SegmentManFactory.h
pull/1/head
Tatsuhiro Tsujikawa 2010-02-11 11:42:20 +00:00
parent 4354c674ab
commit 1a04d2913e
9 changed files with 18 additions and 253 deletions

View File

@ -1,3 +1,14 @@
2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed SegmentManFactory class.
* src/AbstractSegmentManFactory.h
* src/DefaultSegmentManFactory.cc
* src/DefaultSegmentManFactory.h
* src/Makefile.am
* src/RequestGroup.cc
* src/RequestGroup.h
* src/SegmentManFactory.h
2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Destroyed digest context after getting calculated hash.

View File

@ -1,57 +0,0 @@
/* <!-- copyright */
/*
* aria2 - The high speed download utility
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
/* copyright --> */
#ifndef _D_ABSTRACT_SEGMENT_MAN_FACTORY_H_
#define _D_ABSTRACT_SEGMENT_MAN_FACTORY_H_
#include "SegmentManFactory.h"
namespace aria2 {
class Option;
class AbstractSegmentManFactory : public SegmentManFactory {
protected:
const Option* _option;
public:
AbstractSegmentManFactory(const Option* option):_option(option) {}
virtual ~AbstractSegmentManFactory() {}
};
typedef SharedHandle<AbstractSegmentManFactory> AbstractSegmentManFactoryHandle;
} // namespace aria2
#endif // _D_ABSTRACT_SEGMENT_MAN_FACTORY_H_

View File

@ -1,53 +0,0 @@
/* <!-- copyright */
/*
* aria2 - The high speed download utility
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
/* copyright --> */
#include "DefaultSegmentManFactory.h"
#include "DownloadContext.h"
#include "PieceStorage.h"
#include "DefaultDiskWriter.h"
#include "SegmentMan.h"
#include "prefs.h"
namespace aria2 {
SegmentManHandle
DefaultSegmentManFactory::createNewInstance
(const SharedHandle<DownloadContext>& dctx,
const PieceStorageHandle& ps)
{
SegmentManHandle segmentMan(new SegmentMan(_option, dctx, ps));
return segmentMan;
}
} // namespace aria2

View File

@ -1,57 +0,0 @@
/* <!-- copyright */
/*
* aria2 - The high speed download utility
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
/* copyright --> */
#ifndef _D_DEFAULT_SEGMENT_MAN_FACTORY_H_
#define _D_DEFAULT_SEGMENT_MAN_FACTORY_H_
#include "AbstractSegmentManFactory.h"
namespace aria2 {
class DefaultSegmentManFactory : public AbstractSegmentManFactory {
public:
DefaultSegmentManFactory(const Option* option):AbstractSegmentManFactory(option) {}
virtual ~DefaultSegmentManFactory() {}
virtual SharedHandle<SegmentMan>
createNewInstance(const SharedHandle<DownloadContext>& dc,
const SharedHandle<PieceStorage>& ps);
};
typedef SharedHandle<DefaultSegmentManFactory> DefaultSegmentManFactoryHandle;
} // namespace aria2
#endif // _D_DEFAULT_SEGMENT_MAN_FACTORY_H_

View File

@ -90,9 +90,6 @@ SRCS = Socket.h\
StreamFileAllocationEntry.cc StreamFileAllocationEntry.h\
MultiUrlRequestInfo.cc MultiUrlRequestInfo.h\
UriListParser.cc UriListParser.h\
SegmentManFactory.h\
AbstractSegmentManFactory.h\
DefaultSegmentManFactory.cc DefaultSegmentManFactory.h\
RealtimeCommand.cc RealtimeCommand.h\
ProgressAwareEntry.h\
RequestGroupEntry.cc RequestGroupEntry.h\

View File

@ -358,8 +358,6 @@ am__libaria2c_a_SOURCES_DIST = Socket.h SocketCore.cc SocketCore.h \
FileAllocationEntry.h StreamFileAllocationEntry.cc \
StreamFileAllocationEntry.h MultiUrlRequestInfo.cc \
MultiUrlRequestInfo.h UriListParser.cc UriListParser.h \
SegmentManFactory.h AbstractSegmentManFactory.h \
DefaultSegmentManFactory.cc DefaultSegmentManFactory.h \
RealtimeCommand.cc RealtimeCommand.h ProgressAwareEntry.h \
RequestGroupEntry.cc RequestGroupEntry.h Cookie.cc Cookie.h \
CookieParser.cc CookieParser.h HttpHeaderProcessor.cc \
@ -795,11 +793,11 @@ am__objects_27 = SocketCore.$(OBJEXT) Command.$(OBJEXT) \
FileAllocationEntry.$(OBJEXT) \
StreamFileAllocationEntry.$(OBJEXT) \
MultiUrlRequestInfo.$(OBJEXT) UriListParser.$(OBJEXT) \
DefaultSegmentManFactory.$(OBJEXT) RealtimeCommand.$(OBJEXT) \
RequestGroupEntry.$(OBJEXT) Cookie.$(OBJEXT) \
CookieParser.$(OBJEXT) HttpHeaderProcessor.$(OBJEXT) \
FileEntry.$(OBJEXT) Platform.$(OBJEXT) \
PStringSegment.$(OBJEXT) PStringBuildVisitor.$(OBJEXT) \
RealtimeCommand.$(OBJEXT) RequestGroupEntry.$(OBJEXT) \
Cookie.$(OBJEXT) CookieParser.$(OBJEXT) \
HttpHeaderProcessor.$(OBJEXT) FileEntry.$(OBJEXT) \
Platform.$(OBJEXT) PStringSegment.$(OBJEXT) \
PStringBuildVisitor.$(OBJEXT) \
ParameterizedStringParser.$(OBJEXT) TimeBasedCommand.$(OBJEXT) \
AutoSaveCommand.$(OBJEXT) DefaultPieceStorage.$(OBJEXT) \
UnknownLengthPieceStorage.$(OBJEXT) PieceStatMan.$(OBJEXT) \
@ -1106,8 +1104,6 @@ SRCS = Socket.h SocketCore.cc SocketCore.h BinaryStream.h Command.cc \
FileAllocationEntry.h StreamFileAllocationEntry.cc \
StreamFileAllocationEntry.h MultiUrlRequestInfo.cc \
MultiUrlRequestInfo.h UriListParser.cc UriListParser.h \
SegmentManFactory.h AbstractSegmentManFactory.h \
DefaultSegmentManFactory.cc DefaultSegmentManFactory.h \
RealtimeCommand.cc RealtimeCommand.h ProgressAwareEntry.h \
RequestGroupEntry.cc RequestGroupEntry.h Cookie.cc Cookie.h \
CookieParser.cc CookieParser.h HttpHeaderProcessor.cc \
@ -1406,7 +1402,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DefaultExtensionMessageFactory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DefaultPeerStorage.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DefaultPieceStorage.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DefaultSegmentManFactory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DirectDiskAdaptor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DiskAdaptor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DownloadCommand.Po@am__quote@

View File

@ -39,7 +39,6 @@
#include "PostDownloadHandler.h"
#include "DownloadEngine.h"
#include "DefaultSegmentManFactory.h"
#include "SegmentMan.h"
#include "NullProgressInfoFile.h"
#include "Dependency.h"
@ -119,7 +118,6 @@ RequestGroup::RequestGroup(const SharedHandle<Option>& option):
_numConcurrentCommand(option->getAsInt(PREF_SPLIT)),
_numStreamConnection(0),
_numCommand(0),
_segmentManFactory(new DefaultSegmentManFactory(_option.get())),
_saveControlFile(true),
_progressInfoFile(new NullProgressInfoFile()),
_preLocalFileCheckEnabled(true),
@ -491,8 +489,8 @@ void RequestGroup::initPieceStorage()
tempPieceStorage = ps;
}
tempPieceStorage->initStorage();
SharedHandle<SegmentMan> tempSegmentMan =
_segmentManFactory->createNewInstance(_downloadContext, tempPieceStorage);
SharedHandle<SegmentMan> tempSegmentMan
(new SegmentMan(_option.get(), _downloadContext, tempPieceStorage));
_pieceStorage = tempPieceStorage;
_segmentMan = tempSegmentMan;
@ -894,11 +892,6 @@ bool RequestGroup::isDependencyResolved()
return _dependency->resolve();
}
void RequestGroup::setSegmentManFactory(const SegmentManFactoryHandle& segmentManFactory)
{
_segmentManFactory = segmentManFactory;
}
void RequestGroup::dependsOn(const DependencyHandle& dep)
{
_dependency = dep;

View File

@ -51,7 +51,6 @@ namespace aria2 {
class DownloadEngine;
class SegmentMan;
class SegmentManFactory;
class Command;
class DownloadCommand;
class DownloadContext;
@ -97,7 +96,6 @@ private:
unsigned int _numCommand;
SharedHandle<SegmentMan> _segmentMan;
SharedHandle<SegmentManFactory> _segmentManFactory;
SharedHandle<DownloadContext> _downloadContext;
@ -228,8 +226,6 @@ public:
void validateTotalLength(uint64_t actualTotalLength) const;
void setSegmentManFactory(const SharedHandle<SegmentManFactory>& segmentManFactory);
void setNumConcurrentCommand(unsigned int num)
{
_numConcurrentCommand = num;

View File

@ -1,60 +0,0 @@
/* <!-- copyright */
/*
* aria2 - The high speed download utility
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
/* copyright --> */
#ifndef _D_SEGMENT_MAN_FACTORY_H_
#define _D_SEGMENT_MAN_FACTORY_H_
#include "common.h"
#include "SharedHandle.h"
namespace aria2 {
class SegmentMan;
class DownloadContext;
class PieceStorage;
class SegmentManFactory {
public:
virtual ~SegmentManFactory() {}
virtual SharedHandle<SegmentMan>
createNewInstance(const SharedHandle<DownloadContext>& dc,
const SharedHandle<PieceStorage>& ps) = 0;
};
typedef SharedHandle<SegmentManFactory> SegmentManFactoryHandle;
} // namespace aria2
#endif // _D_SEGMENT_MAN_FACTORY_H_