30#ifndef DWFRAMEWORK_DWNODES_SENSORS_DWSENSORNODE_DWCHANNELDRAINERTEMPLATE_HPP_
31#define DWFRAMEWORK_DWNODES_SENSORS_DWSENSORNODE_DWCHANNELDRAINERTEMPLATE_HPP_
44#include <dw/core/base/Types.h>
45#include <dw/sensors/Sensors.h>
46#include <dw/sensors/canbus/CAN.h>
47#include <dw/sensors/radar/Radar.h>
59template <
typename OutputProcessedDataType,
typename InputProcessedDataType = OutputProcessedDataType>
70 return DW_NOT_AVAILABLE;
73 if (inputPort->
wait(inTimeout_us) == DW_SUCCESS)
93template <
typename OutputProcessedDataType,
typename ReadProcessedDataFunc,
typename InputProcessedDataType = OutputProcessedDataType>
99 static constexpr char LOG_TAG[] =
"dwChannelDrainerTemplate";
120 dwTime_t& latestTimestamp,
122 bool isDroppingData =
false)
override
128template <
typename OutputProcessedDataType,
typename ReadProcessedDataFunc,
typename InputProcessedDataType>
virtual dwStatus tryRead(ProcessedDataType *outFrame, dwTime_t &latestTimestamp, dwTime_t timeout, bool isDroppingData=false)
dwTime_t m_virtualSyncTime
dwStatus readProcessedData(OutputProcessedDataType *outFrame, dwTime_t &latestTimestamp, dwTime_t timeout, bool isDroppingData=false) override
virtual dwStatus reset() override
dwChannelDrainerTemplate(dwSensorDrainerParams params, std::unique_ptr< ReadProcessedDataFunc > readProcessedDataFunc, InputDataPort inputPort)
virtual ~dwChannelDrainerTemplate()=default
static constexpr char LOG_TAG[]
virtual dwStatus getNextDataTimestamp(dwTime_t &outTimestamp)=0
virtual dwStatus readNextData(dwTime_t inTimeout_us, InputDataPort inputPort)
std::shared_ptr< InputProcessedDataType > m_nextDataEvent
virtual dwStatus getNextData(OutputProcessedDataType *outDataFrame, InputDataPort)=0