ADTF
Loading...
Searching...
No Matches
adtf::streaming::trigger_pipe_item< INTERFACES > Class Template Reference

#include <triggerpipe.h>

Inherits adtf::ucom::catwo::object< base::ant::IRunnable, base::flash::IRunnable, ant::ITriggerPipeSource, ant::ITriggerPipeItem, quiet::ITriggerPipeHierachy, INTERFACES... >, and detail::cTriggerPipeItemBase.

Public Member Functions

 trigger_pipe_item ()=default
 CTOR.
 
 trigger_pipe_item (const char *strName)
 
 trigger_pipe_item (const char *strName, adtf::base::ant::IRunnable &oRunnable)
 
void SetRunnable (adtf::base::ant::IRunnable &oRunnable)
 
void SetRunnable (adtf::base::flash::IRunnable &oRunnable)
 
template<typename CALLABLE>
void SetCallable (CALLABLE &&callable)
 
tResult RegisterSubItem (const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun, ITriggerPipeItem::tPriority ui32Prio) override
 
tResult UnregisterSubItem (const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun) override
 
tResult ChangePriority (const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > &pSubRun, ITriggerPipeItem::tPriority ui32Prio) override
 
tResult GetSubItems (adtf::ucom::ant::iobject_enum< const ITriggerPipeItem > &lstSubItems) const override
 
tResult Run (tTimeStamp tmTimeofActivation, adtf::base::ant::IRunnable::tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize) override
 
tResult Run (adtf::base::flash::tNanoSeconds tmTimeofActivation, adtf::base::ant::IRunnable::tActivationType ui32ActivationType, const void *pvUserData, size_t nUserDataSize) override
 
tResult RegisterTriggerParent (const ant::ITriggerPipeSource *pParent) override
 
tResult UnregisterTriggerParent (const ant::ITriggerPipeSource *pParent) override
 
tResult GetTriggerParents (const ucom::nitro::ifunction< tResult(const ant::ITriggerPipeSource *)> &fnCallback) const override
 
tResult GetName (base::ant::IString &&strName) const
 
tResult SetName (const char *strName)
 
tResult SetParent (const ucom::ant::IObject *oParentObject)
 
tResult GetParent (const ucom::ant::IObject *&poParentObject) const
 
- Public Member Functions inherited from adtf::ucom::catwo::object< base::ant::IRunnable, base::flash::IRunnable, ant::ITriggerPipeSource, ant::ITriggerPipeItem, quiet::ITriggerPipeHierachy, INTERFACES... >
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object.
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying.
 
void Destroy () const override
 Switch from non-virtual destructor to virtual destructor.
 
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object.
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying.
 
void Destroy () const override
 Switch from non-virtual destructor to virtual destructor.
 
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object.
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying.
 
void Destroy () const override
 Switch from non-virtual destructor to virtual destructor.
 
- Public Member Functions inherited from adtf::ucom::ant::IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 

Additional Inherited Members

- Protected Member Functions inherited from adtf::ucom::ant::IObject
 ~IObject ()=default
 Protected destructor --> Only the final implementation can be destroyed!
 

Detailed Description

template<typename... INTERFACES>
class adtf::streaming::trigger_pipe_item< INTERFACES >

Default implementation class template for a ITriggerPipeItem. This template helps to use the default implementation in certain classes and will prevent multiple inheritance.

Template Parameters
INTERFACESAll needed ucom interfaces to expose, non-ucom interfaces and base classes to derive from.
Remarks
The interfaces base::ant::IRunnable, base::flash::IRunnable, ant::ITriggerPipeSource, ant::ITriggerPipeItem, quiet::ITriggerPipeHierachy will be always exposed by default.
It is important to add interfaces in the right order. See adtf::ucom::object for more details.

Constructor & Destructor Documentation

◆ trigger_pipe_item() [1/2]

template<typename... INTERFACES>
adtf::streaming::trigger_pipe_item< INTERFACES >::trigger_pipe_item ( const char * strName)
inline

CTOR with name

Parameters
[in]strNameName of the pipe item

◆ trigger_pipe_item() [2/2]

template<typename... INTERFACES>
adtf::streaming::trigger_pipe_item< INTERFACES >::trigger_pipe_item ( const char * strName,
adtf::base::ant::IRunnable & oRunnable )
inline

CTOR further initializer

Parameters
[in]strNameName of the pipe item
[in]oRunnableRunnable Reference to call the Run

Member Function Documentation

◆ ChangePriority()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::ChangePriority ( const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > & pSubRun,
ITriggerPipeItem::tPriority ui32Prio )
inlineoverride

Changes the priority of the pSubRun.

Parameters
[in]pSubRunTriggerPipeItem to register.
[in]ui32PrioPriority of Run call.
Returns
Standard Result Code.

◆ GetName()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::GetName ( base::ant::IString && strName) const
inline

Gets the Name of the object to the IString rvalue reference strName.

Parameters
[in]strNameString reference to return the name to
Returns
Result of adtf::base::IString::Set

◆ GetParent()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::GetParent ( const ucom::ant::IObject *& poParentObject) const
inline

Retrieves the Parent of the object. Only ONE parent is possible !

Parameters
[in,out]poParentObjectParent Object reference where to retrieve to.
Warning
Make sure the parent lives longer than the child. Otherwise GetParent access could fail.
Returns
Standard Result Code
Return values
ERR_POINTERNo parent set.

◆ GetSubItems()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::GetSubItems ( adtf::ucom::ant::iobject_enum< const ITriggerPipeItem > & lstSubItems) const
inlineoverride

Retrieves a list of the registered Items.

Parameters
[in]lstSubItemsenumeration interface where to push the object references to.
Returns
Standard Result Code.

◆ GetTriggerParents()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::GetTriggerParents ( const ucom::nitro::ifunction< tResult(const ant::ITriggerPipeSource *)> & fnCallback) const
inlineoverride

Retrieve all trigger pipe parents of this item.

Parameters
[in,out]fnCallbackThis will be called for each parent item.
Returns
Standard result (forwarded from the callback).

◆ RegisterSubItem()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::RegisterSubItem ( const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > & pSubRun,
ITriggerPipeItem::tPriority ui32Prio )
inlineoverride

Registers the pSubRun as SubItem of the source. The source will forward a Run call to every registered ITriggerPipeItem in order of ui32Prio.

Parameters
[in]pSubRunTriggerPipeItem to register.
[in]ui32PrioPriority of Run call.
Returns
Standard Result Code.

◆ RegisterTriggerParent()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::RegisterTriggerParent ( const ant::ITriggerPipeSource * pParent)
inlineoverride

Registers the given trigger pipe source as a parent of this item;

Parameters
[in]pParentThe new parent in the trigger pipe.
Returns
Standard result.

◆ Run() [1/2]

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::Run ( adtf::base::flash::tNanoSeconds tmTimeofActivation,
adtf::base::ant::IRunnable::tActivationType ui32ActivationType,
const void * pvUserData,
size_t nUserDataSize )
inlineoverride

This method will be called to activate the registered m_pRunnable by a given activation type. Then the Registered subitems will be called in order of ITriggerPipeItem::tPriority.

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.

◆ Run() [2/2]

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::Run ( tTimeStamp tmTimeofActivation,
adtf::base::ant::IRunnable::tActivationType ui32ActivationType,
const void * pvUserData,
size_t nUserDataSize )
inlineoverride

This method will be called to activate the registered m_pRunnable by a given activation type. Then the Registered subitems will be called in order of ITriggerPipeItem::tPriority.

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.

◆ SetCallable()

template<typename... INTERFACES>
template<typename CALLABLE>
void adtf::streaming::trigger_pipe_item< INTERFACES >::SetCallable ( CALLABLE && callable)
inline

Sets the Runnable implementation to call if Run is called by the trigger item. The callable object will be wrapped into a base::runnable and managed by the trigger pipe item. It needs to follow the signatures of the possible runnable Run function:

  • See adtf::base::detail::runnable
Parameters
[in]callableThe callable object to wrap into a base::runnable and call on Run.

◆ SetName()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::SetName ( const char * strName)
inline

Sets the Name of the object.

Parameters
[in]strNameName of the object to set.
Returns
Standard Result Code

◆ SetParent()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::SetParent ( const ucom::ant::IObject * oParentObject)
inline

Sets the Parent of the object. Only ONE parent is possible !

Parameters
[in]oParentObjectParent Object reference to set.
Warning
Make sure the parent lives longer than the child. Otherwise GetParent access could fail.
Returns
Standard Result Code

◆ SetRunnable() [1/2]

template<typename... INTERFACES>
void adtf::streaming::trigger_pipe_item< INTERFACES >::SetRunnable ( adtf::base::ant::IRunnable & oRunnable)
inline

Adds the Runnable implementation to call if Run is called.

See also
trigger_pipe_item::Run implementation
Parameters
[in]oRunnableThe reference to the Runnable instance.
Remarks
Make sure the given oRunnable lives at least longer than the trigger_pipe_item

◆ SetRunnable() [2/2]

template<typename... INTERFACES>
void adtf::streaming::trigger_pipe_item< INTERFACES >::SetRunnable ( adtf::base::flash::IRunnable & oRunnable)
inline

Adds the Runnable implementation to call if Run is called.

See also
trigger_pipe_item::Run implementation
Parameters
[in]oRunnableThe reference to the Runnable instance.
Remarks
Make sure the given oRunnable lives at least longer than the trigger_pipe_item

◆ UnregisterSubItem()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::UnregisterSubItem ( const adtf::ucom::ant::iobject_ptr< ITriggerPipeItem > & pSubRun)
inlineoverride

Unregisters the pSubRun from the source.

Parameters
[in]pSubRunTriggerPipeItem to unregister.
Returns
Standard Result Code.

◆ UnregisterTriggerParent()

template<typename... INTERFACES>
tResult adtf::streaming::trigger_pipe_item< INTERFACES >::UnregisterTriggerParent ( const ant::ITriggerPipeSource * pParent)
inlineoverride

Unregisters the given trigger pipe source that is no longer a parent of this item;

Parameters
[in]pParentThe parent to unregister.
Returns
Standard result.

The documentation for this class was generated from the following file: