44 const void* pvUserData,
45 size_t nUserDataSize)
override;
56 template<IRunnable::tActivationType TYPE_OF_ACTIVATION = IRunnable::RUN_UNSPECIFIED,
typename Interface = IRunnable>
87 if (ui32ActivationType == TYPE_OF_ACTIVATION
90 tResult nErrorCode = ERR_NOT_INITIALIZED;
105 return TYPE_OF_ACTIVATION;
114 template<ant::IRunnable::tActivationType TYPE_OF_ACTIVATION = ant::IRunnable::RUN_UNSPECIFIED,
typename AntInterface = ant::IRunnable,
typename Interface = IRunnable>
137 return fcRunOnceFunc(duration_cast<tTimeStamp>(tmTimeofActivation));
146 const void* pvUserData,
147 size_t nUserDataSize)
override
149 return Run(duration_cast<tNanoSeconds>(tmTimeofActivation),
167 if (ui32ActivationType == TYPE_OF_ACTIVATION
170 tResult nErrorCode = ERR_NOT_INITIALIZED;
185 return TYPE_OF_ACTIVATION;
196 #define ADTF_RUN_FUNCTION(_fcName_) [this](tTimeStamp tmTime) -> tResult { return _fcName_(tmTime); }
203 #define ADTF_RUN_FUNCTION_NS(_fcName_) [this](adtf::base::flash::tNanoSeconds tmTime) -> tResult { return _fcName_(tmTime); }
206 using ant::cRunnable;
207 using flash::runnable;
Copyright © Audi Electronics Venture GmbH.
tInt64 tTimeStamp
type definition for a time value.
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
A common result class usable as return value throughout.
The Runnable interface defines common methods for a running component.
tActivationType
Enumeration of the possible activation types to set a component in running state.
@ RUN_UNSPECIFIED
unspecified Run activation type.
std::function< tResult(tTimeStamp)> tRunFunction
Type definition of the function used to implement Run.
Empty Runnable helper implementation.
cRunnable(cRunnable &&)=delete
no move CTOR
cRunnable & operator=(cRunnable &&)=delete
no move operator
cRunnable & operator=(const cRunnable &)=delete
no copy operator
cRunnable(const cRunnable &)=delete
no copy CTOR
tResult Run(tTimeStamp tmTimeofActivation, tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize) override
The Run method to set the component in running state.
virtual ~cRunnable()
DTOR.
Runnable helper implementaton template.
virtual ~runnable()=default
DTOR.
virtual IRunnable::tActivationType GetActivationType() const
Returns the type of activation implemented.
runnable(IRunnable::tRunFunction fcRunOnceFunc)
Main CTOR with callable function.
IRunnable::tRunFunction m_fcRunOnceFunc
given function to call on Run
tResult Run(tTimeStamp tmTimeofActivation, IRunnable::tActivationType ui32ActivationType, const void *, size_t) override
IRunnable::Run implementation which will call m_fcRunOnceFunc if ui32ActivationType is TYPE_OF_ACTIVA...
std::function< tResult(tNanoSeconds)> tRunFunction
Type definition of the function used to implement Run.
~runnable() override=default
DTOR.
adtf::base::flash::IRunnable::tRunFunction m_fcRunOnceFunc
given function to call on Run
runnable(adtf::base::flash::IRunnable::tRunFunction fcRunOnceFunc)
Main CTOR with callable function.
ant::IRunnable::tActivationType GetActivationType() const override
Returns the type of activation implemented.
runnable(ant::IRunnable::tRunFunction fcRunOnceFunc)
Compatibility CTOR with callable function.
tResult Run(tNanoSeconds tmTimeofActivation, ant::IRunnable::tActivationType ui32ActivationType, const void *, size_t) override
IRunnable::Run implementation which will call m_fcRunOnceFunc if ui32ActivationType is TYPE_OF_ACTIVA...
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
A timestamp with nanosecond precision.