ADTF
Loading...
Searching...
No Matches
adtf::filter::cGraphObject Class Reference

#include <graph_object.h>

Inherits adtf::streaming::flash::cNamedGraphObject, adtf::streaming::ant::cDataBinding, adtf::streaming::ant::cInterfaceBinding, adtf::streaming::ant::cRuntimeBehaviour, and adtf::base::flash::cConfiguration.

Inherited by adtf::filter::cFilter, adtf::filter::cSampleStreamingSink, and adtf::filter::cSampleStreamingSource.

Classes

class  cDataTriggerHint
 
class  cNoTriggerHint
 
class  cThreadTriggerHint
 
class  cTimerTriggerHint
 
class  cTriggerHint
 

Public Types

enum class  tRecoverableAction : uint8_t { Log = 0 , Fatal = 1 }
 

Public Member Functions

 cGraphObject ()
 Default Constructor.
 
 ~cGraphObject () override
 Destructor.
 
virtual tResult Process (base::flash::tNanoSeconds tmTrigger, streaming::ant::IRunner *pRunner)
 
virtual tResult ProcessInput (base::flash::tNanoSeconds tmTrigger, streaming::flash::ISampleReader *pReader)
 
virtual tResult ProcessInput (streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::ISample > &pSample)
 
virtual tResult ProcessInput (streaming::flash::ISampleReader *pReader, base::flash::tNanoSeconds tmSample, const void *pSampleData, size_t nSampleDataSize)
 
template<typename ReaderType = cPinReader>
ReaderType * CreateInputPin (const char *strName, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
 
template<typename ReaderType = cPinReader>
ReaderType * CreateInputPin (const char *strName, const cStreamTypeHelper &oType, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
 
template<typename ReaderType = cPinReader, typename CALLABLE = std::function<tResult(base::flash::tNanoSeconds)>, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds >, bool > = true>
ReaderType * CreateInputPinWithCallback (const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnTriggerCallback, bool bForwardTriggerViaOutputPins=true)
 
template<typename ReaderType = cPinReader, typename CALLABLE = std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)>, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, const ucom::ant::iobject_ptr< const streaming::ant::ISample > & >, bool > = true>
ReaderType * CreateInputPinWithCallback (const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnSampleCallback, bool bForwardTriggerViaOutputPins=true)
 
template<typename ReaderType = cPinReader, typename CALLABLE = std::function<tResult(base::flash::tNanoSeconds, const void*, size_t)>, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds, const void *, size_t >, bool > = true>
ReaderType * CreateInputPinWithCallback (const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnSampleDataCallback, bool bForwardTriggerViaOutputPins=true)
 
template<typename Type, typename ReaderType = cPinReader, typename CALLABLE = std::function<tResult(base::flash::tNanoSeconds, const Type&)>, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds, const Type & >, bool > = true>
ReaderType * CreateInputPinWithCallback (const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnDataCallback, bool bForwardTriggerViaOutputPins=true)
 
virtual tResult AcceptType (streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
 
template<typename WriterType = cPinWriter>
WriterType * CreateOutputPin (const char *strName)
 
template<typename WriterType = cPinWriter>
WriterType * CreateOutputPin (const char *strName, const cStreamTypeHelper &oType)
 
template<typename RequestableWriterType = streaming::requestable_writer<>>
RequestableWriterType * CreateRequestableOutputPin (const char *strName, const cStreamTypeHelper &oType=streaming::ant::stream_meta_type_anonymous())
 
streaming::ant::IRunnerCreateRunner (const char *strName, const cTriggerHint &oTriggerHint=cNoTriggerHint(), bool bForwardTriggerViaOutputPins=true)
 
template<typename CALLABLE, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds >, bool > = true>
streaming::ant::IRunnerCreateRunner (const char *strName, CALLABLE &&fnRunFunction, const cTriggerHint &oTriggerHint=cNoTriggerHint(), bool bForwardTriggerViaOutputPins=true)
 
template<typename Interface, typename Instance>
void CreateInterfaceServer (const char *strName, ucom::ant::enable_object_ptr_from_this< Instance > *pInstance)
 
template<typename Interface>
void CreateInterfaceServer (const char *strName, const ucom::ant::iobject_ptr< Interface > &pInstance)
 
template<typename Interface>
interface_client< Interface > CreateInterfaceClient (const char *strName)
 
template<typename ReaderType = cPinReader>
std::shared_ptr< ReaderType > CreateReader (const char *strName, const cStreamTypeHelper &oType)
 
template<typename WriterType = cPinWriter>
std::shared_ptr< WriterType > CreateWriter (const char *strName, const cStreamTypeHelper &oType)
 
template<typename CALLABLE, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds >, bool > = true>
ucom::ant::object_ptr< streaming::ant::IRunnerRegisterRunner (const char *strName, CALLABLE &&fnRunFunction)
 
tResult RegisterRunner (const ucom::ant::iobject_ptr< streaming::ant::IRunner > &pRunner) override
 
tResult RegisterRunner (const char *strName, base::flash::IRunnable &oRunnable)
 
tResult RegisterRunner (const char *strName, adtf::base::ant::IRunnable &oRunnable) override
 
tResult ConfigureDataInTrigger (const char *strRunnerName, const char *strPinName)
 
tResult ConfigureDataOutTrigger (const char *strRunnerName, const char *strPinName)
 
tResult ConfigureTimerTrigger (const char *strRunnerName, tTimeStamp tmPeriod)
 
tResult ConfigureThreadTrigger (const char *strRunnerName, bool bCallCyclic)
 
virtual tResult RequestDynamicInputPin (const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
 
virtual tResult RequestDynamicOutputPin (const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
 
virtual tResult RequestDynamicInterfaceClient (const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
 
virtual tResult RequestDynamicInterfaceServer (const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
 
virtual tResult EnableSubStream (streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId, const base::ant::IProperties *pRequestProperties=nullptr)
 
virtual void DisableSubStream (streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId)
 
tResult RequestPin (const char *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 char *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 char *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 char *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().
 
void RegisterPropertyVariable (const char *strName, base::ant::cPropertyVariable &oPropertyVariable)
 
void SetDescription (const char *strDescription)
 
void SetDescription (const char *strItem, const char *strDescription)
 
void SetEditor (const char *strName, const char *strUrl)
 
void SetHelpLink (const char *strUrl)
 
tResult ActivatePins () override
 
util::log::ILogChannel * CreateLogChannel (std::string_view strName, base::elasto::IErrorHandling::tAction eDefaultErrorAction=base::elasto::IErrorHandling::tAction::Stop, tRecoverableAction eDefaultRecoverableAction=tRecoverableAction::Log, util::log::tLogLevel eDefaultLogLevel=util::log::tLogLevel::Detail)
 
util::log::ILogChannel * GetLogChannel (std::string_view strName={})
 
util::log::ILogChannel * a_util_get_current_log_channel () const noexcept
 
tResult SetName (const char *strName)
 
tResult SetParent (const ucom::ant::IObject *oParentObject)
 
ucom::object_ptr< services::ant::IMacroResolverGetParentMacroResolver () const
 
- Public Member Functions inherited from adtf::streaming::flash::cNamedGraphObject
tResult GetName (base::ant::IString &&strName) const
 
tResult SetName (const char *strName)
 
tResult SetParent (const ucom::ant::IObject *pParentObject)
 
tResult GetParent (const ucom::ant::IObject *&poParentObject) const
 
- Public Member Functions inherited from adtf::streaming::ant::cDataBinding
tResult GetPins (ucom::ant::iobject_list< IPin > &lstPins) const
 private d-pointer
 
tResult FindPin (const char *strName, ucom::ant::iobject_ptr< ucom::ant::IObject > &pPin) const
 
virtual tResult RegisterPin (const ucom::ant::iobject_ptr< IPin > &pIPin)
 
tResult RegisterPin (const ucom::ant::iobject_ptr< IInPin > &pIInPin)
 
tResult RegisterPin (const ucom::ant::iobject_ptr< IOutPin > &pIOutPin)
 
virtual tResult UnregisterPin (const ucom::ant::iobject_ptr< IPin > &pIPin)
 
tResult ReleasePins ()
 
virtual tResult DeactivatePins ()
 
tResult Disconnect ()
 
- Public Member Functions inherited from adtf::streaming::ant::cInterfaceBinding
 cInterfaceBinding ()
 D Pointer Implementation for private members.
 
virtual ~cInterfaceBinding ()
 
tResult GetBindingObjects (ucom::ant::iobject_list< IBindingObject > &lstBindingObject)
 
tResult GetBindingObjects (ucom::ant::iobject_list< const IBindingObject > &lstBindingObject) const
 
tResult FindBindingObject (const char *strName, ucom::ant::iobject_ptr< const ucom::ant::IObject > &pIBindingObject) const
 
tResult FindBindingObject (const char *strName, ucom::ant::iobject_ptr< ucom::ant::IObject > &pIBindingObject)
 
virtual tResult RegisterBindingObject (const ucom::ant::iobject_ptr< IBindingObject > &pBindingObject)
 
tResult RegisterBindingObject (const ucom::ant::iobject_ptr< IBindingServer > &pBindingServer)
 
tResult RegisterBindingObject (const ucom::ant::iobject_ptr< IBindingClient > &pBindingClient)
 
tResult UnregisterBindingObject (const ucom::ant::iobject_ptr< const IBindingObject > &pBindingObject)
 
tResult Unbind ()
 
tResult ReleaseBindingObjects ()
 
- Public Member Functions inherited from adtf::streaming::ant::cRuntimeBehaviour
tResult GetRunners (ucom::ant::iobject_list< IRunner > &lstRunners) const
 copydoc IRuntimeBehaviour::GetRunners
 
tResult FindRunner (const char *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)
 
tResult ReleaseRunners ()
 
virtual tResult RegisterInnerPipe (const ucom::ant::iobject_ptr< ITriggerPipe > &pTriggerPipe)
 
virtual tResult UnregisterInnerPipe (const ucom::ant::iobject_ptr< ITriggerPipe > &pTriggerPipe)
 
tResult ReleaseTriggerPipes ()
 
- Public Member Functions inherited from adtf::base::flash::cConfiguration
 cConfiguration ()
 Default constructor.
 
virtual ~cConfiguration ()
 Destructor.
 
tResult GetProperties (adtf::ucom::ant::iobject_ptr< const IProperties > &pProperties) const
 
tResult GetProperties (adtf::ucom::ant::iobject_ptr< IProperties > &pProperties)
 
tResult AttachConfiguration (const char *strName, IConfiguration &oAttachedConfiguration)
 
tResult DetachConfiguration (const char *strName)
 
tResult RegisterPropertyVariable (const char *strName, ant::cPropertyVariable &oPropertyVariable)
 

Protected Member Functions

void SetupStreamer (std::shared_ptr< streaming::flash::ISampleStreamer > pStreamer, const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
 
void CreateInputPin (std::shared_ptr< streaming::flash::ISampleReader > pReader, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
 
template<typename CALLABLE, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds >, bool > = true>
void CreateInputPin (std::shared_ptr< streaming::flash::ISampleReader > pReader, CALLABLE &&fnTriggerCallback, bool bForwardTriggerViaOutputPins)
 
void CreateInputPin (std::shared_ptr< streaming::flash::ISampleReader > pReader, const char *strTriggerFunctionName, bool bForwardTriggerViaOutputPins=true)
 
void CreateOutputPin (std::shared_ptr< streaming::flash::ISampleWriter > pWriter)
 
void ConfigureRunner (streaming::ant::IRunner *pRunner, const cTriggerHint &oTriggerHint, bool bForwardTriggerViaOutputPins)
 
std::string GetFullName ()
 
- Protected Member Functions inherited from adtf::streaming::ant::cDataBinding
 cDataBinding ()
 CTOR.
 
virtual ~cDataBinding ()
 DTOR.
 
- Protected Member Functions inherited from adtf::streaming::ant::cRuntimeBehaviour
 cRuntimeBehaviour ()
 private _d-pointer
 
virtual ~cRuntimeBehaviour ()
 DTOR.
 

Protected Attributes

ucom::ant::object_ptr< services::ant::IReferenceClock_clock
 
std::unique_ptr< cImplementation > m_pImplementation
 
- Protected Attributes inherited from adtf::streaming::flash::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::cFilter, adtf::filter::cSampleStreamingSource and adtf::filter::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:

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.

Member Enumeration Documentation

◆ tRecoverableAction

Enum for specifying the default action for recoverable errors reported at a log channel.

Enumerator
Log 

Log only, continue processing.

Fatal 

Treat as a fatal error.

Member Function Documentation

◆ a_util_get_current_log_channel()

util::log::ILogChannel * adtf::filter::cGraphObject::a_util_get_current_log_channel ( ) const
noexcept

Overload fo ADL based use of the default log channel within LOG_* macros.

Returns
The default log channel of this graph object.

◆ AcceptType()

virtual tResult adtf::filter::cGraphObject::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 function to change the default behaviour, call the base implementation at the beginning and perform additional checks and/or react to type changes or similar.

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<uint32_t>(*pType.Get(), "my_important_property", 0) != 123)
{
RETURN_ERROR_DESC(ERR_INVALID_TYPE, "my_important_property is not 123");
}
}
};
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_ERROR_DESC(_code,...)
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
Definition result.h:44
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
#define ADTF_CLASS_ID_NAME(_class, _strcid, _strclabel)
Definition class_id.h:33
Definition filter.h:289
ReaderType * CreateInputPin(const char *strName, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
Definition graph_object.h:1215
virtual tResult AcceptType(streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Definition samplestreamer_intf.h:188
virtual T * Get() const =0
Get raw pointer to shared object.
VALUETYPE get_property(const IStreamType &oStreamType, const char *strNameOfValue, VALUETYPE oDefaultValue)
Definition streamtype_intf.h:287
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Definition object_ptr_intf.h:437
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.

◆ ActivatePins()

tResult adtf::filter::cGraphObject::ActivatePins ( )
overridevirtual

Activate all pins.

Reimplemented from adtf::streaming::ant::cDataBinding.

◆ ConfigureDataInTrigger()

tResult adtf::filter::cGraphObject::ConfigureDataInTrigger ( const char * strRunnerName,
const char * strPinName )

This is here for compatibility reasons. CreateInputPin() will do this for you.

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

◆ ConfigureDataOutTrigger()

tResult adtf::filter::cGraphObject::ConfigureDataOutTrigger ( const char * strRunnerName,
const char * strPinName )

This is here for compatibility reasons. CreateOutputPin() and CreateRunner() will do this for you.

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

◆ ConfigureThreadTrigger()

tResult adtf::filter::cGraphObject::ConfigureThreadTrigger ( const char * strRunnerName,
bool bCallCyclic )

This is here for compatibility reasons. CreateRunner() will do this for you.

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

◆ ConfigureTimerTrigger()

tResult adtf::filter::cGraphObject::ConfigureTimerTrigger ( const char * strRunnerName,
tTimeStamp tmPeriod )

This is here for compatibility reasons. CreateRunner() will do this for you.

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

◆ CreateInputPin() [1/5]

template<typename ReaderType>
ReaderType * adtf::filter::cGraphObject::CreateInputPin ( const char * strName,
bool bDataInTrigger = true,
bool 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");
}
};
#define LOG_INFO(...)
Logs an info message.
Definition log.h:388
virtual tResult ProcessInput(base::flash::tNanoSeconds tmTrigger, streaming::flash::ISampleReader *pReader)
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.

◆ CreateInputPin() [2/5]

template<typename ReaderType>
ReaderType * adtf::filter::cGraphObject::CreateInputPin ( const char * strName,
const cStreamTypeHelper & oType,
bool bDataInTrigger = true,
bool 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",
}
};
Definition sample_data.h:429
Generator template to create an instance of a ant::IStreamType class for penguin::stream_meta_type_pl...
Definition streammetatypeplain.h:315
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.

◆ CreateInputPin() [3/5]

void adtf::filter::cGraphObject::CreateInputPin ( std::shared_ptr< streaming::flash::ISampleReader > pReader,
bool bDataInTrigger = true,
bool bForwardTriggerViaOutputPins = true )
protected

◆ CreateInputPin() [4/5]

template<typename CALLABLE, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds >, bool >>
void adtf::filter::cGraphObject::CreateInputPin ( std::shared_ptr< streaming::flash::ISampleReader > pReader,
CALLABLE && fnTriggerCallback,
bool bForwardTriggerViaOutputPins )
protected

The implementation used by CreateInputPin(const char*, const cStreamTypeHelper&, std::function<tResult(base::flash::tNanoSeconds)>, bool)

◆ CreateInputPin() [5/5]

void adtf::filter::cGraphObject::CreateInputPin ( std::shared_ptr< streaming::flash::ISampleReader > pReader,
const char * strTriggerFunctionName,
bool bForwardTriggerViaOutputPins = true )
protected

◆ CreateInputPinWithCallback() [1/4]

template<typename Type, typename ReaderType, typename CALLABLE, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds, const Type & >, bool >>
ReaderType * adtf::filter::cGraphObject::CreateInputPinWithCallback ( const char * strName,
const cStreamTypeHelper & oType,
CALLABLE && fnDataCallback,
bool 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.

The specified callback will be called for each currently available sample whenever a trigger occurs on the given input.

All calls to Process(), ProcessInput() and the callbacks of CreateInputPinWithCallback() are synchronized with the help of a single recursive mutex.

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()
{
[this](adtf::base::tNanoSeconds /*tmSample*/, const uint32_t& nSampleData) -> tResult
{
LOG_INFO("received a sample with data: %u", nSampleData);
});
}
};
ReaderType * CreateInputPinWithCallback(const char *strName, const cStreamTypeHelper &oType, CALLABLE &&fnTriggerCallback, bool bForwardTriggerViaOutputPins=true)
Definition graph_object.h:1235
A timestamp with nanosecond precision.
Definition chrono.h:23
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.

◆ CreateInputPinWithCallback() [2/4]

template<typename ReaderType = cPinReader, typename CALLABLE = std::function<tResult(const ucom::ant::iobject_ptr<const streaming::ant::ISample>&)>, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, const ucom::ant::iobject_ptr< const streaming::ant::ISample > & >, bool > = true>
ReaderType * adtf::filter::cGraphObject::CreateInputPinWithCallback ( const char * strName,
const cStreamTypeHelper & oType,
CALLABLE && fnSampleCallback,
bool 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.

The specified callback will be called for each currently available sample whenever a trigger occurs on the given input.

All calls to Process(), ProcessInput() and the callbacks of CreateInputPinWithCallback() are synchronized with the help of a single recursive mutex.

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.

◆ CreateInputPinWithCallback() [3/4]

template<typename ReaderType = cPinReader, typename CALLABLE = std::function<tResult(base::flash::tNanoSeconds, const void*, size_t)>, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds, const void *, size_t >, bool > = true>
ReaderType * adtf::filter::cGraphObject::CreateInputPinWithCallback ( const char * strName,
const cStreamTypeHelper & oType,
CALLABLE && fnSampleDataCallback,
bool 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.

The specified callback will be called for each currently available sample whenever a trigger occurs on the given input.

All calls to Process(), ProcessInput() and the callbacks of CreateInputPinWithCallback() are synchronized with the help of a single recursive mutex.

Example Usage

#include <cinttypes>
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
[this](adtf::base::tNanoSeconds /*tmSample*/, const void* /*pSampleData*/, size_t nSampleSize) -> tResult
{
LOG_INFO("received a sample of size %zu", nSampleSize);
});
}
};
Generator template to create an instance of a ant::IStreamType class for ant::stream_meta_type_anonym...
Definition streammetatypeanonymous.h:58
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.

◆ CreateInputPinWithCallback() [4/4]

template<typename ReaderType, typename CALLABLE, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds, const void *, size_t >, bool >>
ReaderType * adtf::filter::cGraphObject::CreateInputPinWithCallback ( const char * strName,
const cStreamTypeHelper & oType,
CALLABLE && fnTriggerCallback,
bool 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.

The specified callback will be called whenever a trigger occurs on the given input.

All calls to Process(), ProcessInput() and the callbacks of CreateInputPinWithCallback() are synchronized with the help of a single recursive mutex.

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;
};
#define IS_OK(s)
Check if result is OK.
Definition result.h:17
Definition object_ptr.h:384
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.

◆ CreateInterfaceClient()

template<typename Interface>
interface_client< Interface > adtf::filter::cGraphObject::CreateInterfaceClient ( const char * strName)

Creates an interface client binding object.

Example Usage

class IMyInterface: public adtf::ucom::IObject
{
public:
ADTF_IID(IMyInterface, "my_interface.iid");
public:
virtual void 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:
};
#define ADTF_IID(_interface, _striid)
Definition adtf_iid.h:19
interface_client< Interface > CreateInterfaceClient(const char *strName)
Definition graph_object.h:1377
virtual tResult Process(base::flash::tNanoSeconds tmTrigger, streaming::ant::IRunner *pRunner)
streaming::ant::IRunner * CreateRunner(const char *strName, const cTriggerHint &oTriggerHint=cNoTriggerHint(), bool bForwardTriggerViaOutputPins=true)
Definition graph_object.h:66
Definition runner_intf.h:24
ant::IObject IObject
Alias always bringing the latest version of ant::IObject into scope.
Definition object_intf.h:109
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.

◆ CreateInterfaceServer() [1/2]

template<typename Interface>
void adtf::filter::cGraphObject::CreateInterfaceServer ( const char * 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 void DoSomething() = 0;
};
class cMyImplementation: public adtf::ucom::object<IMyInterface>
{
public:
void 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()
{
}
};
void CreateInterfaceServer(const char *strName, ucom::ant::enable_object_ptr_from_this< Instance > *pInstance)
Definition graph_object.h:1346
Definition object.h:397
object_ptr< T > ucom_object_ptr_cast(object_ptr< T > oCasted)
Alias always bringing the latest version of ant::ucom_object_ptr_cast() into scope.
Definition object_ptr_utilities.h:104
object_ptr< Implementation > make_object_ptr(Args &&... args)
Alias always bringing the latest version of ant::make_object_ptr() into scope.
Definition object_ptr_utilities.h:129
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.

◆ CreateInterfaceServer() [2/2]

template<typename Interface, typename Instance>
void adtf::filter::cGraphObject::CreateInterfaceServer ( const char * 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 void 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
{
RETURN_IF_FAILED(cFilter::Init(eStage));
if (eStage == StageFirst)
{
CreateInterfaceServer<IMyInterface>("my_interface", this);
}
}
void DoSomething() override
{
LOG_INFO("something");
}
};
tResult Init(tInitStage eStage) override
ant::enable_object_ptr_from_this< T > enable_object_ptr_from_this
Alias always bringing the latest version of ant::enable_object_ptr_from_this into scope.
Definition object_ptr_utilities.h:269
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.

◆ CreateLogChannel()

util::log::ILogChannel * adtf::filter::cGraphObject::CreateLogChannel ( std::string_view strName,
base::elasto::IErrorHandling::tAction eDefaultErrorAction = base::elasto::IErrorHandling::tAction::Stop,
tRecoverableAction eDefaultRecoverableAction = tRecoverableAction::Log,
util::log::tLogLevel eDefaultLogLevel = util::log::tLogLevel::Detail )

Creates a new log channel.

This will also create properties for the channel which allow the user to override the default log level and error handling.

Example Usage

Filter:

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
// this creates a new log channel that you can use with the LOG_CHANNEL_* macros
m_pMyLogChannel = CreateLogChannel("my_log_channel",
adtf::base::IErrorHandling::tAction::Shutdown,
adtf::util::log::Warning);
CreateRunner("log_something");
}
{
LOG_CHANNEL_INFO(m_pMyLogChannel, "Info messages should be discarded by default on this channel, but the user may adjust the log level.");
if (tmTrigger < std::chrono::nanoseconds(0))
{
// This is an example for a condition that we cannot handle.
// We are within a callback that has a tResult return value, so we can just return an "ordinary" error.
RETURN_ERROR_DESC(ERR_INVALID_ARG, "Timestamp %" PRIi64 " is negative.", tmTrigger.nCount);
}
if (tmTrigger < std::chrono::hours(1))
{
// This is an example for a condition that we can handle but may be an error in some use cases.
// The user can decide (via the "recoverable_action" property) whether this should be treated as an error or not.
LOG_CHANNEL_REPORT_RECOVERABLE(m_pMyLogChannel, ERR_INVALID_ARG, "Timestamp %" PRIi64 " is small.", tmTrigger.nCount);
// Continue processing as good as you can.
}
}
void LibraryCallback()
{
LOG_CHANNEL_DETAIL(m_pMyLogChannel, "This is an example for a library callback.");
// In places where you cannot handle/return errors directly you can report fatal errors as well
LOG_CHANNEL_REPORT_FATAL_IF_FAILED(m_pMyLogChannel, DoSomethingImportant());
LOG_CHANNEL_REPORT_RECOVERABLE_IF_FAILED(m_pMyLogChannel, DoSomethingOptional());
// keep in mind that you can also just use the "default" log channel via the ordinary LOG_* macros
LOG_REPORT_FATAL_IF_FAILED(DoSomethingImportant());
LOG_REPORT_RECOVERABLE_IF_FAILED(DoSomethingOptional());
}
private:
tResult DoSomethingImportant();
tResult DoSomethingOptional();
adtf::util::log::ILogChannel* m_pMyLogChannel = nullptr;
};
#define LOG_CHANNEL_DETAIL(__channel,...)
Logs a additional information to the given channel.
Definition log.h:341
#define LOG_CHANNEL_REPORT_FATAL_IF_FAILED(__channel, __result,...)
Reports a fatal error at the given channel, but only in case it represents an error.
Definition log.h:354
#define LOG_CHANNEL_REPORT_RECOVERABLE(__channel, __result,...)
Reports a recoverable error at the given channel.
Definition log.h:364
#define LOG_REPORT_RECOVERABLE_IF_FAILED(__result,...)
Reports a recoverable error, but only in case it represents an error.
Definition log.h:403
#define LOG_CHANNEL_REPORT_RECOVERABLE_IF_FAILED(__channel, __result,...)
Reports a recoverable error at the given channel, but only in case it represents an error.
Definition log.h:368
#define LOG_CHANNEL_INFO(__channel,...)
Logs an info message to the given channel.
Definition log.h:343
#define LOG_REPORT_FATAL_IF_FAILED(__result,...)
Reports a fatal error, but only in case it represents an error.
Definition log.h:397
util::log::ILogChannel * CreateLogChannel(std::string_view strName, base::elasto::IErrorHandling::tAction eDefaultErrorAction=base::elasto::IErrorHandling::tAction::Stop, tRecoverableAction eDefaultRecoverableAction=tRecoverableAction::Log, util::log::tLogLevel eDefaultLogLevel=util::log::tLogLevel::Detail)
@ Log
Log only, continue processing.
Definition graph_object.h:1065
Parameters
[in]strNameThe name of the channel. This will also be used for creating the properties.
[in]eDefaultErrorActionThe default action when a fatal error is reported.
[in]eDefaultRecoverableActionThe default action to perform when a recoverable error is reported.
[in]eDefaultLogLevelThe default log level for this channel.
Returns
A pointer to the newly created log channel instance.
Exceptions
ERR_RESOURCE_IN_USEwhen the name is already taken.

◆ CreateOutputPin() [1/3]

template<typename WriterType>
WriterType * adtf::filter::cGraphObject::CreateOutputPin ( const char * 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;
};
WriterType * CreateOutputPin(const char *strName)
Definition graph_object.h:1332
Definition samplestreamer_intf.h:234
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.

◆ CreateOutputPin() [2/3]

template<typename WriterType>
WriterType * adtf::filter::cGraphObject::CreateOutputPin ( const char * 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.

◆ CreateOutputPin() [3/3]

void adtf::filter::cGraphObject::CreateOutputPin ( std::shared_ptr< streaming::flash::ISampleWriter > pWriter)
protected

◆ CreateReader()

template<typename ReaderType>
std::shared_ptr< ReaderType > adtf::filter::cGraphObject::CreateReader ( const char * 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.

◆ CreateRequestableOutputPin()

template<typename RequestableWriterType>
RequestableWriterType * adtf::filter::cGraphObject::CreateRequestableOutputPin ( const char * strName,
const cStreamTypeHelper & oType = streaming::ant::stream_meta_type_anonymous() )

Creates a new requestable output pin with a given stream type.

This will support Substream requests via EnableSubStream() and DisableSubStream().

Example Usage

#include <set>
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateRunner("generate_samples");
m_pWriter = CreateRequestableOutputPin("output", oSubStreams);
}
uint32_t nSubStreamId,
const adtf::base::IProperties* /*pRequestProperties*/) override
{
if (nSubStreamId > 2)
{
RETURN_ERROR_DESC(ERR_INVALID_ARG, "No substream with id %" PRIu32 " available", nSubStreamId);
}
m_oEnabledSubStreams.insert(nSubStreamId);
}
void DisableSubStream(adtf::streaming::ISampleWriter* /*pWriter*/, uint32_t nSubStreamId) override
{
m_oEnabledSubStreams.erase(nSubStreamId);
}
tResult Process(adtf::base::tNanoSeconds tmTrigger, adtf::streaming::IRunner* /*pRunner*/) override
{
++m_nTriggerCounter;
for (const auto& nSubStreamId: m_oEnabledSubStreams)
{
adtf::streaming::output_sample_data<uint32_t> oNewData(tmTrigger, m_nTriggerCounter, nSubStreamId);
m_pWriter->Write(oNewData.Release());
}
}
private:
adtf::streaming::ISampleWriter* m_pWriter = nullptr;
std::set<uint32_t> m_oEnabledSubStreams;
uint32_t m_nTriggerCounter = 0;
};
Definition property_intf.h:213
virtual void DisableSubStream(streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId)
virtual tResult EnableSubStream(streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId, const base::ant::IProperties *pRequestProperties=nullptr)
RequestableWriterType * CreateRequestableOutputPin(const char *strName, const cStreamTypeHelper &oType=streaming::ant::stream_meta_type_anonymous())
Definition graph_object.h:1444
Definition stream_type_helper.h:154
void SetSubStream(const char *strName, uint32_t nSubStreamId, const flash::cStreamTypeHelper &oType)

or

#include <set>
#include <mutex>
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateRunner("generate_samples");
m_pWriter = CreateOutputPin<adtf::streaming::requestable_writer<>>("output", oSubStreams);
m_pWriter->SetCallbacks([this](uint32_t nSubStreamId, const adtf::base::IProperties*)
{
if (nSubStreamId > 2)
{
THROW_ERROR_DESC(ERR_INVALID_ARG, "No substream with id %" PRIu32 " available", nSubStreamId);
}
std::lock_guard<std::mutex> oGuard(m_oSubStreamsLock);
m_oEnabledSubStreams.insert(nSubStreamId);
},
[this](uint32_t nSubStreamId)
{
std::lock_guard<std::mutex> oGuard(m_oSubStreamsLock);
m_oEnabledSubStreams.erase(nSubStreamId);
});
}
tResult Process(adtf::base::tNanoSeconds tmTrigger, adtf::streaming::IRunner* /*pRunner*/) override
{
++m_nTriggerCounter;
std::lock_guard<std::mutex> oGuard(m_oSubStreamsLock);
for (const auto& nSubStreamId: m_oEnabledSubStreams)
{
adtf::streaming::output_sample_data<uint32_t> oNewData(tmTrigger, m_nTriggerCounter, nSubStreamId);
m_pWriter->Write(oNewData.Release());
}
}
private:
adtf::streaming::requestable_writer<>* m_pWriter = nullptr;
std::mutex m_oSubStreamsLock;
std::set<uint32_t> m_oEnabledSubStreams;
uint32_t m_nTriggerCounter = 0;
};
#define THROW_ERROR_DESC(_code,...)
throws a tResult exception
Definition result.h:85
Template Parameters
RequestableWriterTypeThe 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.

◆ CreateRunner() [1/2]

template<typename CALLABLE, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds >, bool >>
streaming::ant::IRunner * adtf::filter::cGraphObject::CreateRunner ( const char * strName,
CALLABLE && fnRunFunction,
const cTriggerHint & oTriggerHint = cNoTriggerHint(),
bool 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.

The calls to the specified callback are not synchronized in any way, so make sure you guard access to shared resources (especially readers) yourself.

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", [this](adtf::base::tNanoSeconds /*tmTrigger*/) -> tResult
{
LOG_INFO("something");
});
CreateRunner("do_something_else", [this](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.

◆ CreateRunner() [2/2]

streaming::ant::IRunner * adtf::filter::cGraphObject::CreateRunner ( const char * strName,
const cTriggerHint & oTriggerHint = cNoTriggerHint(),
bool 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: %" PRIi64, 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",
}
};
Base object pointer to realize binary compatible reference counting in interface methods.
Definition object_ptr_intf.h:112
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.

◆ CreateWriter()

template<typename WriterType>
std::shared_ptr< WriterType > adtf::filter::cGraphObject::CreateWriter ( const char * 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.

◆ DisableSubStream()

virtual void adtf::filter::cGraphObject::DisableSubStream ( streaming::flash::ISampleWriter * pWriter,
uint32_t nSubStreamId )
virtual

Called when the last consumer cancels its request for the transmission of samples of a given Substream.

Mind that calls to this method are synchronized to the Process() and ProcessInput() methods with the help of a mutex.

Parameters
[in]pWriterThe writer of the pin, that the Substream was requested from.
[in]nSubStreamIdThe id of the Substream.

◆ EnableSubStream()

virtual tResult adtf::filter::cGraphObject::EnableSubStream ( streaming::flash::ISampleWriter * pWriter,
uint32_t nSubStreamId,
const base::ant::IProperties * pRequestProperties = nullptr )
virtual

This is called when the first consumer requests the transmission of samples of a given Substream.

Mind that calls to this method are synchronized to the Process() and ProcessInput() methods with the help of a mutex.

Parameters
[in]pWriterThe writer of the pin, that the Substream was requested from.
[in]nSubStreamIdThe id of the Substream.
[in]pRequestPropertiesThe request properties, if nullptr, use defaults.
Returns
Standard result.

◆ GetLogChannel()

util::log::ILogChannel * adtf::filter::cGraphObject::GetLogChannel ( std::string_view strName = {})

Retrieves a log channel.

Example Usage

Filter:

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateLogChannel("my_log_channel1",
adtf::base::IErrorHandling::tAction::Shutdown,
adtf::util::log::Warning);
CreateLogChannel("my_log_channel2",
adtf::base::IErrorHandling::tAction::Shutdown,
adtf::util::log::Warning);
m_strLogChannelToUse.SetDescription("Chooses the log channel.");
RegisterPropertyVariable("log_channel_to_use", m_strLogChannelToUse);
}
tResult Init(tInitStage eStage) override
{
RETURN_IF_FAILED(cFilter::Init(eStage));
if (eStage == StageFirst)
{
m_pMyLogChannel = GetLogChannel(*m_strLogChannelToUse);
}
LOG_CHANNEL_INFO(m_pMyLogChannel, "Hello world.");
}
private:
adtf::base::property_variable<std::string> m_strLogChannelToUse = {"my_log_channel1"};
adtf::util::log::ILogChannel* m_pMyLogChannel = nullptr;
};
Property Variable template for the given T. A Property Variable will store a copy of a property value...
Definition configuration.h:808
void RegisterPropertyVariable(const char *strName, base::ant::cPropertyVariable &oPropertyVariable)
util::log::ILogChannel * GetLogChannel(std::string_view strName={})
Parameters
[in]strNameThe name of the log channel. If empty, then the default log channel is returned.
Returns
A pointer to the existing log channel.
Exceptions
ERR_NOT_FOUNDwhen no log channel with the given name exists.

◆ Process()

virtual tResult adtf::filter::cGraphObject::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 char*, const cTriggerHint&, bool)

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(), ProcessInput() and the callbacks of CreateInputPinWithCallback() are synchronized with the help of a single recursive mutex.

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: %" PRIi64, tmTrigger.nCount);
}
};
Parameters
[in]tmTriggerThe trigger timestamp.
[in]pRunnerPointer to the Runner that was triggered.
Returns
Standard result.

◆ ProcessInput() [1/3]

virtual tResult adtf::filter::cGraphObject::ProcessInput ( base::flash::tNanoSeconds tmTrigger,
streaming::flash::ISampleReader * pReader )
virtual

Provides access to the reader of incoming data.

Remarks
Override this function to iterate over all samples from pReader yourself.

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.

Note
If you are overriding this function without reading a sample from the pReader, there won't be any type check triggered (see AcceptType()). Different from ProcessInput(streaming::flash::ISampleReader*, const ucom::ant::iobject_ptr<const streaming::ant::ISample>&) and ProcessInput(streaming::flash::ISampleReader*, base::flash::tNanoSeconds, const void*, size_t) where the sample has already been read from the queue and AcceptType() has been called.

All calls to Process(), ProcessInput() and the callbacks of CreateInputPinWithCallback() are synchronized with the help of a single recursive mutex.

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()
{
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: %" PRIi64, tmTrigger.nCount);
}
else if (pReader == m_pReader2)
{
LOG_INFO("received a trigger on input2 at: %" PRIi64, 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 adtf::filter::cGraphObject::ProcessInput ( streaming::flash::ISampleReader * pReader,
base::flash::tNanoSeconds tmSample,
const void * pSampleData,
size_t nSampleDataSize )
virtual

Provides access to the sample content of incoming data.

Remarks
Override this function to access the pSampleData.

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

This is the third 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.

All calls to Process(), ProcessInput() and the callbacks of CreateInputPinWithCallback() are synchronized with the help of a single recursive mutex.

All writers will be flushed after this method is called.

Example Usage

#include <cinttypes>
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateInputPin("input");
}
const void* /*pSampleData*/,
size_t nSampleDataSize)
{
LOG_INFO("received a sample of size %zu", 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.

◆ ProcessInput() [3/3]

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

Provides access to the sample of incoming data.

Remarks
Override this function to access the entire pSample.

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

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

This is the second 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.

All calls to Process(), ProcessInput() and the callbacks of CreateInputPinWithCallback() are synchronized with the help of a single recursive mutex.

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

◆ RegisterPropertyVariable()

void adtf::filter::cGraphObject::RegisterPropertyVariable ( const char * 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]

tResult adtf::filter::cGraphObject::RegisterRunner ( const char * 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 adtf::streaming::ant::cRuntimeBehaviour.

◆ RegisterRunner() [2/4]

tResult adtf::filter::cGraphObject::RegisterRunner ( const char * 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() [3/4]

template<typename CALLABLE, std::enable_if_t< std::is_invocable_r_v< tResult, std::decay_t< CALLABLE >, base::flash::tNanoSeconds >, bool >>
ucom::ant::object_ptr< streaming::ant::IRunner > adtf::filter::cGraphObject::RegisterRunner ( const char * strName,
CALLABLE && fnRunFunction )

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]fnRunFunctionThe runners callback.
Returns
A shared pointer to the runner instance.
Exceptions
tResultIn case of an error.

◆ RegisterRunner() [4/4]

tResult adtf::filter::cGraphObject::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 adtf::streaming::ant::cRuntimeBehaviour.

◆ RequestDynamicInputPin()

virtual tResult adtf::filter::cGraphObject::RequestDynamicInputPin ( const char * 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));
}
tResult ProcessInput(adtf::streaming::ISampleReader* /*pReader*/,
{
m_pWriter->Write(pSample);
}
private:
std::vector<adtf::streaming::ISampleReader*> m_oReaders;
adtf::streaming::ISampleWriter* m_pWriter = nullptr;
};
#define RETURN_IF_FAILED_DESC(s,...)
Definition result.h:168
virtual tResult RequestDynamicInputPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
tResult is_compatible(const ant::IStreamType &oCheckedType, const ant::IStreamType &oExpectedType)
Use this Stream Meta Type only if no property should be set and you do not share and record these dat...
Definition streammetatypeanonymous.h:22
Parameters
[in]strNameThe name of the requested pin.
[in]pTypeThe type requested for the pin.
Returns
Standard result.

◆ RequestDynamicInterfaceClient()

virtual tResult adtf::filter::cGraphObject::RequestDynamicInterfaceClient ( const char * 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 void 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));
}
tResult Process(adtf::base::tNanoSeconds /*tmTrigger*/,
adtf::streaming::IRunner* /*pRunner*/) override
{
for (const auto& oClient: m_oClients)
{
oClient->DoSomething();
}
}
public:
std::vector<adtf::filter::interface_client<IMyInterface>> m_oClients;
};
virtual tResult RequestDynamicInterfaceClient(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
Definition interface_binding_type.h:96
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 adtf::filter::cGraphObject::RequestDynamicInterfaceServer ( const char * 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 void DoSomething() = 0;
};
class cMyImplementation: public adtf::ucom::object<IMyInterface>
{
public:
void 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.");
}
}
};
virtual tResult RequestDynamicInterfaceServer(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
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 adtf::filter::cGraphObject::RequestDynamicOutputPin ( const char * 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<uint32_t>.");
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;
};
virtual tResult RequestDynamicOutputPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Parameters
[in]strNameThe name of the requested pin.
[in]pTypeThe type requested for the pin.
Returns
Standard result.

◆ SetDescription() [1/2]

void adtf::filter::cGraphObject::SetDescription ( const char * 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.");
}
};
void SetDescription(const char *strDescription)
See also
adtf::streaming::giant::set_description()
Parameters
[in]strDescriptionThe description.

◆ SetDescription() [2/2]

void adtf::filter::cGraphObject::SetDescription ( const char * strItem,
const char * strDescription )

Set the description for a data Pin, an Interface Binding Object or a Runner.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
CreateOutputPin("output_pin");
CreateRunner("runner");
SetDescription("output_pin", "This is a dummy data pin.");
SetDescription("runner", "This is a dummy runner.");
SetDescription("interface_server", "This is a dummy interface server.");
}
};
Parameters
[in]strItemThe name of the item to set the description for.
[in]strDescriptionThe description.

◆ SetEditor()

void adtf::filter::cGraphObject::SetEditor ( const char * strName,
const char * 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:
};
void SetEditor(const char *strName, const char *strUrl)

Editor (myfilter_editor.qml)

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.4
import QtGraphicalEffects 1.0
import QtQuick.Dialogs 1.2
import EditorPlugin 1.0
EditorPluginBase
{
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).

◆ SetHelpLink()

void adtf::filter::cGraphObject::SetHelpLink ( const char * strUrl)

Sets the link to the documentation that tools can display.

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
SetHelpLink("my_filter_help.html");
}
};
void SetHelpLink(const char *strUrl)
See also
adtf::streaming::hollow::set_help_link()
Parameters
[in]strUrlThe url to the help document (i.e. an HTML file).

◆ SetupStreamer()

void adtf::filter::cGraphObject::SetupStreamer ( std::shared_ptr< streaming::flash::ISampleStreamer > pStreamer,
const char * 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.

Member Data Documentation

◆ _clock

ucom::ant::object_ptr<services::ant::IReferenceClock> adtf::filter::cGraphObject::_clock
protected

A reference to the Reference Clock Service interface. 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.

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