ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
MyToolZMQMultiThread Class Reference

#include <MyToolZMQMultiThread.h>

Inheritance diagram for MyToolZMQMultiThread:

Public Member Functions

 MyToolZMQMultiThread ()
 Simple constructor. More...
 
bool Execute ()
 Executre function used to perform Tool perpose. More...
 
bool Finalise ()
 Finalise funciton used to clean up resorces. More...
 
bool Initialise (std::string configfile, DataModel &data)
 Initialise Function for setting up Tool resorces. More...
 

Static Private Member Functions

static void Thread (Thread_args *arg)
 Function to be run by the thread in a loop. Make sure not to block in it. More...
 

Private Attributes

std::vector
< MyToolZMQMultiThread_args * > 
args
 Vector of thread args (also holds pointers to the threads) More...
 
zmq::pollitem_t items [2]
 This is used to both inform the poll and store its output. Allows for multitasking sockets. More...
 
int m_freethreads
 Keeps track of free threads. More...
 
Utilitiesm_util
 Pointer to utilities class to help with threading. More...
 
zmq::socket_t * ManagerReceive
 Socket to receive information form threads. More...
 
zmq::socket_t * ManagerSend
 Socket to send information to threads. More...
 

Detailed Description

This is a template for a Tool that provides multiple worker threads and comunicates with them via ZMQ in a thread safe way. Please fill out the descripton and author information.

Author:
B.Richards
Date:
2019/05/28 10:44:00

Contact: b.ric.nosp@m.hard.nosp@m.s@qmu.nosp@m.l.ac.nosp@m..uk

Definition at line 37 of file MyToolZMQMultiThread.h.

Constructor & Destructor Documentation

MyToolZMQMultiThread::MyToolZMQMultiThread ( )

Simple constructor.

Definition at line 8 of file MyToolZMQMultiThread.cpp.

Member Function Documentation

bool MyToolZMQMultiThread::Execute ( )

Executre function used to perform Tool perpose.

Definition at line 56 of file MyToolZMQMultiThread.cpp.

bool MyToolZMQMultiThread::Finalise ( )

Finalise funciton used to clean up resorces.

Definition at line 91 of file MyToolZMQMultiThread.cpp.

bool MyToolZMQMultiThread::Initialise ( std::string  configfile,
DataModel data 
)

Initialise Function for setting up Tool resorces.

Parameters
configfileThe path and name of the dynamic configuration file to read in.
dataA reference to the transient data class used to pass information between Tools.

Definition at line 11 of file MyToolZMQMultiThread.cpp.

void MyToolZMQMultiThread::Thread ( Thread_args arg)
staticprivate

Function to be run by the thread in a loop. Make sure not to block in it.

Definition at line 109 of file MyToolZMQMultiThread.cpp.

Member Data Documentation

std::vector<MyToolZMQMultiThread_args*> MyToolZMQMultiThread::args
private

Vector of thread args (also holds pointers to the threads)

Definition at line 52 of file MyToolZMQMultiThread.h.

zmq::pollitem_t MyToolZMQMultiThread::items[2]
private

This is used to both inform the poll and store its output. Allows for multitasking sockets.

Definition at line 54 of file MyToolZMQMultiThread.h.

int MyToolZMQMultiThread::m_freethreads
private

Keeps track of free threads.

Definition at line 58 of file MyToolZMQMultiThread.h.

Utilities* MyToolZMQMultiThread::m_util
private

Pointer to utilities class to help with threading.

Definition at line 51 of file MyToolZMQMultiThread.h.

zmq::socket_t* MyToolZMQMultiThread::ManagerReceive
private

Socket to receive information form threads.

Definition at line 56 of file MyToolZMQMultiThread.h.

zmq::socket_t* MyToolZMQMultiThread::ManagerSend
private

Socket to send information to threads.

Definition at line 55 of file MyToolZMQMultiThread.h.


The documentation for this class was generated from the following files: