salsa  0.3.0
 All Classes Functions Variables Enumerations Pages
Feeder.hh
1 #pragma once
2 
3 #include <Distributor.hh>
4 #include <TaskInfo.pb.h>
5 
6 namespace Salsa {
15 
16 class Feeder : public Distributor {
17 public:
18  Feeder(std::string uuid, std::shared_ptr<Socket> pPipe, NodeManager * pNM);
19  virtual ~Feeder();
20 
21  // TODO Another one...
22  virtual void onEnter(Message * pInMsg, std::vector<std::string> & out, std::string type);
23  virtual void onExit(Message * pInMsg, std::vector<std::string> & out);
24  virtual void onWhisper(Message * pInMsg, std::vector<std::string> & out);
25 
26  // TODO needs annotation
27  void subscribe(std::string uuid);
28  void removeWorkerTask(TaskInfo * pTI);
29  void removeWorkerTask(TaskInfo * pTI, std::string uuid);
30  void terminateJob(std::string uuid);
31 
32 protected:
33  std::map<std::string, std::vector<TaskInfo *>> mWorkerTasks{};
34 };
35 } // namespace Salsa
Feeder(std::string uuid, std::shared_ptr< Socket > pPipe, NodeManager *pNM)
Definition: Feeder.cc:8
std::map< std::string, std::vector< TaskInfo * > > mWorkerTasks
Worker tasks.
Definition: Feeder.hh:33
Base Message class.
Definition: Message.hh:15
Base Distributor class.
Definition: Distributor.hh:17
virtual void onExit(Message *pInMsg, std::vector< std::string > &out)
Definition: Feeder.cc:34
void terminateJob(std::string uuid)
Definition: Feeder.cc:238
NodeManager class.
Definition: NodeManager.hh:20
virtual ~Feeder()
Definition: Feeder.cc:16
std::string uuid() const
Returns distributor&#39;s UUID.
Definition: Distributor.cc:84
void subscribe(std::string uuid)
Definition: Feeder.cc:194
Base Feeder class.
Definition: Feeder.hh:16
virtual void onEnter(Message *pInMsg, std::vector< std::string > &out, std::string type)
TODO Three horsemen of apocalypse.
Definition: Feeder.cc:23
virtual void onWhisper(Message *pInMsg, std::vector< std::string > &out)
Definition: Feeder.cc:98
void removeWorkerTask(TaskInfo *pTI)
Definition: Feeder.cc:209