8#ifndef _Belle2_ProcessController_h
9#define _Belle2_ProcessController_h
11#include "daq/slc/readout/RunInfoBuffer.h"
13#include "daq/slc/runcontrol/RCCallback.h"
15#include "daq/slc/system/PThread.h"
16#include "daq/slc/system/Process.h"
17#include "daq/slc/system/Mutex.h"
39 m_callback = callback;
47 bool init(
const std::string& parname,
int nodeid = 0);
49 bool load(
int timeout);
50 bool start(
int expno,
int runno);
61 bool abort(
unsigned int timeout = 60);
63 const std::string& getName() {
return m_name; }
64 const std::string& getParName() {
return m_parname; }
65 const std::string& getExecutable() {
return m_exename; }
67 RCCallback* getCallback() {
return m_callback; }
68 const Process& getProcess()
const {
return m_process; }
69 Process& getProcess() {
return m_process; }
70 void setCallback(
RCCallback* callback) { m_callback = callback; }
71 void setName(
const std::string& name) { m_name = name; }
72 void setExecutable(
const std::string& exe) { m_exename = exe; }
73 void addArgument(
const std::string& arg) { m_arg_v.push_back(arg); }
74 void addArgument(
const char* format, ...);
76 void addArgument(T arg);
77 void clearArguments() { m_arg_v = std::vector<std::string>(); }
78 bool isAlive()
const {
return m_process.isAlive(); }
79 bool waitReady(
int timeout);
82 void lock() { m_mutex.lock(); }
83 void unlock() { m_mutex.unlock(); }
88 std::string m_parname;
90 std::string m_exename;
91 std::vector<std::string> m_arg_v;
94 std::string m_message;
102 inline void ProcessController::addArgument(T arg)
104 std::stringstream ss; ss << arg;
105 m_arg_v.push_back(ss.str());
114 m_iopipe[0] = iopipe[0];
115 m_iopipe[1] = iopipe[1];
Abstract base class for different kinds of events.