comparison OrthancServer/Scheduler/ServerScheduler.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
comparison
equal deleted inserted replaced
1008:187ed107a59f 1009:26642cecd36d
49 public: 49 public:
50 Sink(ListOfStrings& target) : target_(target) 50 Sink(ListOfStrings& target) : target_(target)
51 { 51 {
52 } 52 }
53 53
54 virtual bool SendOutputsToSink() const
55 {
56 return false;
57 }
58
59 virtual bool Apply(ListOfStrings& outputs, 54 virtual bool Apply(ListOfStrings& outputs,
60 const ListOfStrings& inputs) 55 const ListOfStrings& inputs)
61 { 56 {
62 for (ListOfStrings::const_iterator 57 for (ListOfStrings::const_iterator
63 it = inputs.begin(); it != inputs.end(); it++) 58 it = inputs.begin(); it != inputs.end(); it++)
238 233
239 for (std::list<ServerCommandInstance*>::iterator 234 for (std::list<ServerCommandInstance*>::iterator
240 it = job.filters_.begin(); it != job.filters_.end(); it++) 235 it = job.filters_.begin(); it != job.filters_.end(); it++)
241 { 236 {
242 if ((*it) != &sink && 237 if ((*it) != &sink &&
243 (*it)->GetNextCommands().size() == 0 && 238 (*it)->IsConnectedToSink())
244 (*it)->GetCommand().SendOutputsToSink()) 239 {
245 { 240 (*it)->ConnectOutput(sink);
246 (*it)->ConnectNext(sink);
247 } 241 }
248 } 242 }
249 243
250 // Submit the job 244 // Submit the job
251 SubmitInternal(job, true); 245 SubmitInternal(job, true);