Mercurial > hg > orthanc
comparison OrthancServer/Scheduler/ServerCommandInstance.h @ 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 |
---|---|
55 }; | 55 }; |
56 | 56 |
57 private: | 57 private: |
58 typedef IServerCommand::ListOfStrings ListOfStrings; | 58 typedef IServerCommand::ListOfStrings ListOfStrings; |
59 | 59 |
60 IServerCommand *filter_; | 60 IServerCommand *command_; |
61 std::string jobId_; | 61 std::string jobId_; |
62 ListOfStrings inputs_; | 62 ListOfStrings inputs_; |
63 std::list<ServerCommandInstance*> next_; | 63 std::list<ServerCommandInstance*> next_; |
64 bool connectedToSink_; | |
64 | 65 |
65 bool Execute(IListener& listener); | 66 bool Execute(IListener& listener); |
66 | 67 |
67 public: | 68 public: |
68 ServerCommandInstance(IServerCommand *filter, | 69 ServerCommandInstance(IServerCommand *command, |
69 const std::string& jobId); | 70 const std::string& jobId); |
70 | 71 |
71 virtual ~ServerCommandInstance(); | 72 virtual ~ServerCommandInstance(); |
72 | 73 |
73 const std::string& GetJobId() const | 74 const std::string& GetJobId() const |
74 { | 75 { |
78 void AddInput(const std::string& input) | 79 void AddInput(const std::string& input) |
79 { | 80 { |
80 inputs_.push_back(input); | 81 inputs_.push_back(input); |
81 } | 82 } |
82 | 83 |
83 void ConnectNext(ServerCommandInstance& filter) | 84 void ConnectOutput(ServerCommandInstance& next) |
84 { | 85 { |
85 next_.push_back(&filter); | 86 next_.push_back(&next); |
87 } | |
88 | |
89 void SetConnectedToSink(bool connected = true) | |
90 { | |
91 connectedToSink_ = connected; | |
92 } | |
93 | |
94 bool IsConnectedToSink() const | |
95 { | |
96 return connectedToSink_; | |
86 } | 97 } |
87 | 98 |
88 const std::list<ServerCommandInstance*>& GetNextCommands() const | 99 const std::list<ServerCommandInstance*>& GetNextCommands() const |
89 { | 100 { |
90 return next_; | 101 return next_; |
91 } | 102 } |
92 | |
93 IServerCommand& GetCommand() const | |
94 { | |
95 return *filter_; | |
96 } | |
97 }; | 103 }; |
98 } | 104 } |