DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
datahandlinglibs
include
datahandlinglibs
testutils
UnitTestUtilities.hpp
Go to the documentation of this file.
1
8
9
#ifndef DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_TESTUTILS_UNITTESTUTILITIES_HPP
10
#define DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_TESTUTILS_UNITTESTUTILITIES_HPP
11
12
#include "
datahandlinglibs/models/DataHandlingModel.hpp
"
13
#include "
datahandlinglibs/models/DefaultRequestHandlerModel.hpp
"
14
#include "
datahandlinglibs/models/TaskRawDataProcessorModel.hpp
"
15
16
namespace
dunedaq
{
17
namespace
datahandlinglibs
{
18
namespace
unittest
{
19
20
template
<
typename
ReadoutType,
21
typename
RequestHandlerType,
22
typename
LatencyBufferType,
23
typename
RawDataProcessorType,
24
typename
InputDataType = ReadoutType>
25
class
MockDataHandlingModel
26
:
public
DataHandlingModel
<ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType>
27
{
28
public
:
29
using
Base
=
30
DataHandlingModel<ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType>
;
31
using
Base::Base;
32
using
Base::PostprocessScheduleAlgorithm;
33
using
typename
Base::num_post_processing_delay_max_waits_t
;
34
35
void
test_run_postprocess_scheduler
(std::shared_ptr<LatencyBufferType> latency_buffer_impl,
36
std::shared_ptr<RawDataProcessorType> raw_processor_impl,
37
std::unique_ptr<folly::Timekeeper> timekeeper,
38
uint64_t post_processing_delay_max_wait)
39
{
40
this->
m_latency_buffer_impl
= latency_buffer_impl;
41
this->
m_raw_processor_impl
= raw_processor_impl;
42
this->
m_timekeeper
= std::move(timekeeper);
43
this->
m_post_processing_delay_max_wait
= post_processing_delay_max_wait;
44
this->
run_postprocess_scheduler
();
45
}
46
47
num_post_processing_delay_max_waits_t
get_num_post_processing_delay_max_waits
()
48
{
49
return
this->
m_num_post_processing_delay_max_waits
.load();
50
}
51
52
void
set_run_marker
(
bool
run_marker
) {
return
this->
m_run_marker
.store(
run_marker
); }
53
};
54
55
}
// namespace unittest
56
}
// namespace datahandlinglibs
57
}
// namespace dunedaq
58
59
#endif
// DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_TESTUTILS_UNITTESTUTILITIES_HPP
DataHandlingModel.hpp
DefaultRequestHandlerModel.hpp
TaskRawDataProcessorModel.hpp
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, ReadoutType >::DataHandlingModel
DataHandlingModel(std::atomic< bool > &run_marker)
Definition
DataHandlingModel.hpp:91
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::num_post_processing_delay_max_waits_t
std::remove_const< std::invoke_result< decltype(&metric_t::num_post_processing_delay_max_waits), metric_t >::type >::type num_post_processing_delay_max_waits_t
Definition
DataHandlingModel.hpp:343
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, ReadoutType >::run_postprocess_scheduler
void run_postprocess_scheduler()
Definition
DataHandlingModel.hxx:301
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, ReadoutType >::m_post_processing_delay_max_wait
uint64_t m_post_processing_delay_max_wait
Definition
DataHandlingModel.hpp:331
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, ReadoutType >::m_run_marker
std::atomic< bool > & m_run_marker
Definition
DataHandlingModel.hpp:320
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, ReadoutType >::m_timekeeper
std::unique_ptr< folly::Timekeeper > m_timekeeper
Definition
DataHandlingModel.hpp:384
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, ReadoutType >::m_num_post_processing_delay_max_waits
std::atomic< num_post_processing_delay_max_waits_t > m_num_post_processing_delay_max_waits
Definition
DataHandlingModel.hpp:352
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, ReadoutType >::m_latency_buffer_impl
std::shared_ptr< LatencyBufferType > m_latency_buffer_impl
Definition
DataHandlingModel.hpp:387
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, ReadoutType >::m_raw_processor_impl
std::shared_ptr< RawDataProcessorType > m_raw_processor_impl
Definition
DataHandlingModel.hpp:390
dunedaq::datahandlinglibs::unittest::MockDataHandlingModel
Definition
UnitTestUtilities.hpp:27
dunedaq::datahandlinglibs::unittest::MockDataHandlingModel::get_num_post_processing_delay_max_waits
num_post_processing_delay_max_waits_t get_num_post_processing_delay_max_waits()
Definition
UnitTestUtilities.hpp:47
dunedaq::datahandlinglibs::unittest::MockDataHandlingModel::Base
DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType > Base
Definition
UnitTestUtilities.hpp:29
dunedaq::datahandlinglibs::unittest::MockDataHandlingModel::test_run_postprocess_scheduler
void test_run_postprocess_scheduler(std::shared_ptr< LatencyBufferType > latency_buffer_impl, std::shared_ptr< RawDataProcessorType > raw_processor_impl, std::unique_ptr< folly::Timekeeper > timekeeper, uint64_t post_processing_delay_max_wait)
Definition
UnitTestUtilities.hpp:35
dunedaq::datahandlinglibs::unittest::MockDataHandlingModel::set_run_marker
void set_run_marker(bool run_marker)
Definition
UnitTestUtilities.hpp:52
run_marker
std::atomic< bool > run_marker
Global atomic for process lifetime.
Definition
daq_application.cxx:26
dunedaq::datahandlinglibs::unittest
Definition
UnitTestUtilities.hpp:18
dunedaq::datahandlinglibs
Definition
DataHandlingConcept.hpp:16
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
Generated on
for DUNE-DAQ by
1.18.0