Mercurial > hg > orthanc
diff OrthancServer/Scheduler/ServerJob.cpp @ 1009:26642cecd36d lua-scripting
clearer job interface
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Jul 2014 16:11:44 +0200 |
parents | 13e230bbd882 |
children | 6e7e5ed91c2d |
line wrap: on
line diff
--- a/OrthancServer/Scheduler/ServerJob.cpp Tue Jul 08 18:14:24 2014 +0200 +++ b/OrthancServer/Scheduler/ServerJob.cpp Wed Jul 09 16:11:44 2014 +0200 @@ -109,6 +109,12 @@ { delete *it; } + + for (std::list<IDynamicObject*>::iterator + it = payloads_.begin(); it != payloads_.end(); it++) + { + delete *it; + } } @@ -123,4 +129,18 @@ return *filters_.back(); } + + + IDynamicObject& ServerJob::AddPayload(IDynamicObject* payload) + { + if (submitted_) + { + throw OrthancException(ErrorCode_BadSequenceOfCalls); + } + + payloads_.push_back(payload); + + return *filters_.back(); + } + }