ADTF  3.18.2
cFilterBase

The cFilterBase class implements a basic filter that supports the ant::IFilter interfaces. More...

Inheritance diagram for cFilterBase:
[legend]

Public Types

typedef cFilterLevelmachine::tInitStage tInitStage
 private d-pointer More...
 

Public Member Functions

 cFilterBase ()
 Constructor. More...
 
virtual ~cFilterBase ()
 Destructor.
 
tResult Init (tInitStage eStage) override
 Implements the default cFilterLevelmachine state machine call. More...
 
tResult Shutdown (tInitStage eStage) override
 Implements the default cFilterLevelmachine state machine call. More...
 
tResult Start () override
 Implements the default cFilterLevelmachine state machine calls. More...
 
tResult Stop () override
 Implements the default cFilterLevelmachine state machine calls. More...
 
IFilter::tFilterState GetState () const override
 
tResult SetState (IFilter::tFilterState eState) override
 Sets the state of the filter. More...
 
tResult RegisterPin (const ucom::ant::iobject_ptr< IPin > &pPin) override
 
tResult UnregisterPin (const ucom::ant::iobject_ptr< IPin > &pPin) override
 
tResult RegisterBindingObject (const ucom::ant::iobject_ptr< IBindingObject > &pBindingObject) override
 
tResult RegisterRunner (const ucom::ant::iobject_ptr< IRunner > &pBindingObject) override
 
virtual tResult RegisterPin (const ucom::ant::iobject_ptr< IPin > &pIPin)
 gets cDataBinding RegisterPin Variant visible
 
tResult RegisterPin (const ucom::ant::iobject_ptr< IInPin > &pIInPin)
 gets cDataBinding RegisterPin Variant visible
 
tResult RegisterPin (const ucom::ant::iobject_ptr< IOutPin > &pIOutPin)
 gets cDataBinding RegisterPin Variant visible
 
virtual tResult RegisterBindingObject (const ucom::ant::iobject_ptr< IBindingObject > &pBindingObject)
 RegisterBindingObject will register the given pBindingObject within the internal registry. More...
 
tResult RegisterBindingObject (const ucom::ant::iobject_ptr< IBindingServer > &pBindingServer)
 Registers the given pBindingServer. More...
 
tResult RegisterBindingObject (const ucom::ant::iobject_ptr< IBindingClient > &pBindingClient)
 Registers the given pBindingClient. More...
 
virtual tResult RegisterRunner (const ucom::ant::iobject_ptr< IRunner > &pRunner)
 Registers and publishes a IRunner object to the IRuntimeBehaviour. More...
 
virtual tResult RegisterRunner (const char *strName, base::ant::IRunnable &oRunnable)
 Create and Registers a IRunner object for your oRunnable with the name strName. More...
 
virtual tResult RegisterInnerPipe (const ucom::ant::iobject_ptr< ITriggerPipe > &pTriggerPipe)
 Registers and publishes an inner ITriggerPipe object to the IRuntimeBehaviour. More...
 
- Public Member Functions inherited from object< cFilterLevelmachine, ucom::ant::cClassInfo, runtime_behaviour< interface_binding< data_binding< named_graph_object< IFilter > > > > >
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

ucom::object_ptr< services::ant::IReferenceClock_clock
 A reference to the clock service. More...
 

Additional Inherited Members

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

Detailed Description

The cFilterBase class implements a basic filter that supports the ant::IFilter interfaces.

The cFilterBase uses the cFilterLevelmachine that transforms the the IFilter::SetState calls to the cFilterBase::Init / cFilterBase::Shutdown / cFilterBase::Start and cFilterBase::Stop events.

Remarks
: The default cFilterBase does NOT implement adtf::base::ant::IConfiguration. This Filter has no Properties!

Definition at line 33 of file filterbase.h.

Member Typedef Documentation

◆ tInitStage

private d-pointer

The tInitStage indicates the Init Stages call.

See also
cFilterBase for the Init Stages.

Definition at line 46 of file filterbase.h.

Constructor & Destructor Documentation

◆ cFilterBase()

Constructor.

Remarks
The name of the filter is set after the filter is constructed.

Member Function Documentation

◆ Init()

tResult Init ( tInitStage  eStage)
override

Implements the default cFilterLevelmachine state machine call.

This will be called during filter state changes and can be overridden by the filter implementation.

Note
Make sure to call the parent implementation of the used base class at the beginning within your overriding function!
Parameters
[in]eStageThe Init Stage. See state machine documentation in Filter State Machine.
Returns
Standard Result Code. Any Error will break further initialization of the cFilterGraph and the Runlevel change.

◆ RegisterBindingObject() [1/3]

tResult RegisterBindingObject

Registers the given pBindingClient.

Parameters
[in]pBindingClientThe binding client to register.
Returns
see return values of RegisterBindingObject(IBindingObject).

◆ RegisterBindingObject() [2/3]

virtual tResult RegisterBindingObject

RegisterBindingObject will register the given pBindingObject within the internal registry.

Parameters
[in]pBindingObjectThe binding object to register.
Returns
Standard Result Code.
Return values
ERR_NOERRORNo Error.
ERR_UNEXPECTEDInternal Error occurred.
ERR_POINTERpBindingObject is invalid.
ERR_INVALID_ARGCan not register a Object with the same name twice.

◆ RegisterBindingObject() [3/3]

tResult RegisterBindingObject

Registers the given pBindingServer.

Parameters
[in]pBindingServerThe binding server to register.
Returns
see return values of RegisterBindingObject(IBindingObject).

◆ RegisterInnerPipe()

virtual tResult RegisterInnerPipe

Registers and publishes an inner ITriggerPipe object to the IRuntimeBehaviour.

Parameters
pTriggerPipe[in] The ITriggerPipe to register.
Returns
Standard Result Code

◆ RegisterRunner() [1/2]

virtual tResult RegisterRunner

Create and Registers a IRunner object for your oRunnable with the name strName.

Parameters
strName[in] Name of the Runner to create and register.
oRunnable[in] The reference to the Runnable implemetation which will be called.
Remarks
Make sure the instance of the oRunnable lives as long the runner is registered.
Returns
Standard Result Code
Return values
ERR_INVALID_ARGA Runner with the same name is already registered.

◆ RegisterRunner() [2/2]

virtual tResult RegisterRunner

Registers and publishes a IRunner object to the IRuntimeBehaviour.

This makes sure the runner is only registered once. The Runner has to have a name already set. You can not register a Runner with the same name twice.

Parameters
pRunner[in] The object reference to the Runner which will be published.
Returns
Standard Result Code
Return values
ERR_INVALID_ARGA Runner with the same name is already registered.

◆ SetState()

tResult SetState ( IFilter::tFilterState  eState)
override

Sets the state of the filter.

The SetState method sets the filters's state (running or stopped). Please see Filter State Machine for further information on when the state of a filter changes.

Parameters
[in]eStateThe filters state to switch to.
Returns
Returns a standard result code.
Remarks
Implements IFilter::SetState.

◆ Shutdown()

tResult Shutdown ( tInitStage  eStage)
override

Implements the default cFilterLevelmachine state machine call.

This will be called during filter state changes and can be overridden by the filter implementation.

Note
Make sure to call the parent implementation of the used base class at the end within your overriding function!
Parameters
[in]eStageThe Init Stage. See state machine documentation in Filter State Machine.
Returns
Standard Result Code.

◆ Start()

tResult Start ( )
override

Implements the default cFilterLevelmachine state machine calls.

This will be called during filter state changes and can be overridden by the filter implementation.

Note
Make sure to call the parent implementation of the used base class at the beginning within your overriding function!

See Filter State Machine.

Returns
Standard Result Code.

◆ Stop()

tResult Stop ( )
override

Implements the default cFilterLevelmachine state machine calls.

Keep in mind, that streaming and triggers might still occur during and after this function is called. Streaming will only have stopped completely before any other following state change. If your filter has any blocking operations during the handling of triggers, make sure that you cancel them in this function.

This will be called during filter state changes and can be overridden by the filter implementation.

Note
Make sure to call the parent implementation of the used base class at the end within your overriding function!

See Filter State Machine.

Returns
Standard Result Code.

Member Data Documentation

◆ _clock

A reference to the clock service.

The variable will be set, in cFilterBase::Init(StageFirst).

See also
IReferenceClock.
Warning
Always check for NULL, it is possible the filter will run within an environment where the clock is not available.

Definition at line 55 of file filterbase.h.