comparison OrthancServer/Scheduler/ServerScheduler.cpp @ 1000:13e230bbd882 lua-scripting

rename filter to command
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 04 Jul 2014 14:14:14 +0200
parents db18c071fbd7
children 26642cecd36d
comparison
equal deleted inserted replaced
999:db18c071fbd7 1000:13e230bbd882
39 namespace Orthanc 39 namespace Orthanc
40 { 40 {
41 namespace 41 namespace
42 { 42 {
43 // Anonymous namespace to avoid clashes between compilation modules 43 // Anonymous namespace to avoid clashes between compilation modules
44 class Sink : public IServerFilter 44 class Sink : public IServerCommand
45 { 45 {
46 private: 46 private:
47 ListOfStrings& target_; 47 ListOfStrings& target_;
48 48
49 public: 49 public:
141 while (!that->finish_) 141 while (!that->finish_)
142 { 142 {
143 std::auto_ptr<IDynamicObject> object(that->queue_.Dequeue(TIMEOUT)); 143 std::auto_ptr<IDynamicObject> object(that->queue_.Dequeue(TIMEOUT));
144 if (object.get() != NULL) 144 if (object.get() != NULL)
145 { 145 {
146 ServerFilterInstance& filter = dynamic_cast<ServerFilterInstance&>(*object); 146 ServerCommandInstance& filter = dynamic_cast<ServerCommandInstance&>(*object);
147 147
148 // Skip the execution of this filter if its parent job has 148 // Skip the execution of this filter if its parent job has
149 // previously failed. 149 // previously failed.
150 bool jobHasFailed; 150 bool jobHasFailed;
151 { 151 {
232 return true; 232 return true;
233 } 233 }
234 234
235 // Add a sink filter to collect all the results of the filters 235 // Add a sink filter to collect all the results of the filters
236 // that have no next filter. 236 // that have no next filter.
237 ServerFilterInstance& sink = job.AddFilter(new Sink(outputs)); 237 ServerCommandInstance& sink = job.AddCommand(new Sink(outputs));
238 238
239 for (std::list<ServerFilterInstance*>::iterator 239 for (std::list<ServerCommandInstance*>::iterator
240 it = job.filters_.begin(); it != job.filters_.end(); it++) 240 it = job.filters_.begin(); it != job.filters_.end(); it++)
241 { 241 {
242 if ((*it) != &sink && 242 if ((*it) != &sink &&
243 (*it)->GetNextFilters().size() == 0 && 243 (*it)->GetNextCommands().size() == 0 &&
244 (*it)->GetFilter().SendOutputsToSink()) 244 (*it)->GetCommand().SendOutputsToSink())
245 { 245 {
246 (*it)->ConnectNext(sink); 246 (*it)->ConnectNext(sink);
247 } 247 }
248 } 248 }
249 249