ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
MyToolZMQMultiThread.h
Go to the documentation of this file.
1 #ifndef MYTOOLZMQMultiThread_H
2 #define MYTOOLZMQMultiThread_H
3 
4 #include <string>
5 #include <iostream>
6 
7 #include "Tool.h"
8 
22 
25 
26 };
27 
37 class MyToolZMQMultiThread: public Tool {
38 
39 
40  public:
41 
43  bool Initialise(std::string configfile,DataModel &data);
44  bool Execute();
45  bool Finalise();
46 
47 
48  private:
49 
50  static void Thread(Thread_args* arg);
52  std::vector<MyToolZMQMultiThread_args*> args;
53 
54  zmq::pollitem_t items[2];
55  zmq::socket_t* ManagerSend;
56  zmq::socket_t* ManagerReceive;
57 
59 
60 };
61 
62 
63 #endif
bool Initialise(std::string configfile, DataModel &data)
Initialise Function for setting up Tool resorces.
bool Execute()
Executre function used to perform Tool perpose.
int m_freethreads
Keeps track of free threads.
zmq::socket_t * ManagerSend
Socket to send information to threads.
Utilities * m_util
Pointer to utilities class to help with threading.
bool Finalise()
Finalise funciton used to clean up resorces.
zmq::socket_t * ManagerReceive
Socket to receive information form threads.
static void Thread(Thread_args *arg)
Function to be run by the thread in a loop. Make sure not to block in it.
zmq::pollitem_t items[2]
This is used to both inform the poll and store its output. Allows for multitasking sockets...
std::vector< MyToolZMQMultiThread_args * > args
Vector of thread args (also holds pointers to the threads)
MyToolZMQMultiThread()
Simple constructor.