Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
1d6fe61e
Commit
1d6fe61e
authored
Oct 16, 2018
by
Simon Spannagel
Browse files
Module: allow fetching the DUT detector directly via its role. FIXME: to change for multiple DUTs
parent
df8a6c70
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/core/module/Module.cpp
View file @
1d6fe61e
...
...
@@ -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
())
{
...
...
src/core/module/Module.hpp
View file @
1d6fe61e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment