ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
MyToolMultiThread.h
Go to the documentation of this file.
1 #ifndef MYTOOLMultiThread_H
2 #define MYTOOLMultiThread_H
3 
4 #include <string>
5 #include <iostream>
6 
7 #include "Tool.h"
8 
20 
23  bool busy;
24  std::string message;
25 
26 };
27 
38 class MyToolMultiThread: public Tool {
39 
40 
41  public:
42 
44  bool Initialise(std::string configfile,DataModel &data);
45  bool Execute();
46  bool Finalise();
47 
48 
49  private:
50 
51  static void Thread(Thread_args* arg);
53  std::vector<MyToolMultiThread_args*> args;
54 
56 
57 };
58 
59 
60 #endif
static void Thread(Thread_args *arg)
Function to be run by the thread in a loop. Make sure not to block in it.
int m_freethreads
Keeps track of free threads.
std::vector< MyToolMultiThread_args * > args
Vector of thread args (also holds pointers to the threads)
MyToolMultiThread()
Simple constructor.
bool Finalise()
Finalise funciton used to clean up resorces.
bool Initialise(std::string configfile, DataModel &data)
Initialise Function for setting up Tool resorces.
Utilities * m_util
Pointer to utilities class to help with threading.
bool Execute()
Executre function used to perform Tool perpose.