diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-22 01:10:38 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-22 01:10:38 +0900 |
| commit | 07d270c87e6f9184aea4ca17eb26e466712e8db2 (patch) | |
| tree | 2dfbaa2e0d2ad0f38cb73098608f7d67a64320f8 /src/DownloadEngineFactory.cc | |
| parent | 126a4bde612eb0e6c48cf2f13ebe3eac45cc71a8 (diff) | |
Require -std=c++11 and use std::shared_ptr instead of SharedHandle
Diffstat (limited to 'src/DownloadEngineFactory.cc')
| -rw-r--r-- | src/DownloadEngineFactory.cc | 22 |
1 files changed, 11 insertions, 11 deletions
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<DownloadEngine> +std::shared_ptr<DownloadEngine> DownloadEngineFactory::newDownloadEngine -(Option* op, const std::vector<SharedHandle<RequestGroup> >& requestGroups) +(Option* op, const std::vector<std::shared_ptr<RequestGroup> >& requestGroups) { const size_t MAX_CONCURRENT_DOWNLOADS = op->getAsInt(PREF_MAX_CONCURRENT_DOWNLOADS); - SharedHandle<EventPoll> eventPoll; + std::shared_ptr<EventPoll> eventPoll; const std::string& pollMethod = op->get(PREF_EVENT_POLL); #ifdef HAVE_LIBUV if (pollMethod == V_LIBUV) { - SharedHandle<LibuvEventPoll> ep(new LibuvEventPoll()); + std::shared_ptr<LibuvEventPoll> 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<EpollEventPoll> ep(new EpollEventPoll()); + std::shared_ptr<EpollEventPoll> 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<KqueueEventPoll> kp(new KqueueEventPoll()); + std::shared_ptr<KqueueEventPoll> 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<PortEventPoll> pp(new PortEventPoll()); + std::shared_ptr<PortEventPoll> pp(new PortEventPoll()); if(pp->good()) { eventPoll = pp; } else { @@ -146,19 +146,19 @@ DownloadEngineFactory::newDownloadEngine } else { abort(); } - SharedHandle<DownloadEngine> e(new DownloadEngine(eventPoll)); + std::shared_ptr<DownloadEngine> e(new DownloadEngine(eventPoll)); e->setOption(op); - SharedHandle<RequestGroupMan> + std::shared_ptr<RequestGroupMan> requestGroupMan(new RequestGroupMan(requestGroups, MAX_CONCURRENT_DOWNLOADS, op)); requestGroupMan->initWrDiskCache(); e->setRequestGroupMan(requestGroupMan); e->setFileAllocationMan - (SharedHandle<FileAllocationMan>(new FileAllocationMan())); + (std::shared_ptr<FileAllocationMan>(new FileAllocationMan())); #ifdef ENABLE_MESSAGE_DIGEST e->setCheckIntegrityMan - (SharedHandle<CheckIntegrityMan>(new CheckIntegrityMan())); + (std::shared_ptr<CheckIntegrityMan>(new CheckIntegrityMan())); #endif // ENABLE_MESSAGE_DIGEST e->addRoutineCommand(new FillRequestGroupCommand(e->newCUID(), e.get())); e->addRoutineCommand(new FileAllocationDispatcherCommand |
