From 07d270c87e6f9184aea4ca17eb26e466712e8db2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 22 Jun 2013 01:10:38 +0900 Subject: Require -std=c++11 and use std::shared_ptr instead of SharedHandle --- src/DownloadEngineFactory.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/DownloadEngineFactory.cc') diff --git a/src/DownloadEngineFactory.cc b/src/DownloadEngineFactory.cc index 164b1b15..8c7ace30 100644 --- a/src/DownloadEngineFactory.cc +++ b/src/DownloadEngineFactory.cc @@ -84,17 +84,17 @@ namespace aria2 { DownloadEngineFactory::DownloadEngineFactory() {} -SharedHandle +std::shared_ptr DownloadEngineFactory::newDownloadEngine -(Option* op, const std::vector >& requestGroups) +(Option* op, const std::vector >& requestGroups) { const size_t MAX_CONCURRENT_DOWNLOADS = op->getAsInt(PREF_MAX_CONCURRENT_DOWNLOADS); - SharedHandle eventPoll; + std::shared_ptr eventPoll; const std::string& pollMethod = op->get(PREF_EVENT_POLL); #ifdef HAVE_LIBUV if (pollMethod == V_LIBUV) { - SharedHandle ep(new LibuvEventPoll()); + std::shared_ptr ep(new LibuvEventPoll()); if (!ep->good()) { throw DL_ABORT_EX("Initializing LibuvEventPoll failed." " Try --event-poll=select"); @@ -105,7 +105,7 @@ DownloadEngineFactory::newDownloadEngine #endif // HAVE_LIBUV #ifdef HAVE_EPOLL if(pollMethod == V_EPOLL) { - SharedHandle ep(new EpollEventPoll()); + std::shared_ptr ep(new EpollEventPoll()); if(ep->good()) { eventPoll = ep; } else { @@ -116,7 +116,7 @@ DownloadEngineFactory::newDownloadEngine #endif // HAVE_EPLL #ifdef HAVE_KQUEUE if(pollMethod == V_KQUEUE) { - SharedHandle kp(new KqueueEventPoll()); + std::shared_ptr kp(new KqueueEventPoll()); if(kp->good()) { eventPoll = kp; } else { @@ -127,7 +127,7 @@ DownloadEngineFactory::newDownloadEngine #endif // HAVE_KQUEUE #ifdef HAVE_PORT_ASSOCIATE if(pollMethod == V_PORT) { - SharedHandle pp(new PortEventPoll()); + std::shared_ptr pp(new PortEventPoll()); if(pp->good()) { eventPoll = pp; } else { @@ -146,19 +146,19 @@ DownloadEngineFactory::newDownloadEngine } else { abort(); } - SharedHandle e(new DownloadEngine(eventPoll)); + std::shared_ptr e(new DownloadEngine(eventPoll)); e->setOption(op); - SharedHandle + std::shared_ptr requestGroupMan(new RequestGroupMan(requestGroups, MAX_CONCURRENT_DOWNLOADS, op)); requestGroupMan->initWrDiskCache(); e->setRequestGroupMan(requestGroupMan); e->setFileAllocationMan - (SharedHandle(new FileAllocationMan())); + (std::shared_ptr(new FileAllocationMan())); #ifdef ENABLE_MESSAGE_DIGEST e->setCheckIntegrityMan - (SharedHandle(new CheckIntegrityMan())); + (std::shared_ptr(new CheckIntegrityMan())); #endif // ENABLE_MESSAGE_DIGEST e->addRoutineCommand(new FillRequestGroupCommand(e->newCUID(), e.get())); e->addRoutineCommand(new FileAllocationDispatcherCommand -- cgit