DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
tpglibs::AbstractProcessor< T > Class Template Referenceabstract

Abstract signal processor. More...

#include <AbstractProcessor.hpp>

Public Types

using signal_type_t = T
 Signal type to process on. General __m256i.
 

Public Member Functions

virtual ~AbstractProcessor ()=default
 
ProcessorInternalStateBufferManager< T > * _get_internal_state_buffer_manager ()
 
ProcessorInternalStateNameRegistry< T > * _get_internal_state_name_registry ()
 
virtual void configure_internal_state_collection (const nlohmann::json &config)
 Configure common internal state collection parameters.
 
virtual void configure (const nlohmann::json &config, const int16_t *plane_numbers)=0
 Pure virtual function that will configure the processor using plane numbers.
 
void set_next_processor (std::shared_ptr< AbstractProcessor< T > > next_processor)
 Setter for next processor.
 
std::shared_ptr< AbstractProcessor< T > > get_next_processor ()
 Getter for next processor.
 
virtual T process (const T &signal)
 Simple signal pass-through.
 
virtual std::vector< std::string > get_requested_internal_state_names () const
 Get the names of requested internal states (delegates to registry).
 
virtual ProcessorMetricArray< std::array< int16_t, 16 > > read_internal_states_as_integer_array ()
 

Protected Attributes

ProcessorInternalStateBufferManager< T > m_internal_state_buffer_manager
 
ProcessorInternalStateNameRegistry< T > m_internal_state_name_registry
 
std::atomic< uint64_t > m_samples {0}
 
bool m_collect_internal_state_flag {false}
 
uint64_t m_sample_period {1}
 

Private Attributes

std::shared_ptr< AbstractProcessor< T > > m_next_processor
 Points to next processor in the chain.
 

Detailed Description

template<class T>
class tpglibs::AbstractProcessor< T >

Abstract signal processor.

Configurable signal processor for TPG.

Definition at line 27 of file AbstractProcessor.hpp.

Member Typedef Documentation

◆ signal_type_t

template<class T >
using tpglibs::AbstractProcessor< T >::signal_type_t = T

Signal type to process on. General __m256i.

Definition at line 42 of file AbstractProcessor.hpp.

Constructor & Destructor Documentation

◆ ~AbstractProcessor()

template<class T >
virtual tpglibs::AbstractProcessor< T >::~AbstractProcessor ( )
virtualdefault

Member Function Documentation

◆ _get_internal_state_buffer_manager()

template<class T >
ProcessorInternalStateBufferManager< T > * tpglibs::AbstractProcessor< T >::_get_internal_state_buffer_manager ( )
inline

Definition at line 46 of file AbstractProcessor.hpp.

46 {
48 }
ProcessorInternalStateBufferManager< T > m_internal_state_buffer_manager

◆ _get_internal_state_name_registry()

template<class T >
ProcessorInternalStateNameRegistry< T > * tpglibs::AbstractProcessor< T >::_get_internal_state_name_registry ( )
inline

Definition at line 50 of file AbstractProcessor.hpp.

50 {
52 }
ProcessorInternalStateNameRegistry< T > m_internal_state_name_registry

◆ configure()

template<class T >
virtual void tpglibs::AbstractProcessor< T >::configure ( const nlohmann::json & config,
const int16_t * plane_numbers )
pure virtual

◆ configure_internal_state_collection()

template<class T >
virtual void tpglibs::AbstractProcessor< T >::configure_internal_state_collection ( const nlohmann::json & config)
inlinevirtual

Configure common internal state collection parameters.

This method handles the common configuration for internal state collection that all processors need. Derived classes should call this method at the beginning of their configure() implementation.

Parameters
configJSON config containing metric_collect_toggle_state, metric_collect_time_sample_period, and requested_internal_states

Definition at line 63 of file AbstractProcessor.hpp.

63 {
64 m_collect_internal_state_flag = config.value("metric_collect_toggle_state", false);
65 m_sample_period = config.value("metric_collect_time_sample_period", 1);
66
68 if (config.contains("requested_internal_states")) {
69 m_internal_state_name_registry.parse_requested_internal_state_items(config["requested_internal_states"]);
70 } else {
71 m_internal_state_name_registry.parse_requested_internal_state_items("");
72 }
73
74 // Only configure if we actually have states to collect
75 auto num_items = m_internal_state_name_registry.get_number_of_requested_internal_states();
76 if (num_items > 0) {
78 }
79 }
80 }

◆ get_next_processor()

template<class T >
std::shared_ptr< AbstractProcessor< T > > tpglibs::AbstractProcessor< T >::get_next_processor ( )
inline

Getter for next processor.

Definition at line 91 of file AbstractProcessor.hpp.

91 {
92 return m_next_processor;
93 }
std::shared_ptr< AbstractProcessor< T > > m_next_processor
Points to next processor in the chain.

◆ get_requested_internal_state_names()

template<class T >
virtual std::vector< std::string > tpglibs::AbstractProcessor< T >::get_requested_internal_state_names ( ) const
inlinevirtual

Get the names of requested internal states (delegates to registry).

Definition at line 104 of file AbstractProcessor.hpp.

104 {
105 return m_internal_state_name_registry.get_names_of_requested_internal_states();
106 }

◆ process()

◆ read_internal_states_as_integer_array()

template<class T >
virtual ProcessorMetricArray< std::array< int16_t, 16 > > tpglibs::AbstractProcessor< T >::read_internal_states_as_integer_array ( )
inlinevirtual

Definition at line 108 of file AbstractProcessor.hpp.

108 {
109 return m_internal_state_buffer_manager.switch_buffer_and_read_casted();
110 }

◆ set_next_processor()

template<class T >
void tpglibs::AbstractProcessor< T >::set_next_processor ( std::shared_ptr< AbstractProcessor< T > > next_processor)
inline

Setter for next processor.

Definition at line 86 of file AbstractProcessor.hpp.

86 {
87 m_next_processor = next_processor;
88 }

Member Data Documentation

◆ m_collect_internal_state_flag

template<class T >
bool tpglibs::AbstractProcessor< T >::m_collect_internal_state_flag {false}
protected

Definition at line 37 of file AbstractProcessor.hpp.

37{false};

◆ m_internal_state_buffer_manager

template<class T >
ProcessorInternalStateBufferManager<T> tpglibs::AbstractProcessor< T >::m_internal_state_buffer_manager
protected

Definition at line 32 of file AbstractProcessor.hpp.

◆ m_internal_state_name_registry

template<class T >
ProcessorInternalStateNameRegistry<T> tpglibs::AbstractProcessor< T >::m_internal_state_name_registry
protected

Definition at line 33 of file AbstractProcessor.hpp.

◆ m_next_processor

template<class T >
std::shared_ptr<AbstractProcessor<T> > tpglibs::AbstractProcessor< T >::m_next_processor
private

Points to next processor in the chain.

Definition at line 29 of file AbstractProcessor.hpp.

◆ m_sample_period

template<class T >
uint64_t tpglibs::AbstractProcessor< T >::m_sample_period {1}
protected

Definition at line 38 of file AbstractProcessor.hpp.

38{1};

◆ m_samples

template<class T >
std::atomic<uint64_t> tpglibs::AbstractProcessor< T >::m_samples {0}
protected

Definition at line 36 of file AbstractProcessor.hpp.

36{0};

The documentation for this class was generated from the following file: