45 template <
typename DATA_TYPE>
52 template<tTimeStamp TIME_RANGE,
bool STORELASTSAMPLE = true>
56 template<
size_t MAX_SIZE,
bool STORELASTSAMPLE = true>
65 template <
typename Interface>
96 IS_FAILED(m_pClient->GetServerObject(m_pInterface)))
111 return *m_pInterface;
116 THROW_ERROR_DESC(ERR_NOT_INITIALIZED,
"interface client has not been created");
119 auto nResult = m_pClient->GetServerObject(m_pInterface);
125 "Unable to aquire server object for client '%s' with interface '%s'.",
127 adtf::ucom::get_iid<Interface>());
131 return *m_pInterface;
134 Interface* operator->()
const
243 m_tmInterval(tmInterval)
252 m_tmInterval(base::flash::
duration_cast<base::flash::tNanoSeconds>(tmInterval))
279 m_strInputName(strInputName)
288 m_strInputName(std::accumulate(lstInputNames.begin(),
291 [](const auto& strPrevious, const auto& strNext) {
return strPrevious.empty() ? strNext : strPrevious +
";" + strNext; }))
300 return m_strInputName.c_str();
304 std::string m_strInputName;
444 const void* pSampleData,
445 size_t nSampleDataSize);
460 template <
typename ReaderType = cPinReader>
462 bool bDataInTrigger =
true,
463 bool bForwardTriggerViaOutputPins =
true);
479 template <
typename ReaderType = cPinReader>
482 bool bDataInTrigger =
true,
483 bool bForwardTriggerViaOutputPins =
true);
506 template <
typename ReaderType = cPinReader>
510 bool bForwardTriggerViaOutputPins =
true);
534 template <
typename ReaderType = cPinReader>
538 bool bForwardTriggerViaOutputPins =
true);
562 template <
typename ReaderType = cPinReader>
566 bool bForwardTriggerViaOutputPins =
true);
591 template <
typename Type,
typename ReaderType = cPinReader>
595 bool bForwardTriggerViaOutputPins =
true);
625 template <
typename WriterType = cPinWriter>
640 template <
typename WriterType = cPinWriter>
661 bool bForwardTriggerViaOutputPins =
true);
686 bool bForwardTriggerViaOutputPins =
true);
706 template <
typename Interface,
typename Instance>
720 template <
typename Interface>
734 template <
typename Interface>
749 template <
typename ReaderType = cPinReader>
750 std::shared_ptr<ReaderType>
CreateReader(
const char* strName,
765 template <
typename WriterType = cPinWriter>
766 std::shared_ptr<WriterType>
CreateWriter(
const char* strName,
769 using cRuntimeBehaviour::RegisterRunner;
947 void SetEditor(
const char* strName,
const char* strUrl);
960 void SetupStreamer(std::shared_ptr<streaming::flash::ISampleStreamer> pStreamer,
969 bool bDataInTrigger =
true,
970 bool bForwardTriggerViaOutputPins =
true);
977 bool bForwardTriggerViaOutputPins =
true);
984 bool bForwardTriggerViaOutputPins =
true);
991 bool bForwardTriggerViaOutputPins =
true);
1011 class cImplementation;
1012 std::unique_ptr<cImplementation> m_pImplementation;
1015 template <
typename ReaderType>
1017 bool bDataInTrigger,
1018 bool bForwardTriggerViaOutputPins)
1020 return CreateInputPin<ReaderType>(strName,
1022 bDataInTrigger, bForwardTriggerViaOutputPins);
1025 template <
typename ReaderType>
1028 bool bDataInTrigger,
1029 bool bForwardTriggerViaOutputPins)
1031 auto pReader = CreateReader<ReaderType>(strName, oType);
1032 CreateInputPin(pReader, bDataInTrigger, bForwardTriggerViaOutputPins);
1033 return pReader.get();
1036 template <
typename ReaderType>
1040 bool bForwardTriggerViaOutputPins)
1042 auto pReader = CreateReader<ReaderType>(strName, oType);
1043 CreateInputPin(pReader, fnTriggerCallback, bForwardTriggerViaOutputPins);
1044 return pReader.get();
1047 template <
typename ReaderType>
1051 bool bForwardTriggerViaOutputPins)
1053 auto pReader = CreateReader<ReaderType>(strName, oType);
1054 CreateInputPin(pReader, fnSampleCallback, bForwardTriggerViaOutputPins);
1055 return pReader.get();
1058 template<
typename ReaderType>
1062 bool bForwardTriggerViaOutputPins)
1064 auto pReader = CreateReader<ReaderType>(strName, oType);
1065 CreateInputPin(pReader, fnSampleDataCallback, bForwardTriggerViaOutputPins);
1066 return pReader.get();
1070 template <
typename Type,
typename ReaderType>
1074 bool bForwardTriggerViaOutputPins)
1080 if (pBuffer->GetSize() <
sizeof(Type))
1082 RETURN_ERROR_DESC(ERR_INVALID_ARG,
"Invalid sample received, its too small for the requested type");
1086 bForwardTriggerViaOutputPins);
1089 template <
typename WriterType>
1095 template <
typename WriterType>
1098 auto pWriter = CreateWriter<WriterType>(strName, oType);
1100 return pWriter.get();
1103 template <
typename Interface,
typename Instance>
1107 if (!pInstancePointer)
1109 THROW_ERROR_DESC(ERR_NOT_INITIALIZED,
"Unable to add interface server '%s', object_ptr_from_this has not been initialized. "
1110 "This AddInterfaceServer overload cannot be called from within the constructor.",
1117 ucom_object_ptr_cast<IObject>(pInstancePointer));
1121 template <
typename Interface>
1128 ucom_object_ptr_cast<IObject>(pInstance));
1132 template <
typename Interface>
1136 ucom::ant::make_object_ptr<streaming::ant::cBindingClient>(strName,
1139 return pBindingClient;
1142 template <
typename ReaderType>
1146 auto pReader = std::make_shared<ReaderType>();
1150 return AcceptType(pReader, pType);
1155 template <
typename WriterType>
1159 auto pWriter = std::make_shared<WriterType>();
1191 template <
typename RequestableWriterType = streaming::requestable_writer<>>
1192 RequestableWriterType* CreateRequestableOutputPin(
const char* strName,
1205 uint32_t nSubStreamId,
1241 uint32_t nSubStreamId,
1246 template <
typename RequestableWriterType>
1247 RequestableWriterType* cGraphObject::CreateRequestableOutputPin(
const char* strName,
const cStreamTypeHelper& oType)
1249 auto pWriter = CreateWriter<RequestableWriterType>(strName, oType);
1251 pWriter->SetCallbacks(std::bind(&cGraphObject::LockedCallEnableSubStream,
this, pWriter.get(), std::placeholders::_1, std::placeholders::_2),
1252 std::bind(&cGraphObject::LockedCallDisableSubStream,
this, pWriter.get(), std::placeholders::_1));
1253 return pWriter.get();
tInt64 tTimeStamp
type definition for a time value.
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define IS_FAILED(s)
Check if result is failed.
#define RETURN_ERROR_DESC(_code,...)
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
A common result class usable as return value throughout.
Defintion of a property set container interface.
The Runnable interface defines common methods for a running component.
Default implemementation of a property_variable.
Implements all functionality required by ant::IConfiguration.
Hint that a Data-In trigger should be created to trigger a Runner.
const char * GetInputName() const
cDataTriggerHint(const std::vector< std::string > &lstInputNames)
Create a new hint with a list of inputs.
cDataTriggerHint(const char *strInputName)
Create a new hint.
No hint on which Active Runner to use.
Hint that a thread Active Runner should be used to trigger a Runner.
cThreadTriggerHint(bool bCyclic=true)
Constructor that initializes the hint with the information if the thread runner should be cyclic or n...
Hint that a timer Active Runner should be used to trigger a Runner.
cTimerTriggerHint(tTimeStamp tmInterval)
Constructor that initializes the hint with the prefered timer interval.
base::flash::tNanoSeconds GetInterval() const
cTimerTriggerHint(base::flash::tNanoSeconds tmInterval)
Constructor that initializes the hint with the prefered timer interval.
Base class for hints that give information on which Active Runner should be connected to a newly crea...
Base class for adtf::filter::flash::cFilter, adtf::filter::flash::cSampleStreamingSource and adtf::fi...
virtual tResult ProcessInput(streaming::flash::ISampleReader *pReader, base::flash::tNanoSeconds tmSample, const void *pSampleData, size_t nSampleDataSize)
Provides access to the sample content of incoming data.
void SetDescription(const char *strDescription)
Sets the description information that tools can display.
void CreateInputPin(std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(base::flash::tNanoSeconds, const void *, size_t)> fnSampleDataCallback, bool bForwardTriggerViaOutputPins=true)
The implementation used by CreateInputPin(const char*, const cStreamTypeHelper&, std::function<tResul...
ucom::ant::object_ptr< services::ant::IReferenceClock > _clock
A reference to the clock service.
ReaderType * CreateInputPin(const char *strName, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
Creates a new input pin with an anonymous stream type.
~cGraphObject() override
Destructor.
tResult RegisterRunner(const ucom::ant::iobject_ptr< streaming::ant::IRunner > &pRunner) override
This is here for compatibility reasons.
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().
streaming::ant::IRunner * CreateRunner(const char *strName, const cTriggerHint &oTriggerHint=cNoTriggerHint(), bool bForwardTriggerViaOutputPins=true)
Creates a new Runner that can be triggered by an Active Runner.
tResult ConfigureThreadTrigger(const char *strRunnerName, bool bCallCyclic)
This is here for compatibility reasons.
tResult ConfigureDataInTrigger(const char *strRunnerName, const char *strPinName)
This is here for compatibility reasons.
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 ConfigureTimerTrigger(const char *strRunnerName, tTimeStamp tmPeriod)
This is here for compatibility reasons.
virtual tResult RequestDynamicInterfaceServer(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
Called whenever a new dynamic interface server binding object is requested.
ReaderType * CreateInputPinWithCallback(const char *strName, const cStreamTypeHelper &oType, std::function< tResult(base::flash::tNanoSeconds)> fnTriggerCallback, bool bForwardTriggerViaOutputPins=true)
Creates a new input pin with a given stream type.
tResult RegisterRunner(const char *strName, base::flash::IRunnable &oRunnable)
This is here for compatibility reasons.
WriterType * CreateOutputPin(const char *strName)
Creates a new output pin without an initial stream type.
void CreateInterfaceServer(const char *strName, ucom::ant::enable_object_ptr_from_this< Instance > *pInstance)
Creates an interface server binding object.
streaming::ant::IRunner * CreateRunner(const char *strName, std::function< tResult(base::flash::tNanoSeconds)> fnRunFunction, const cTriggerHint &oTriggerHint=cNoTriggerHint(), bool bForwardTriggerViaOutputPins=true)
Creates a new Runner that can be triggered by an Active Runner.
virtual tResult ProcessInput(streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::ISample > &pSample)
Provides access to the sample of incoming data.
void CreateInputPin(std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(base::flash::tNanoSeconds)> fnTriggerCallback, bool bForwardTriggerViaOutputPins=true)
The implementation used by CreateInputPin(const char*, const cStreamTypeHelper&, std::function<tResul...
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::a...
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().
void SetupStreamer(std::shared_ptr< streaming::flash::ISampleStreamer > pStreamer, const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Used by the templated CreateInputPin() and CreateOutputPin() methods.
std::shared_ptr< WriterType > CreateWriter(const char *strName, const cStreamTypeHelper &oType)
Creates and intializes a new sample reader.
virtual tResult Process(base::flash::tNanoSeconds tmTrigger, streaming::ant::IRunner *pRunner)
The default Runner function of the graph object.
tResult RegisterRunner(const char *strName, adtf::base::ant::IRunnable &oRunnable) override
This is here for compatibility reasons.
virtual tResult RequestDynamicOutputPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Called whenever a new dynamic output pin is requested.
virtual tResult RequestDynamicInterfaceClient(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IBindingType > &pType)
Called whenever a new dynamic interface client binding object is requested.
interface_client< Interface > CreateInterfaceClient(const char *strName)
Creates an interface client binding object.
void CreateOutputPin(std::shared_ptr< streaming::flash::ISampleWriter > pWriter)
The implementation used by CreateOutputPin(const char*, const cStreamTypeHelper&),...
void RegisterPropertyVariable(const char *strName, base::ant::cPropertyVariable &oPropertyVariable)
Registers a new property variable which will always reflect the value of a property.
std::shared_ptr< ReaderType > CreateReader(const char *strName, const cStreamTypeHelper &oType)
Creates and intializes a new sample reader.
ucom::ant::object_ptr< streaming::ant::IRunner > RegisterRunner(const char *strName, std::function< tResult(base::flash::tNanoSeconds)> fnRunMethod)
Creates and registers a new Runner.
tResult ConfigureDataOutTrigger(const char *strRunnerName, const char *strPinName)
This is here for compatibility reasons.
void CreateInputPin(std::shared_ptr< streaming::flash::ISampleReader > pReader, std::function< tResult(const ucom::ant::iobject_ptr< const streaming::ant::ISample > &)> fnSampleCallback, bool bForwardTriggerViaOutputPins=true)
The implementation used by CreateInputPin(const char*, const cStreamTypeHelper&, std::function<tResul...
cGraphObject()
Default Constructor.
void SetEditor(const char *strName, const char *strUrl)
Sets the editor information that tools can use to edit the objects properties, pins etc.
virtual tResult ProcessInput(base::flash::tNanoSeconds tmTrigger, streaming::flash::ISampleReader *pReader)
Provides access to the reader of incoming data.
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().
virtual tResult RequestDynamicInputPin(const char *strName, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Called whenever a new dynamic input pin is requested.
void CreateInputPin(std::shared_ptr< streaming::flash::ISampleReader > pReader, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
The implementation used by CreateInputPin(const char*, bool, bool) and CreateInputPin(const char*,...
Helper class that wraps different objects into an adtf::streaming::ant::IStreamType.
ucom::ant::object_ptr< const streaming::ant::IStreamType > GetStreamType() const
Helper class that wraps a streaming::ant::IBindingClient.
interface_client(const ucom::ant::iobject_ptr< streaming::ant::IBindingClient > &pClient)
/// initializes the object with an existing binding client.
interface_client()=default
default constructor that initializes the object to an invalid state.
Base class for adtf::filter::flash::cFilter, adtf::filter::flash::cSampleStreamingSource and adtf::fi...
void SetHelpLink(const char *strUrl)
Sets the link to the documentation that tools can display.
void SetDescription(const char *strItem, const char *strDescription)
Set the description for a data Pin, an Interface Binding Object or a Runner.
virtual void DisableSubStream(streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId)
Called when the last consumer cancels its request for the transmission of samples of a given Substrea...
virtual tResult EnableSubStream(streaming::flash::ISampleWriter *pWriter, uint32_t nSubStreamId, const base::ant::IProperties *pRequestProperties=nullptr)
This is called when the first consumer requests the transmission of samples of a given Substream.
The Interface defines a runnable item of the GraphObjects providing a IRuntimeBehaviour.
Binding type generation template to initialize a BindingType with the information of the INTERFACE ty...
The cFilter class implements a basic filter that supports the IFilter and IPinEventSink interfaces.
Default IInterfaceBinding implementation.
virtual tResult RegisterBindingObject(const ucom::ant::iobject_ptr< IBindingObject > &pBindingObject)
RegisterBindingObject will register the given pBindingObject within the internal registry.
Default implementation for the IRuntimeBehaviour.
Interface for sample reads that read from sample streams via input pins.
Interface for sample writers that write to sample streams via output pins.
This base implementation of a sample writer is samples and types to the given pin set at adtf::stream...
Reads and stores Samples within the given queue implementation INTERNAL_QUEUE.
Specialized Sample Writer to write data of a given type DATA_TYPE (see Supported types for adtf_memor...
Safely retrieve a valid object_ptr<> instance to *this when all we have is *this.
object_ptr< T > object_ptr_from_this()
Retrieve an object_ptr with *this being the shared resource.
Base object pointer to realize binary compatible reference counting in interface methods.
Implementation for a shared lock guard.
Object pointer implementation used for reference counting on objects of type IObject.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
DestinationTimeStamp duration_cast(const SourceTimeStamp &)
Duration cast base template to converted between different time resolution.
adtf::streaming::flash::sample_writer< DATA_TYPE > pin_writer
Specialized Sample Writer to write DATA of type DATA_TYPE.
adtf::streaming::flash::time_limited_sample_reader< TIME_RANGE, STORELASTSAMPLE > time_limited_pin_reader
The time_limited_sample_reader will create a sample reader which will create a internal sample queue ...
adtf::streaming::flash::size_limited_sample_reader< MAX_SIZE, STORELASTSAMPLE > size_limited_pin_reader
The size_limited_sample_reader will create a sample reader which will create a internal sample queue ...
adtf::streaming::flash::cDynamicSampleReader cPinReader
use cSampleReader as cPinReader
adtf::streaming::flash::cSampleWriter cPinWriter
use cSampleWriter as cPinWriter
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
sample_reader< ant::cDynamicSampleReaderQueue > cDynamicSampleReader
The cDynamicSampleReader will create a sample reader which will create a internal sample queue with u...
base::flash::tNanoSeconds get_sample_time(const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
Returns the sample time stamp with nanosecond precision.
Namespace for all functionality provided since v3.0.
std::enable_if< !std::is_base_of< enable_object_ptr_from_this< typename std::remove_cv< Implementation >::type >, typename std::remove_cv< Implementation >::type >::value, object_ptr< Implementation > >::type make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
#define adtf_string_intf(__string__)
The adtf_string_intf Macro helps to easily create a rvalue reference of a adtf::util::cString.
A timestamp with nanosecond precision.
Copyright © Audi Electronics Venture GmbH.
#define THROW_ERROR_DESC(_code,...)
throws a tResult exception
#define THROW_IF_FAILED_DESC(s,...)
throws if the expression returns a failed tResult and ammends the error message.
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult