ADTF
runnable< TYPE_OF_ACTIVATION, Interface >

Runnable helper implementaton template. More...

Inheritance diagram for runnable< TYPE_OF_ACTIVATION, Interface >:
[legend]

Public Member Functions

 runnable ()
 CTOR.
 
 runnable (IRunnable::tRunFunction fcRunOnceFunc)
 Main CTOR with callable function. More...
 
virtual ~runnable ()=default
 DTOR.
 
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_ACTIVATION. More...
 
virtual IRunnable::tActivationType GetActivationType () const
 Returns the type of activation implemented. More...
 
- Public Member Functions inherited from object< IRunnable, IRunnable >
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object. More...
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying. More...
 
void Destroy () const override
 Destruct and deallocate instantiations of type IObject. More...
 
- Public Member Functions inherited from IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 Marks the IObject to be castable with the ucom_cast() More...
 

Protected Attributes

IRunnable::tRunFunction m_fcRunOnceFunc = nullptr
 given function to call on Run
 

Additional Inherited Members

- Protected Member Functions inherited from IObject
 ~IObject ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 

Detailed Description

template<IRunnable::tActivationType TYPE_OF_ACTIVATION = IRunnable::RUN_UNSPECIFIED, typename Interface = IRunnable>
class adtf::base::ant::runnable< TYPE_OF_ACTIVATION, Interface >

Runnable helper implementaton template.

This type will call the given function if Run is called.

Template Parameters
TYPE_OF_ACTIVATIONActivation type this runnable calles the given function
Interfaceinterface type the runnable will derived from

Definition at line 57 of file runnable.h.

Constructor & Destructor Documentation

◆ runnable()

runnable ( IRunnable::tRunFunction  fcRunOnceFunc)
inline

Main CTOR with callable function.

Parameters
fcRunOnceFuncrun function

Definition at line 68 of file runnable.h.

References runnable< TYPE_OF_ACTIVATION, Interface >::m_fcRunOnceFunc.

Member Function Documentation

◆ GetActivationType()

virtual IRunnable::tActivationType GetActivationType ( ) const
inlinevirtual

Returns the type of activation implemented.

Returns
the activation type given by TYPE_OF_ACTIVATION

Definition at line 103 of file runnable.h.

◆ Run()

tResult Run ( tTimeStamp  tmTimeofActivation,
IRunnable::tActivationType  ui32ActivationType,
const void *  ,
size_t   
)
inlineoverride

IRunnable::Run implementation which will call m_fcRunOnceFunc if ui32ActivationType is TYPE_OF_ACTIVATION.

Return values
ERR_NOT_INITIALIZEDm_fcRunOnceFunc is not set

The Run method to set the component in running state. This method will be called to activate the component by a given activation type.

Parameters
[in]tmTimeofActivationTime of activation. Usually this is the StreamTime.
[in]ui32ActivationTypeThe activation type for running.
[in]pvUserDatapointer to a activation structure depending on the activation type.
[in]nUserDataSizeSize of the activation structure. (in byte)
Returns
Standard result code.
Return values
ERR_CANCELEDDepending on the caller (timer, cyclic thread) it will break cyclic running.

Definition at line 82 of file runnable.h.

References runnable< TYPE_OF_ACTIVATION, Interface >::m_fcRunOnceFunc, RETURN_ERROR, and IRunnable::RUN_UNSPECIFIED.