4#include <range/v3/algorithm/find_if.hpp>
5#include <range/v3/algorithm/min_element.hpp>
6#include <range/v3/view/take.hpp>
20 auto min_element = ranges::min_element(paddles_view,
22 {
return left->GetTrigTime() <
right->GetTrigTime(); });
23 return (min_element == paddles_view.end()) ? NAN : min_element->get()->GetTrigTime();
36 for (
int idx{}; idx < num; ++idx)
48 ranges::find_if(valid_view, [paddle_id](
auto& paddle) {
return paddle->GetPaddleID() == paddle_id; });
49 if (iter != valid_view.end())
61 new_paddle->SetPaddleID(paddle_id);
void reserve_additional_paddles(int num)
Reserve memories for additional number of paddles.
virtual void ExtraInit(int initial_capacity)
void Init(int initial_capacity=1)
Initialization of the engine class.
void Construct()
Construct singals from the paddles and channels.
virtual auto make_new_paddle() const -> std::unique_ptr< AbstractPaddle >=0
auto GetTriggerTime() const -> double
Get the trigger time of the current event.
auto add_paddle(int paddle_id) -> AbstractPaddle &
std::vector< std::unique_ptr< AbstractPaddle > > paddles_
main data. This vector should rarely grow in the event loop!
std::atomic< int > size_
size of bars with valid signals in the current event
auto get_capacity() const
The number of preallocated bar objects in the engine.
NeuLAND digitizing finder task.