ADTF  3.12.8
cGraphObject

Base class for adtf::filter::flash::cFilter, adtf::filter::flash::cSampleStreamingSource and adtf::filter::flash::cSampleStreamingSink. More...

Inheritance diagram for cGraphObject:

Classes

class  cDataTriggerHint
 Hint that a Data-In trigger should be created to trigger a Runner. More...
 
class  cNoTriggerHint
 No hint on which Active Runner to use. More...
 
class  cThreadTriggerHint
 Hint that a thread Active Runner should be used to trigger a Runner. More...
 
class  cTimerTriggerHint
 Hint that a timer Active Runner should be used to trigger a Runner. More...
 
class  cTriggerHint
 Base class for hints that give information on which Active Runner should be connected to a newly created Runner (with CreateRunner()). More...
 

Public Member Functions

 cGraphObject ()
 Default Constructor.
 
 ~cGraphObject () override
 Destructor.
 
virtual tResult Process (base::flash::tNanoSeconds tmTrigger, streaming::ant::IRunner *pRunner)
 The default Runner function of the graph object. More...
 
virtual tResult ProcessInput (base::flash::tNanoSeconds tmTrigger, streaming::flash::ISampleReader *pReader)
 Default method to process input data. More...
 
virtual tResult ProcessInput (streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::ISample > &pSample)
 Called by the default implementation of ProcessInput(base::flash::tNanoSeconds, streaming::flash::ISampleReader*) for each sample that the given reader currently provides. More...
 
virtual tResult ProcessInput (streaming::flash::ISampleReader *pReader, base::flash::tNanoSeconds tmSample, const tVoid *pSampleData, tSize nSampleDataSize)
 Called by the default implementation of ProcessInput(streaming::flash::ISampleReader*, const ucom::ant::iobject_ptr<const streaming::ant::ISample>&) with the data of a sample that the reader provided. More...
 
template<typename ReaderType = cPinReader>
ReaderType * CreateInputPin (const tChar *strName, tBool bDataInTrigger=true, tBool bForwardTriggerViaOutputPins=true)
 Creates a new input pin with an anonymous stream type. More...
 
template<typename ReaderType = cPinReader>
ReaderType * CreateInputPin (const tChar *strName, const cStreamTypeHelper &oType, tBool bDataInTrigger=true, tBool bForwardTriggerViaOutputPins=true)
 Creates a new input pin with a given stream type. More...
 
template<typename ReaderType = cPinReader>
ReaderType * CreateInputPinWithCallback (const tChar *strName, const cStreamTypeHelper &oType, std::function< tResult(base::flash::tNanoSeconds)> fnTriggerCallback, tBool bForwardTriggerViaOutputPins=true)
 Creates a new input pin with a given stream type. More...
 
template<typename ReaderType = cPinReader>
ReaderType * CreateInputPinWithCallback (const tChar *strName, const cStreamTypeHelper &oType, std::function< tResult(const ucom::ant::iobject_ptr< const streaming::ant::ISample > &)> fnSampleCallback, tBool bForwardTriggerViaOutputPins=true)
 Creates a new input pin with a given stream type. More...
 
template<typename ReaderType = cPinReader>
ReaderType * CreateInputPinWithCallback (const tChar *strName, const cStreamTypeHelper &oType, std::function< tResult(base::flash::tNanoSeconds, const tVoid *, tSize)> fnSampleDataCallback, tBool bForwardTriggerViaOutputPins=true)
 Creates a new input pin with a given stream type. More...
 
template<typename Type , typename ReaderType = cPinReader>
ReaderType * CreateInputPinWithCallback (const tChar *strName, const cStreamTypeHelper &oType, std::function< tResult(base::flash::tNanoSeconds, const Type &)> fnDataCallback, tBool bForwardTriggerViaOutputPins=true)
 Creates a new input pin with a given stream type. More...
 
virtual tResult AcceptType (streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
 Called whenever a new type is read from a reader that has no other accept type callback (streaming::ant::cSampleReader::SetAcceptTypeCallback) registered. More...
 
template<typename WriterType = cPinWriter>
WriterType * CreateOutputPin (const tChar *strName)
 Creates a new output pin without an initial stream type. More...
 
template<typename WriterType = cPinWriter>
WriterType * CreateOutputPin (const tChar *strName, const cStreamTypeHelper &oType)
 Creates a new output pin with a given stream type. More...
 
streaming::ant::IRunnerCreateRunner (const tChar *strName, const cTriggerHint &oTriggerHint=cNoTriggerHint(), tBool bForwardTriggerViaOutputPins=true)
 Creates a new Runner that can be triggered by an Active Runner. More...
 
streaming::ant::IRunnerCreateRunner (const tChar *strName, std::function< tResult(base::flash::tNanoSeconds)> fnRunFunction, const cTriggerHint &oTriggerHint=cNoTriggerHint(), tBool bForwardTriggerViaOutputPins=true)
 Creates a new Runner that can be triggered by an Active Runner. More...
 
template<typename Interface , typename Instance >
tVoid CreateInterfaceServer (const tChar *strName, ucom::ant::enable_object_ptr_from_this< Instance > *pInstance)
 Creates an interface server binding object. More...
 
template<typename Interface >
tVoid CreateInterfaceServer (const tChar *strName, const ucom::ant::iobject_ptr< Interface > &pInstance)
 Creates an interface server binding object. More...
 
template<typename Interface >
interface_client< Interface > CreateInterfaceClient (const tChar *strName)
 Creates an interface client binding object. More...
 
template<typename ReaderType = cPinReader>
std::shared_ptr< ReaderType > CreateReader (const tChar *strName, const cStreamTypeHelper &oType)
 Creates and intializes a new sample reader. More...
 
template<typename WriterType = cPinWriter>
std::shared_ptr< WriterType > CreateWriter (const tChar *strName, const cStreamTypeHelper &oType)
 Creates and intializes a new sample reader. More...
 
ucom::ant::object_ptr< streaming::ant::IRunnerRegisterRunner (const tChar *strName, std::function< tResult(base::flash::tNanoSeconds)> fnRunMethod)
 Creates and registers a new Runner. More...
 
tResult RegisterRunner (const ucom::ant::iobject_ptr< streaming::ant::IRunner > &pRunner) override
 This is here for compatibility reasons. More...
 
tResult RegisterRunner (const tChar *strName, base::flash::IRunnable &oRunnable)
 This is here for compatibility reasons. More...
 
tResult RegisterRunner (const tChar *strName, adtf::base::ant::IRunnable &oRunnable) override
 This is here for compatibility reasons. More...
 
tResult ConfigureDataInTrigger (const tChar *strRunnerName, const tChar *strPinName)
 This is here for compatibility reasons. More...
 
tResult ConfigureDataOutTrigger (const tChar *strRunnerName, const tChar *strPinName)
 This is here for compatibility reasons. More...
 
tResult ConfigureTimerTrigger (const tChar *strRunnerName, tTimeStamp tmPeriod)
 This is here for compatibility reasons. More...
 
tResult ConfigureThreadTrigger (const tChar *strRunnerName, tBool bCallCyclic)
 This is here for compatibility reasons. More...
 
virtual tResult RequestDynamicInputPin (const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
 Called whenever a new dynamic input pin is requested. More...
 
virtual tResult RequestDynamicOutputPin (const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
 Called whenever a new dynamic output pin is requested. More...
 
virtual tResult RequestDynamicInterfaceClient (const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
 Called whenever a new dynamic interface client binding object is requested. More...
 
virtual tResult RequestDynamicInterfaceServer (const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
 Called whenever a new dynamic interface server binding object is requested. More...
 
tResult RequestPin (const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType, ucom::ant::iobject_ptr< streaming::ant::IInPin > &pInPin)
 For internal use. This will call RequestDynamicInputPin().
 
tResult RequestPin (const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType, ucom::ant::iobject_ptr< streaming::ant::IOutPin > &pOutPin)
 For internal use. This will call RequestDynamicOutputPin().
 
tResult RequestBindingObject (const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType, ucom::ant::iobject_ptr< streaming::ant::IBindingClient > &pClient)
 For internal use. This will call RequestDynamicInterfaceClient().
 
tResult RequestBindingObject (const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType, ucom::ant::iobject_ptr< streaming::ant::IBindingServer > &pServer)
 For internal use. This will call RequestDynamicInterfaceServer().
 
tVoid RegisterPropertyVariable (const tChar *strName, base::ant::cPropertyVariable &oPropertyVariable)
 Registers a new property variable which will always reflect the value of a property. More...
 
tVoid SetDescription (const tChar *strDescription)
 Sets the description information that tools can display. More...
 
tVoid SetEditor (const tChar *strName, const tChar *strUrl)
 Sets the editor information that tools can use to edit the objects properties, pins etc. More...
 
- Public Member Functions inherited from cNamedGraphObject
tResult GetName (base::ant::IString &&strName) const
 
tResult SetName (const tChar *strName)
 
tResult SetParent (const ucom::ant::IObject *pParentObject)
 
tResult GetParent (const ucom::ant::IObject *&poParentObject) const
 
- Public Member Functions inherited from cDataBinding
tResult GetPins (ucom::ant::iobject_list< IPin > &lstPins) const
 Returns the current Pins (only const access). More...
 
tResult FindPin (const tChar *strName, ucom::ant::iobject_ptr< ucom::ant::IObject > &pPin) const
 Find a Pin with the name of strName (only const access) More...
 
virtual tResult RegisterPin (const ucom::ant::iobject_ptr< IPin > &pIPin)
 Registers a Pin in a pin list. More...
 
tResult RegisterPin (const ucom::ant::iobject_ptr< IInPin > &pIInPin)
 Registers a InPin in a pin list. More...
 
tResult RegisterPin (const ucom::ant::iobject_ptr< IOutPin > &pIOutPin)
 Registers a InPin in a pin list. More...
 
virtual tResult UnregisterPin (const ucom::ant::iobject_ptr< IPin > &pIPin)
 Unregisters a Pin from the pin list. More...
 
tResult ReleasePins ()
 Unregisters all Pins from the pin list. More...
 
virtual tResult ActivatePins ()
 Activate all pins.
 
virtual tResult DeactivatePins ()
 Deactivate all pins.
 
tResult Disconnect ()
 Disconnect all pins.
 
- Public Member Functions inherited from cInterfaceBinding
 cInterfaceBinding ()
 CTOR.
 
virtual ~cInterfaceBinding ()
 DTOR.
 
tResult GetBindingObjects (ucom::ant::iobject_list< IBindingObject > &lstBindingObject)
 Return a list of all Binding Objects on lstBindingObject. More...
 
tResult GetBindingObjects (ucom::ant::iobject_list< const IBindingObject > &lstBindingObject) const
 Return a list of all Binding Objects on lstBindingObject. More...
 
tResult FindBindingObject (const tChar *strName, ucom::ant::iobject_ptr< const ucom::ant::IObject > &pIBindingObject) const
 This Function will search a binding object with the given strName and return it on pIBindingObject. More...
 
tResult FindBindingObject (const tChar *strName, ucom::ant::iobject_ptr< ucom::ant::IObject > &pIBindingObject)
 This Function will search a binding object with the given strName and return it on pIBindingObject. More...
 
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...
 
tResult UnregisterBindingObject (const ucom::ant::iobject_ptr< const IBindingObject > &pBindingObject)
 Unregisters the given pBindingObject. More...
 
tResult Unbind ()
 Will Unbind (IBindingObject::Unbind ) every registered binding objects registered with RegisterBindingObject. More...
 
tResult ReleaseBindingObjects ()
 ReleaseBindingObjects will Unbind (IBindingObject::Unbind ) every registered binding objects registered with RegisterBindingObject and unregister them automatically. More...
 
- Public Member Functions inherited from cRuntimeBehaviour
tResult GetRunners (ucom::ant::iobject_list< IRunner > &lstRunners) const
 copydoc IRuntimeBehaviour::GetRunners
 
tResult FindRunner (const tChar *strName, ucom::ant::iobject_ptr< ucom::ant::IObject > &pRunner) const
 copydoc IRuntimeBehaviour::FindRunner
 
tResult GetInnerPipes (ucom::ant::iobject_list< ITriggerPipe > &lstInnerpTriggerPipe) const
 copydoc IRuntimeBehaviour::GetInnerPipes
 
virtual tResult UnregisterRunner (const ucom::ant::iobject_ptr< IRunner > &pRunner)
 Unregisters a Runner. More...
 
tResult ReleaseRunners ()
 Release every registered Runners
More...
 
virtual tResult RegisterInnerPipe (const ucom::ant::iobject_ptr< ITriggerPipe > &pTriggerPipe)
 Registers and publishes an inner ITriggerPipe object to the IRuntimeBehaviour. More...
 
virtual tResult UnregisterInnerPipe (const ucom::ant::iobject_ptr< ITriggerPipe > &pTriggerPipe)
 Unregisters an inner ITriggerPipe object. More...
 
tResult ReleaseTriggerPipes ()
 Release and unregister every registered TriggerPipes. More...
 
- Public Member Functions inherited from cConfiguration
 cConfiguration ()
 Default constructor.
 
virtual ~cConfiguration ()
 Destructor.
 
tResult GetProperties (adtf::ucom::ant::iobject_ptr< const IProperties > &pProperties) const
 Gets the properties with read access. More...
 
tResult GetProperties (adtf::ucom::ant::iobject_ptr< IProperties > &pProperties)
 Gets the properties with read access. More...
 
tResult AttachConfiguration (const tChar *strName, IConfiguration &oAttachedConfiguration)
 Attaches the given configuration and its properties as property tree item of this. More...
 
tResult DetachConfiguration (const tChar *strName)
 Detaches a configuration with the specified name. More...
 
tResult RegisterPropertyVariable (const tChar *strName, ant::cPropertyVariable &oPropertyVariable)
 Registers a property variable that always reflects the current value of the property. More...
 

Protected Member Functions

tVoid SetupStreamer (std::shared_ptr< streaming::flash::ISampleStreamer > pStreamer, const tChar *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
 Used by the templated CreateInputPin() and CreateOutputPin() methods. More...
 
tVoid CreateInputPin (std::shared_ptr< streaming::flash::ISampleReader > pReader, tBool bDataInTrigger=true, tBool bForwardTriggerViaOutputPins=true)
 The implementation used by CreateInputPin(const tChar*, tBool, tBool) and CreateInputPin(const tChar*, const cStreamTypeHelper&, tBool, tBool)
 
tVoid CreateInputPin (std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(base::flash::tNanoSeconds)> fnTriggerCallback, tBool bForwardTriggerViaOutputPins=true)
 The implementation used by CreateInputPin(const tChar*, const cStreamTypeHelper&, std::function<tResult(base::flash::tNanoSeconds)>, tBool)
 
tVoid CreateInputPin (std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(const ucom::ant::iobject_ptr< const streaming::ant::ISample > &)> fnSampleCallback, tBool bForwardTriggerViaOutputPins=true)
 The implementation used by CreateInputPin(const tChar*, const cStreamTypeHelper&, std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)>, tBool)
 
tVoid CreateInputPin (std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(base::flash::tNanoSeconds, const tVoid *, tSize)> fnSampleDataCallback, tBool bForwardTriggerViaOutputPins=true)
 The implementation used by CreateInputPin(const tChar*, const cStreamTypeHelper&, std::function<tResult(base::flash::tNanoSeconds, const tVoid*, tSize)>, tBool)
 
tVoid CreateOutputPin (std::shared_ptr< streaming::flash::ISampleWriter > pWriter)
 The implementation used by CreateOutputPin(const tChar*, const cStreamTypeHelper&), CreateOutputPin(const tChar*, const cStreamTypeHelper&).
 
- Protected Member Functions inherited from cDataBinding
 cDataBinding ()
 CTOR.
 
virtual ~cDataBinding ()
 DTOR.
 
- Protected Member Functions inherited from cRuntimeBehaviour
 cRuntimeBehaviour ()
 CTOR.
 
virtual ~cRuntimeBehaviour ()
 DTOR.
 

Protected Attributes

ucom::ant::object_ptr< services::ant::IReferenceClock_clock
 A reference to the clock service. More...
 
std::unique_ptr< cImplementation > m_pImplementation
 
- Protected Attributes inherited from cNamedGraphObject
const adtf::ucom::ant::IObjectm_pParent = nullptr
 parent of the named object
 
std::string m_strName
 name of the
 

Detailed Description

Base class for adtf::filter::flash::cFilter, adtf::filter::flash::cSampleStreamingSource and adtf::filter::flash::cSampleStreamingSink.

Basic Data, Interface and Runtime Behaviour

The class provides many convenience member functions that facilitate the following operations:

Dynamic Objects

For the implementation of dynamic pins, interface clients and interface servers overwrite one or more of the following virtual functions:

Dependencies

To inform the ADTF Configuration Editor about required interfaces, please see Setup dependencies between components.

Error Handling

All Create* methods throw exceptions in case of errors. The ADTF SDK is prepared to cope with exceptions within any of the graph objects methods, especially in your subclasses' constructors. You are also free to throw exceptions (THROW_ERROR_DESC) in methods that return tResult error codes. But if you call methods that return a tResult error code yourself, make sure to wrap them with the appropriate RETURN_IF_FAILED or THROW_IF_FAILED macros.

Definition at line 177 of file graph_object.h.

Member Function Documentation

◆ AcceptType()

virtual tResult AcceptType ( streaming::flash::ISampleReader pReader,
const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &  pType 
)
virtual

Called whenever a new type is read from a reader that has no other accept type callback (streaming::ant::cSampleReader::SetAcceptTypeCallback) registered.

Override this to change the default behaviour and/or react to type changes.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateInputPin("input");
}
{
// accept any type that has a given property and property value
if (adtf::streaming::get_property<tUInt32>(*pType.Get(), "my_important_property", 0) != 123)
{
RETURN_ERROR_DESC(ERR_INVALID_TYPE, "my_important_property is not 123");
}
}
};
Parameters
[in]pReaderThe reader that read the new type.
[in]pTypeThe new stream type.
Returns
Standard result. Return an error if you do not accept the new type. The reader will discard samples as long as no valid stream type was received.

Referenced by cGraphObject::CreateReader().

◆ ConfigureDataInTrigger()

tResult ConfigureDataInTrigger ( const tChar strRunnerName,
const tChar strPinName 
)

This is here for compatibility reasons.

CreateInputPin() will do this for you.

See also
filter::ant::cFilter::ConfigureDataInTrigger.

◆ ConfigureDataOutTrigger()

tResult ConfigureDataOutTrigger ( const tChar strRunnerName,
const tChar strPinName 
)

This is here for compatibility reasons.

CreateOutputPin() and CreateRunner() will do this for you.

See also
filter::ant::cFilter::ConfigureDataOutTrigger.

◆ ConfigureThreadTrigger()

tResult ConfigureThreadTrigger ( const tChar strRunnerName,
tBool  bCallCyclic 
)

This is here for compatibility reasons.

CreateRunner() will do this for you.

See also
filter::ant::cFilter::ConfigureThreadTrigger.

◆ ConfigureTimerTrigger()

tResult ConfigureTimerTrigger ( const tChar strRunnerName,
tTimeStamp  tmPeriod 
)

This is here for compatibility reasons.

CreateRunner() will do this for you.

See also
filter::ant::cFilter::ConfigureTimerTrigger.

◆ CreateInputPin() [1/2]

ReaderType * CreateInputPin ( const tChar strName,
tBool  bDataInTrigger = true,
tBool  bForwardTriggerViaOutputPins = true 
)

Creates a new input pin with an anonymous stream type.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateInputPin("input");
}
{
LOG_INFO("received a sample");
}
};
Template Parameters
ReaderTypeThe reader implementation that is associated with the pin.
Parameters
[in]strNameThe name of the pin.
[in]bDataInTriggerIf true, an inner trigger pipe will be created from the pin to the ProcessInput() function.
[in]bForwardTriggerViaOutputPinsIf true, triggers will be forwarded via all output pins after ProcessInput() was called.
Returns
A pointer to a reader associated with the pin. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

Definition at line 960 of file graph_object.h.

Referenced by cGraphObject::CreateInputPin(), and cGraphObject::CreateInputPinWithCallback().

◆ CreateInputPin() [2/2]

ReaderType * CreateInputPin ( const tChar strName,
const cStreamTypeHelper oType,
tBool  bDataInTrigger = true,
tBool  bForwardTriggerViaOutputPins = true 
)

Creates a new input pin with a given stream type.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
//this will define an ID of the filter can be used to create the filter
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
}
{
LOG_INFO("received a sample with value = %u",
}
};
Template Parameters
ReaderTypeThe reader implementation that is associated with the pin.
Parameters
[in]strNameThe name of the pin.
[in]oTypeThe stream type.
[in]bDataInTriggerIf true, an inner trigger pipe will be created from the pin to the ProcessInput() function.
[in]bForwardTriggerViaOutputPinsIf true, triggers will be forwarded via all output pins after ProcessInput() was called.
Returns
A pointer to a reader associated with the pin. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

Definition at line 970 of file graph_object.h.

References cGraphObject::CreateInputPin().

◆ CreateInputPinWithCallback() [1/4]

ReaderType * CreateInputPinWithCallback ( const tChar strName,
const cStreamTypeHelper oType,
std::function< tResult(base::flash::tNanoSeconds)>  fnTriggerCallback,
tBool  bForwardTriggerViaOutputPins = true 
)

Creates a new input pin with a given stream type.

Mind that the writers are not flushed automatically after your callback finishes, so make sure to call adtf::streaming::flash::ISampleWriter::Flush() after you're done writing.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
m_pReader = CreateInputPinWithCallback("input",
{
while (IS_OK(m_pReader->GetNextSample(pSample)))
{
LOG_INFO("received a sample with value = %u",
}
});
}
private:
adtf::streaming::ISampleReader* m_pReader = nullptr;
};
Template Parameters
ReaderTypeThe reader implementation that is associated with the pin.
Parameters
[in]strNameThe name of the pin.
[in]oTypeThe stream type.
[in]fnTriggerCallbackAn inner trigger pipe (data in trigger) will be created from the pin to this callback.
[in]bForwardTriggerViaOutputPinsIf true, triggers will be forwarded via all output pins after fnTriggerCallback was called.
Returns
A pointer to a reader associated with the pin. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

Definition at line 981 of file graph_object.h.

References cGraphObject::CreateInputPin().

◆ CreateInputPinWithCallback() [2/4]

ReaderType * CreateInputPinWithCallback ( const tChar strName,
const cStreamTypeHelper oType,
std::function< tResult(const ucom::ant::iobject_ptr< const streaming::ant::ISample > &)>  fnSampleCallback,
tBool  bForwardTriggerViaOutputPins = true 
)

Creates a new input pin with a given stream type.

Mind that the writers are not flushed automatically after your callback finishes, so make sure to call adtf::streaming::flash::ISampleWriter::Flush() after you're done writing.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
{
LOG_INFO("received a sample with value = %u",
});
}
};
Template Parameters
ReaderTypeThe reader implementation that is associated with the pin.
Parameters
[in]strNameThe name of the pin.
[in]oTypeThe stream type.
[in]fnSampleCallbackAn inner trigger pipe (data in trigger) will be created from the pin to this callback. This will be called for each sample available when the trigger occured.
[in]bForwardTriggerViaOutputPinsIf true, triggers will be forwarded via all output pins after fnTriggerCallback was called.
Returns
A pointer to a reader associated with the pin. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

Definition at line 992 of file graph_object.h.

References cGraphObject::CreateInputPin().

◆ CreateInputPinWithCallback() [3/4]

ReaderType * CreateInputPinWithCallback ( const tChar strName,
const cStreamTypeHelper oType,
std::function< tResult(base::flash::tNanoSeconds, const tVoid *, tSize)>  fnSampleDataCallback,
tBool  bForwardTriggerViaOutputPins = true 
)

Creates a new input pin with a given stream type.

Mind that the writers are not flushed automatically after your callback finishes, so make sure to call adtf::streaming::flash::ISampleWriter::Flush() after you're done writing.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
[](adtf::base::tNanoSeconds /*tmSample*/, const tVoid* /*pSampleData*/, tSize nSampleSize) -> tResult
{
LOG_INFO("received a sample of size %d", nSampleSize);
});
}
};
Template Parameters
ReaderTypeThe reader implementation that is associated with the pin.
Parameters
[in]strNameThe name of the pin.
[in]oTypeThe stream type.
[in]fnSampleDataCallbackAn inner trigger pipe (data in trigger) will be created from the pin to this callback. This will be called with data from each sample available when the trigger occured.
[in]bForwardTriggerViaOutputPinsIf true, triggers will be forwarded via all output pins after fnTriggerCallback was called.
Returns
A pointer to a reader associated with the pin. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

Definition at line 1003 of file graph_object.h.

References cGraphObject::CreateInputPin().

◆ CreateInputPinWithCallback() [4/4]

ReaderType * CreateInputPinWithCallback ( const tChar strName,
const cStreamTypeHelper oType,
std::function< tResult(base::flash::tNanoSeconds, const Type &)>  fnDataCallback,
tBool  bForwardTriggerViaOutputPins = true 
)

Creates a new input pin with a given stream type.

Mind that the writers are not flushed automatically after your callback finishes, so make sure to call adtf::streaming::flash::ISampleWriter::Flush() after you're done writing.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
//this will define an ID of the filter can be used to create the filter
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateInputPinWithCallback<tUInt32>("input",
[](adtf::base::tNanoSeconds /*tmSample*/, const tUInt32& nSampleData) -> tResult
{
LOG_INFO("received a sample with data: %u", nSampleData);
});
}
};
Template Parameters
TypeThe data type that the sample data should be cast to.
ReaderTypeThe reader implementation that is associated with the pin.
Parameters
[in]strNameThe name of the pin.
[in]oTypeThe stream type.
[in]fnDataCallbackAn inner trigger pipe (data in trigger) will be created from the pin to this callback. This will be called with data from each sample cast to the given type available when the trigger occured.
[in]bForwardTriggerViaOutputPinsIf true, triggers will be forwarded via all output pins after fnTriggerCallback was called.
Returns
A pointer to a reader associated with the pin. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

Definition at line 1015 of file graph_object.h.

References adtf::streaming::flash::get_sample_time(), RETURN_ERROR_DESC, and RETURN_IF_FAILED.

◆ CreateInterfaceClient()

interface_client< Interface > CreateInterfaceClient ( const tChar strName)

Creates an interface client binding object.

Example Usage

class IMyInterface: public adtf::ucom::IObject
{
public:
ADTF_IID(IMyInterface, "my_interface.iid");
public:
virtual tVoid DoSomething() = 0;
};
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
m_oInterfaceClient = CreateInterfaceClient<IMyInterface>("my_interface");
CreateRunner("do_something");
}
adtf::streaming::IRunner* /*pRunner*/) override
{
m_oInterfaceClient->DoSomething();
}
private:
};
Template Parameters
InterfaceThe interface that the client object expects.
Parameters
strNameThe name of the client object.
Returns
An interface client wrapper object.
Exceptions
tResultIn case of an error.

Definition at line 1077 of file graph_object.h.

References cInterfaceBinding::RegisterBindingObject(), and THROW_IF_FAILED.

◆ CreateInterfaceServer() [1/2]

tVoid CreateInterfaceServer ( const tChar strName,
ucom::ant::enable_object_ptr_from_this< Instance > *  pInstance 
)

Creates an interface server binding object.

This overload can be used when the interface is implemented by the subclass of cGraphObject directly. To do so your subclass has to inherit from ucom::ant::enable_object_ptr_from_this. This way the server object will store only a weak reference to your object in order to prevent circular references. Due to this fact, you cannot use this overload in your constructor as the ucom::ant::enable_object_ptr_from_this::object_ptr_from_this() is only available after your object has been fully constructed with ucom::ant::make_object_ptr().

Example Usage

class IMyInterface: public adtf::ucom::IObject
{
public:
ADTF_IID(IMyInterface, "my_interface.iid");
public:
virtual tVoid DoSomething() = 0;
};
class cMyFilter: public adtf::ucom::object<adtf::filter::cFilter, IMyInterface>,
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
tResult Init(tInitStage eStage) override
{
if (eStage == StageFirst)
{
CreateInterfaceServer<IMyInterface>("my_interface", this);
}
}
tVoid DoSomething() override
{
LOG_INFO("something");
}
};
Template Parameters
InterfaceThe interface that the server object should publish.
InstanceAutomatically deducted, used to differentiate between the template overloads.
Parameters
strNameThe name of the server object.
pInstancePass in the this pointer.
Exceptions
tResultIn case of an error.

Definition at line 1048 of file graph_object.h.

References enable_object_ptr_from_this< T >::object_ptr_from_this(), cInterfaceBinding::RegisterBindingObject(), THROW_ERROR_DESC, THROW_IF_FAILED, and adtf::ucom::ant::ucom_object_ptr_cast().

◆ CreateInterfaceServer() [2/2]

tVoid CreateInterfaceServer ( const tChar strName,
const ucom::ant::iobject_ptr< Interface > &  pInstance 
)

Creates an interface server binding object.

Example Usage

class IMyInterface: public adtf::ucom::IObject
{
public:
ADTF_IID(IMyInterface, "my_interface.iid");
public:
virtual tVoid DoSomething() = 0;
};
class cMyImplementation: public adtf::ucom::object<IMyInterface>
{
public:
tVoid DoSomething() override
{
LOG_INFO("something");
}
};
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateInterfaceServer<IMyInterface>("my_interface",
adtf::ucom::ucom_object_ptr_cast<IMyInterface>(adtf::ucom::make_object_ptr<cMyImplementation>()));
}
};
Template Parameters
InterfaceThe interface that the server object should publish.
Parameters
strNameThe name of the server object.
pInstanceThe object implementing the interface.
Exceptions
tResultIn case of an error.

Definition at line 1066 of file graph_object.h.

References cInterfaceBinding::RegisterBindingObject(), THROW_IF_FAILED, and adtf::ucom::ant::ucom_object_ptr_cast().

◆ CreateOutputPin() [1/2]

WriterType * CreateOutputPin ( const tChar strName)

Creates a new output pin without an initial stream type.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateInputPin("input");
m_pWriter = CreateOutputPin("output");
}
{
m_pWriter->ChangeType(pType);
}
{
m_pWriter->Write(pSample);
}
private:
adtf::streaming::ISampleWriter* m_pWriter = nullptr;
};
Template Parameters
WriterTypeThe writer implementation that is associated with the pin.
Parameters
[in]strNameThe name of the pin.
Returns
A pointer to a writer associated with the pin. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

Definition at line 1034 of file graph_object.h.

Referenced by cGraphObject::CreateOutputPin(), and cGraphObject::CreateRequestableOutputPin().

◆ CreateOutputPin() [2/2]

WriterType * CreateOutputPin ( const tChar strName,
const cStreamTypeHelper oType 
)

Creates a new output pin with a given stream type.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
//this will define an ID of the filter can be used to create the filter
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
}
{
oNewData += 1234;
m_pWriter->Write(oNewData.Release());
}
private:
adtf::streaming::ISampleWriter* m_pWriter = nullptr;
};
Template Parameters
WriterTypeThe writer implementation that is associated with the pin.
Parameters
[in]strNameThe name of the pin.
[in]oTypeThe stream type.
Returns
A pointer to a writer associated with the pin. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

Definition at line 1040 of file graph_object.h.

References cGraphObject::CreateOutputPin().

◆ CreateReader()

std::shared_ptr< ReaderType > CreateReader ( const tChar strName,
const cStreamTypeHelper oType 
)

Creates and intializes a new sample reader.

Most of the time you are better off using the CreateInputPin methods instead, but this method is provided for completeness.

Template Parameters
ReaderTypeThe reader implementation.
Parameters
[in]strNameThe name of the reader (which is used to name pins).
[in]oTypeThe stream type associated with the reader.
Returns
A shared pointer to the reader instance.
Exceptions
tResultIn case of an error.

Definition at line 1087 of file graph_object.h.

References cGraphObject::AcceptType(), cStreamTypeHelper::GetStreamType(), and cGraphObject::SetupStreamer().

◆ CreateRunner() [1/2]

streaming::ant::IRunner* CreateRunner ( const tChar strName,
const cTriggerHint oTriggerHint = cNoTriggerHint(),
tBool  bForwardTriggerViaOutputPins = true 
)

Creates a new Runner that can be triggered by an Active Runner.

This will call the Process() method each time the Runner is triggered.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateRunner("my_trigger_function");
}
adtf::streaming::IRunner* /*pRunner*/) override
{
LOG_INFO("received a trigger at: %ld", tmTrigger.nCount);
}
};

or

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
// create an input pin with disabled data triggers.
CreateRunner("my_trigger_function");
}
{
LOG_INFO("processed a sample with value = %u",
}
};
Parameters
[in]strNameThe name of the Runner.
[in]oTriggerHintA hint on which Active Runner should be used to trigger the Runner.
[in]bForwardTriggerViaOutputPinsIf true, triggers will be forwarded via all output pins after Process() was called.
Returns
A pointer to the new Runner. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

◆ CreateRunner() [2/2]

streaming::ant::IRunner* CreateRunner ( const tChar strName,
std::function< tResult(base::flash::tNanoSeconds)>  fnRunFunction,
const cTriggerHint oTriggerHint = cNoTriggerHint(),
tBool  bForwardTriggerViaOutputPins = true 
)

Creates a new Runner that can be triggered by an Active Runner.

This will call the fnRunFunction callback each time the Runner is triggered.

Mind that the writers are not flushed automatically after your fnRunFunction finishes, so make sure to call adtf::streaming::flash::ISampleWriter::Flush() after you're done writing.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateRunner("do_something", [](adtf::base::tNanoSeconds /*tmTrigger*/) -> tResult
{
LOG_INFO("something");
});
CreateRunner("do_something_else", [](adtf::base::tNanoSeconds /*tmTrigger*/) -> tResult
{
LOG_INFO("something else");
});
}
};
Parameters
[in]strNameThe name of the Runner.
[in]fnRunFunctionThe runners callback, called whenever the Runner is triggered.
[in]oTriggerHintA hint on which Active Runner should be used to trigger the runner.
[in]bForwardTriggerViaOutputPinsIf true, triggers will be forwarded via all output pins after fnRunFunction was called.
Returns
A pointer to the new Runner. This is valid as long as the cGraphObject instance exists.
Exceptions
tResultIn case of an error.

◆ CreateWriter()

std::shared_ptr< WriterType > CreateWriter ( const tChar strName,
const cStreamTypeHelper oType 
)

Creates and intializes a new sample reader.

Most of the time you are better off using the CreateOutputPin methods instead, but this method is provided for completeness.

Template Parameters
WriterTypeThe writer implementation.
Parameters
[in]strNameThe name of the writer (which is used to name pins).
[in]oTypeThe stream type associated with the writer.
Returns
A shared pointer to the writer instance.
Exceptions
tResultIn case of an error.

Definition at line 1100 of file graph_object.h.

References cStreamTypeHelper::GetStreamType(), and cGraphObject::SetupStreamer().

◆ Process()

virtual tResult Process ( base::flash::tNanoSeconds  tmTrigger,
streaming::ant::IRunner pRunner 
)
virtual

The default Runner function of the graph object.

This is called when a trigger occured for a Runner that you created with CreateRunner(const tChar*, const cTriggerHint&, tBool)

The default implementation calls ProcessInput(base::flash::tNanoSeconds, streaming::flash::ISampleReader*) for each input that has no data in triggers set up.

All calls to Process() and ProcessInput() are synchronized with the help of a single non-recursive mutex. If you want to avoid this overhead, use CreateInputPinWithCallback() or the callback versions of CreateRunner().

All writers will be flushed after this method is called.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateRunner("my_trigger_function");
}
adtf::streaming::IRunner* /*pRunner*/) override
{
LOG_INFO("received a trigger at: %ld", tmTrigger.nCount);
}
};
Parameters
[in]tmTriggerThe trigger timestamp.
[in]pRunnerPointer to the Runner that was triggered.
Returns
Standard result.

◆ ProcessInput() [1/3]

virtual tResult ProcessInput ( base::flash::tNanoSeconds  tmTrigger,
streaming::flash::ISampleReader pReader 
)
virtual

Default method to process input data.

Called when

This is the first method in the input processing chain:

will be called in order from within the default implementations of these methods. So you are free to override the one that fits your needs.

The default implementation calls ProcessInput(streaming::flash::ISampleReader*, const ucom::ant::iobject_ptr<const streaming::ant::ISample>&) for each sample that is currently available from the reader.

All calls to Process() and ProcessInput() are synchronized with the help of a single non-recursive mutex. If you want to avoid this overhead, use CreateInputPinWithCallback() or the callback versions of CreateRunner().

All writers will be flushed after this method is called.

Remarks
Use this function to iterate over all Samples from pReader yourself.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
m_pReader1 = CreateInputPin("input1");
m_pReader2 = CreateInputPin("input2");
}
adtf::streaming::ISampleReader* pReader) override
{
if (pReader == m_pReader1)
{
LOG_INFO("received a trigger on input1 at: %ld", tmTrigger.nCount);
}
else if (pReader == m_pReader2)
{
LOG_INFO("received a trigger on input2 at: %ld", tmTrigger.nCount);
}
}
private:
adtf::streaming::ISampleReader* m_pReader1 = nullptr;
adtf::streaming::ISampleReader* m_pReader2 = nullptr;
};
Parameters
[in]tmTriggerThe trigger timestamp.
[in]pReaderA reader that might have samples available.
Returns
Standard result.

◆ ProcessInput() [2/3]

virtual tResult ProcessInput ( streaming::flash::ISampleReader pReader,
const ucom::ant::iobject_ptr< const streaming::ant::ISample > &  pSample 
)
virtual

Called by the default implementation of ProcessInput(base::flash::tNanoSeconds, streaming::flash::ISampleReader*) for each sample that the given reader currently provides.

The default implementation calls ProcessInput(streaming::flash::ISampleReader*, base::flash::tNanoSeconds, const tVoid*, tSize) with the sample data.

All calls to Process() and ProcessInput() are synchronized with the help of a single non-recursive mutex. If you want to avoid this overhead, use CreateInputPinWithCallback() or the callback versions of CreateRunner().

All writers will be flushed after this method is called.

Warning
Do not use GetNextSample() for pReader because this has been already done and the Queue is empty! Use pReader only to check from which input the sample originates (i.e. by comparing it with the return value of your CreateInputPin() call). To iterate over all Samples yourself please use ProcessInput(base::flash::tNanoSeconds, streaming::flash::ISampleReader*) instead.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateInputPin("input");
}
{
LOG_INFO("received a sample");
}
};
Parameters
[in]pReaderThe reader that provided the sample
[in]pSampleThe sample.
Returns
Standard result

◆ ProcessInput() [3/3]

virtual tResult ProcessInput ( streaming::flash::ISampleReader pReader,
base::flash::tNanoSeconds  tmSample,
const tVoid pSampleData,
tSize  nSampleDataSize 
)
virtual

Called by the default implementation of ProcessInput(streaming::flash::ISampleReader*, const ucom::ant::iobject_ptr<const streaming::ant::ISample>&) with the data of a sample that the reader provided.

All calls to Process() and ProcessInput() are synchronized with the help of a single non-recursive mutex. If you want to avoid this overhead, use CreateInputPinWithCallback() or the callback versions of CreateRunner().

All writers will be flushed after this method is called.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateInputPin("input");
}
const tVoid* /*pSampleData*/,
tSize nSampleDataSize)
{
LOG_INFO("received a sample of size %d", nSampleDataSize);
}
};
Parameters
[in]pReaderThe reader that provided the sample.
[in]tmSampleThe sample timestamp.
[in]pSampleDataThe sample data.
[in]nSampleDataSizeThe size of the sample data.
Returns
Standard result.

◆ RegisterPropertyVariable()

tVoid RegisterPropertyVariable ( const tChar strName,
base::ant::cPropertyVariable oPropertyVariable 
)

Registers a new property variable which will always reflect the value of a property.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
RegisterPropertyVariable("my_property", m_nMyPropertyValue);
CreateRunner("log_property_value");
}
adtf::streaming::IRunner* /*pRunner*/) override
{
LOG_INFO("my_property = %u", *m_nMyPropertyValue);
}
private:
};
Parameters
[in]strNameThe name of the property.
[in]oPropertyVariableThe property variable that is associated with the property.
Exceptions
tResultIn case of an error.

◆ RegisterRunner() [1/4]

ucom::ant::object_ptr<streaming::ant::IRunner> RegisterRunner ( const tChar strName,
std::function< tResult(base::flash::tNanoSeconds)>  fnRunMethod 
)

Creates and registers a new Runner.

Also take a look at CreateRunner() which allows you to create inner pipes etc.

Parameters
[in]strNameThe name of the runner.
[in]fnRunMethodThe runners callback.
Returns
A shared pointer to the runner instance.
Exceptions
tResultIn case of an error.

Referenced by filter_with_trigger_function< TriggerFunctionImpl >::Init().

◆ RegisterRunner() [2/4]

tResult RegisterRunner ( const ucom::ant::iobject_ptr< streaming::ant::IRunner > &  pRunner)
overridevirtual

This is here for compatibility reasons.

CreateInputPin() and CreateRunner() will do this for you.

See also
streaming::ant::cRuntimeBehaviour::RegisterRunner.

Reimplemented from cRuntimeBehaviour.

◆ RegisterRunner() [3/4]

tResult RegisterRunner ( const tChar strName,
base::flash::IRunnable oRunnable 
)

This is here for compatibility reasons.

CreateInputPin() and CreateRunner() will do this for you.

See also
streaming::ant::cRuntimeBehaviour::RegisterRunner.

◆ RegisterRunner() [4/4]

tResult RegisterRunner ( const tChar strName,
adtf::base::ant::IRunnable oRunnable 
)
overridevirtual

This is here for compatibility reasons.

CreateInputPin() and CreateRunner() will do this for you.

See also
streaming::ant::cRuntimeBehaviour::RegisterRunner.

Reimplemented from cRuntimeBehaviour.

◆ RequestDynamicInputPin()

virtual tResult RequestDynamicInputPin ( const tChar strName,
const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &  pType 
)
virtual

Called whenever a new dynamic input pin is requested.

Call the appropriate CreateInputPin() or CreateInputPinWithCallback() method in your overridden implementation.

Example Usage

#include <string>
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
}
tResult RequestDynamicInputPin(const char *strName,
{
{
// if an anonymous input is requested, you are free to choose your own type.
// this is what is currently used by the plugin description generator.
}
else
{
// otherwise check if our type is compatible to the requested one.
"I support only plain tUInt32 stream types.");
}
m_oReaders.push_back(CreateInputPin(strName, oSupportedType));
}
{
m_pWriter->Write(pSample);
}
private:
std::vector<adtf::streaming::ISampleReader*> m_oReaders;
adtf::streaming::ISampleWriter* m_pWriter = nullptr;
};
Parameters
[in]strNameThe name of the requested pin.
[in]pTypeThe type requested for the pin.
Returns
Standard result.

◆ RequestDynamicInterfaceClient()

virtual tResult RequestDynamicInterfaceClient ( const tChar strName,
const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &  pType 
)
virtual

Called whenever a new dynamic interface client binding object is requested.

Call the appropriate CreateInterfaceClient() method in your overridden implementation.

Example Usage

#include <vector>
class IMyInterface: public adtf::ucom::IObject
{
public:
ADTF_IID(IMyInterface, "my_interface.iid");
public:
virtual tVoid DoSomething() = 0;
};
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateRunner("do_everything");
}
{
// pType may be a nullptr, check this case
if (pType.Get() &&
{
RETURN_ERROR_DESC(ERR_INVALID_TYPE, "I support only IMyInterface client objects.");
}
m_oClients.push_back(CreateInterfaceClient<IMyInterface>(strName));
}
adtf::streaming::IRunner* /*pRunner*/) override
{
for (const auto& oClient: m_oClients)
{
oClient->DoSomething();
}
}
public:
std::vector<adtf::filter::interface_client<IMyInterface>> m_oClients;
};
Parameters
[in]strNameThe name of the requested binding object.
[in]pTypeThe type requested for the binding object (the interface type).
Returns
Standard result.

◆ RequestDynamicInterfaceServer()

virtual tResult RequestDynamicInterfaceServer ( const tChar strName,
const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &  pType 
)
virtual

Called whenever a new dynamic interface server binding object is requested.

Call the appropriate CreateInterfaceServer() method in your overridden implementation.

Example Usage

#include <string>
class IMyInterface: public adtf::ucom::IObject
{
public:
ADTF_IID(IMyInterface, "my_interface.iid");
public:
virtual tVoid DoSomething() = 0;
};
class cMyImplementation: public adtf::ucom::object<IMyInterface>
{
public:
tVoid DoSomething() override
{
LOG_INFO("something");
}
};
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
{
// pType may be a nullptr, check this case
if (pType.Get() &&
{
RETURN_ERROR_DESC(ERR_INVALID_TYPE, "I support only IMyInterface server objects.");
}
CreateInterfaceServer<IMyInterface>(strName,
adtf::ucom::ucom_object_ptr_cast<IMyInterface>(adtf::ucom::make_object_ptr<cMyImplementation>()));
}
};
Parameters
[in]strNameThe name of the requested binding object.
[in]pTypeThe type requested for the binding object (the interface type).
Returns
Standard result.

◆ RequestDynamicOutputPin()

virtual tResult RequestDynamicOutputPin ( const tChar strName,
const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &  pType 
)
virtual

Called whenever a new dynamic output pin is requested.

Call the appropriate CreateOutputPin() method in your overridden implementation.

Example Usage

#include <vector>
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateRunner("generate_empty_samples");
}
tResult RequestDynamicOutputPin(const char *strName,
{
"I support only stream_type_plain<tUInt32>.");
m_oOutputs.push_back(CreateOutputPin(strName, oSupportedType));
}
adtf::streaming::IRunner* /*pRunner*/) override
{
auto pSample = oData.Release();
for (auto pWriter: m_oOutputs)
{
pWriter->Write(pSample);
}
}
private:
std::vector<adtf::streaming::ISampleWriter*> m_oOutputs;
};
Parameters
[in]strNameThe name of the requested pin.
[in]pTypeThe type requested for the pin.
Returns
Standard result.

◆ SetDescription()

tVoid SetDescription ( const tChar strDescription)

Sets the description information that tools can display.

Example Usage

Filter:

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
SetDescription("An example Filter that does nothing.");
}
};
See also
adtf::streaming::giant::set_description()
Parameters
[in]strDescriptionThe description.

◆ SetEditor()

tVoid SetEditor ( const tChar strName,
const tChar strUrl 
)

Sets the editor information that tools can use to edit the objects properties, pins etc.

Example Usage

Filter:

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
m_nTestProperty.SetValidRange(0, 100);
RegisterPropertyVariable("test_property", m_nTestProperty);
SetEditor("My Filter Editor", "myfilter_editor.qml");
}
private:
};

Editor (myfilter_editor.qml)

import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import EditorPlugin 1.0
{
Dialog
{
id: dialog;
visible: true
title: "My Filter Editor"
standardButtons: StandardButton.Save | StandardButton.Cancel
Slider
{
id: slider
width: parent.width
height: 20
value: 0
stepSize: 1.0
minimumValue: 0
maximumValue: 100
}
Component.onCompleted:
{
slider.value = getPropertyValue(targetModel, "test_property");
}
onAccepted:
{
setProperty(targetModel, "test_property", slider.value)
}
}
}
See also
adtf::streaming::giant::set_editor()
adtf::streaming::giant::set_editors()
Parameters
[in]strNameThe name of the editor.
[in]strUrlThe url of the editor implementation (i.e. a qml file).

◆ SetupStreamer()

tVoid SetupStreamer ( std::shared_ptr< streaming::flash::ISampleStreamer pStreamer,
const tChar strName,
const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &  pType 
)
protected

Used by the templated CreateInputPin() and CreateOutputPin() methods.

Sets the name and type of a sample reader or sample writer.

Parameters
[in]pStreamerThe reader or writer instance.
[in]strNameThe name that should be set.
[in]pTypeThe type that should be associated with the reader or writer.
Exceptions
tResultIn case of an error.

Referenced by cGraphObject::CreateReader(), and cGraphObject::CreateWriter().

Member Data Documentation

◆ _clock

A reference to the clock service.

The variable will be set, in the constructor.

This exists for compatibility reasons only, so please consider retrieving the interface you need from the runtime.

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

Definition at line 952 of file graph_object.h.


Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Thu Aug 19 2021 by doxygen 1.8.14)