26 template<
typename TriggerFunctionImpl>
35 TriggerFunctionImpl m_oTriggerFunc;
42 if (strTriggerFuncName.IsEmpty())
44 strTriggerFuncName =
"trigger";
45 m_oTriggerFunc.SetName(strTriggerFuncName);
47 m_oTriggerFunc.SetFilter(*
this);
55 if (eStage == tInitStage::StageFirst)
74 virtual tResult CreateDefaultTrigger(
const char* strTriggerFuncName)
102 template<
typename TriggerFunctionImpl>
115 std::unique_ptr<TriggerFunctionImpl> m_pTriggerFunc;
116 tResult m_oTriggerFunctionCreationResult;
120 m_fnCreateTrigger(fnCreateTrigger),
121 m_oTriggerFunctionCreationResult(CreateRunner())
129 "Unable to construct trigger function");
131 if (GetTriggerFunctionName().IsEmpty())
133 m_pTriggerFunc->SetName(
"trigger");
136 return m_pTriggerFunc->SetFilter(*
this);
143 if (eStage == tInitStage::StageFirst)
157 if (eStage == tInitStage::StageFirst)
159 m_pTriggerFunc.reset();
172 return strTriggerFuncName;
181 template<
typename TriggerFunctionImpl,
typename FilterClass = devil::cFilterWithTriggerFunction>
195 std::function<
tResult(FilterClass&)> m_fnCreateTrigger;
196 std::unique_ptr<TriggerFunctionImpl> m_pTriggerFunc;
197 tResult m_oTriggerFunctionCreationResult;
201 m_fnCreateTrigger(fnCreateTrigger),
202 m_oTriggerFunctionCreationResult(CreateRunner())
215 "Unable to construct trigger function");
217 if (GetTriggerFunctionName().IsEmpty())
219 m_pTriggerFunc->SetName(
"trigger");
224 return FilterClass::AttachConfiguration(GetTriggerFunctionName(), *m_pTriggerFunc);
228 tResult Init(
typename FilterClass::tInitStage eStage)
override
231 if (eStage == FilterClass::tInitStage::StageFirst)
234 RETURN_IF_FAILED(FilterClass::RegisterRunner(GetTriggerFunctionName(), *m_pTriggerFunc.get()));
243 tResult Shutdown(
typename FilterClass::tInitStage eStage)
override
245 if (eStage == FilterClass::tInitStage::StageFirst)
247 m_pTriggerFunc.reset();
250 return FilterClass::Shutdown(eStage);
260 return strTriggerFuncName;
275 template<
typename TriggerFunctionImpl,
typename FilterClass = cFilterWithTriggerFunction>
294 #define ADTF_TRIGGER_FUNCTION_FILTER(_class_identifier_,\
296 _triggerfilterclass_,\
298 _trigger_configurator_,\
300 class _triggerfilterclass_ : public adtf::filter::filter_with_trigger_function<_triggerfunction_> \
303 ADTF_CLASS_ID_NAME(_triggerfilterclass_, _class_identifier_, _class_name_); \
306 _triggerfilterclass_():\
307 filter_type(_trigger_configurator_)\
319 #define ADTF_TRIGGER_FUNCTION_FILTER_PLUGIN(_class_identifier_,\
322 _trigger_configurator_,\
324 ADTF_TRIGGER_FUNCTION_FILTER(_class_identifier_,\
326 _triggerfunction_##Filter,\
328 _trigger_configurator_,\
330 ADTF_PLUGIN(_class_name_ " Plugin",\
331 _triggerfunction_##Filter)
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
A common result class usable as return value throughout.
Simple Filter for Registering One Triggerfunction to a filter.
Simple Filter for Registering One Triggerfunction to a filter.
tResult Shutdown(tInitStage eStage) override
Implements the default cFilterLevelmachine state machine call.
tResult Init(tInitStage eStage) override
Initializes the filter.
Base class for ADTF filters.
ucom::ant::object_ptr< streaming::ant::IRunner > RegisterRunner(const char *strName, std::function< tResult(base::flash::tNanoSeconds)> fnRunMethod)
Creates and registers a new Runner.
Base class for ADTF filters.
tResult Shutdown(tInitStage eStage) override
Implements the default cFilterLevelmachine state machine call.
tResult Init(tInitStage eStage) override
Initializes the filter.
@ State_Shutdown
Filter is New / Shutdown.
tInitStage
The Filters InitStages will be used for the cFilterLevelmachine::Init and cFilterLevelmachine::Shutdo...
Base class for every interface type within the uCOM.
Copyright © Audi Electronics Venture GmbH.
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
adtf_util::cString get_named_graph_object_full_name(const INamedGraphObject &oGraphObject)
Helper function to retrieve a full qualified unique name of an object registered in IFilterGraph.
Namespace for entire ADTF SDK.
#define adtf_string_intf(__string__)
The adtf_string_intf Macro helps to easily create a rvalue reference of a adtf::util::cString.
#define RETURN_IF_THROWS_DESC(s,...)
if the expression throws an exception, returns a tResult containing the exception information and amm...