Commit 1d6fe61e authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Module: allow fetching the DUT detector directly via its role. FIXME: to change for multiple DUTs

parent df8a6c70
......@@ -39,6 +39,11 @@ Detector* Module::get_reference() {
return (*it);
}
Detector* Module::get_dut() {
auto it = find_if(m_detectors.begin(), m_detectors.end(), [](Detector* obj) { return obj->isDUT(); });
return (*it);
}
bool Module::has_detector(std::string name) {
auto it = find_if(m_detectors.begin(), m_detectors.end(), [&name](Detector* obj) { return obj->name() == name; });
if(it == m_detectors.end()) {
......
......@@ -140,6 +140,13 @@ namespace corryvreckan {
*/
Detector* get_reference();
/**
* @brief Get the device under test
* @return Pointer to the DUT detector
* FIXME This should allow retrieval of a vector of DUTs
*/
Detector* get_dut();
/**
* @brief Check if this module should act on a given detector
* @param name Name of the detector to check
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment