Shows how to access members of incoming substreams.
#include "substream_element_dumper.h"
cDemoSubStreamElementDumper::cDemoSubStreamElementDumper()
{
SetDescription("input", "Incoming data of substreams.");
m_strSubstreamName.SetDescription("The name of the substream that the element should be dumped of.");
RegisterPropertyVariable("substream_name", m_strSubstreamName);
m_strElementName.SetDescription("The name of the element to be dumped, i.e. 'parent.intermediate.leaf'");
RegisterPropertyVariable("element_name", m_strElementName);
SetDescription("Use this filter to dump a single element of a specific substream.");
SetHelpLink("$(ADTF_DIR)/doc/html/page_substream_element_dumper.html");
}
cDemoSubStreamElementDumper::~cDemoSubStreamElementDumper() = default;
tResult cDemoSubStreamElementDumper::Init(tInitStage eStage)
{
if (eStage == StageNormal)
{
AddElementHandler<double>(m_strSubstreamName, m_strElementName, [
this](
tNanoSeconds ,
double fValue)
{
LOG_INFO(
"%s.%s = %f", m_strSubstreamName->c_str(), m_strElementName->c_str(), fValue);
});
}
}
tResult cDemoSubStreamElementDumper::Shutdown(tInitStage eStage)
{
if (eStage == StageNormal)
{
RemoveAllHandlers();
}
}
ADTF_PLUGIN(
"Substream Element Dumper Plugin", cDemoSubStreamElementDumper);
#define ADTF_PLUGIN(__plugin_identifier,...)
Definition adtf_plugin.h:29
#define LOG_INFO(...)
Logs an info message.
Definition log.h:388
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
tResult Init(tInitStage eStage) override
tResult Shutdown(tInitStage eStage) override
Namespace for the ADTF Base SDK.
Definition adtf_base_type_traits.h:13
Namespace for the ADTF Filter SDK.
Definition configurable_runner.h:18
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
A timestamp with nanosecond precision.
Definition chrono.h:23