diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-23 21:55:52 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-23 21:55:52 +0900 |
| commit | fa9f3fb5a3c8912a0a6880ffba9c72f4424ea044 (patch) | |
| tree | deb0b47b085a3a689bf386409734bfd3f72f57d2 /src/RequestGroupEntry.h | |
| parent | bb5b7eeedb3ce7396007818cbab4f5f5660997a5 (diff) | |
Wrap Command object in std::unique_ptr
Diffstat (limited to 'src/RequestGroupEntry.h')
| -rw-r--r-- | src/RequestGroupEntry.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/RequestGroupEntry.h b/src/RequestGroupEntry.h index fedd41d5..eb151461 100644 --- a/src/RequestGroupEntry.h +++ b/src/RequestGroupEntry.h @@ -37,6 +37,8 @@ #include "common.h" +#include <memory> + namespace aria2 { class RequestGroup; @@ -45,10 +47,11 @@ class Command; class RequestGroupEntry { private: RequestGroup* requestGroup_; - Command* nextCommand_; + std::unique_ptr<Command> nextCommand_; public: RequestGroupEntry(RequestGroup* requestGroup, - Command* nextCommand = 0); + std::unique_ptr<Command> nextCommand = + std::unique_ptr<Command>()); virtual ~RequestGroupEntry(); @@ -59,12 +62,12 @@ public: Command* getNextCommand() const { - return nextCommand_; + return nextCommand_.get(); } - Command* popNextCommand(); + std::unique_ptr<Command> popNextCommand(); - void pushNextCommand(Command* nextCommand); + void pushNextCommand(std::unique_ptr<Command> nextCommand); bool operator==(const RequestGroupEntry& entry) const { |
