#include "demo_code_generation_generator_filter.h"
#include <nested_struct.h>
cCodeGenerationDataGenerator::cCodeGenerationDataGenerator()
{
m_pWriter = CreateOutputPin("output", description<tNestedStruct>());
SetDescription("output", "Provides the generated samples based on tNestedStruct");
SetDescription("generate_data", "Runner to periodically trigger the function which generates the output samples");
SetDescription("Use this filter to generate increasing data with the structure of tNestedStruct.");
SetHelpLink("$(ADTF_DIR)/doc/adtf_html/page_demo_md_code_generation_filters.html");
}
tResult cCodeGenerationDataGenerator::Process(tNanoSeconds tmTrigger, IRunner* )
{
output_sample_data<tNestedStruct> oGeneratedData(tmTrigger);
oGeneratedData->sHeaderStruct.ui32HeaderVal = static_cast<uint32_t>(tmTrigger.nCount);
oGeneratedData->sHeaderStruct.f64HeaderVal = static_cast<double>(tmTrigger.nCount);
oGeneratedData->sSimpleStruct.ui8Val = static_cast<uint8_t>(tmTrigger.nCount);
oGeneratedData->sSimpleStruct.ui16Val = static_cast<uint16_t>(tmTrigger.nCount);
oGeneratedData->sSimpleStruct.ui32Val = static_cast<uint32_t>(tmTrigger.nCount);
oGeneratedData->sSimpleStruct.i32Val = static_cast<int32_t>(tmTrigger.nCount);
oGeneratedData->sSimpleStruct.i64Val = static_cast<int64_t>(tmTrigger.nCount);
oGeneratedData->sSimpleStruct.f64Val = static_cast<double>(tmTrigger.nCount);
oGeneratedData->sSimpleStruct.f32Val = static_cast<float>(tmTrigger.nCount);
m_pWriter->Write(oGeneratedData.Release());
}
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
std::chrono::seconds seconds
Compatibility to C++11 std::chrono::seconds