44 template <
typename DATA_TYPE>
51 template<tTimeStamp TIME_RANGE,
bool STORELASTSAMPLE = true>
55 template<
size_t MAX_SIZE,
bool STORELASTSAMPLE = true>
64 template <
typename Interface>
95 IS_FAILED(m_pClient->GetServerObject(m_pInterface)))
110 return *m_pInterface;
115 THROW_ERROR_DESC(ERR_NOT_INITIALIZED,
"interface client has not been created");
118 auto nResult = m_pClient->GetServerObject(m_pInterface);
119 if (IS_FAILED(nResult))
124 "Unable to aquire server object for client '%s' with interface '%s'.",
126 adtf::ucom::get_iid<Interface>());
130 return *m_pInterface;
133 Interface* operator->()
const
242 m_tmInterval(tmInterval)
251 m_tmInterval(base::flash::duration_cast<base::flash::tNanoSeconds>(tmInterval))
278 m_strInputName(strInputName)
287 return m_strInputName.c_str();
291 std::string m_strInputName;
408 const void* pSampleData,
409 size_t nSampleDataSize);
424 template <
typename ReaderType = cPinReader>
426 bool bDataInTrigger =
true,
427 bool bForwardTriggerViaOutputPins =
true);
443 template <
typename ReaderType = cPinReader>
446 bool bDataInTrigger =
true,
447 bool bForwardTriggerViaOutputPins =
true);
466 template <
typename ReaderType = cPinReader>
470 bool bForwardTriggerViaOutputPins =
true);
490 template <
typename ReaderType = cPinReader>
494 bool bForwardTriggerViaOutputPins =
true);
514 template <
typename ReaderType = cPinReader>
518 bool bForwardTriggerViaOutputPins =
true);
539 template <
typename Type,
typename ReaderType = cPinReader>
543 bool bForwardTriggerViaOutputPins =
true);
571 template <
typename WriterType = cPinWriter>
586 template <
typename WriterType = cPinWriter>
607 bool bForwardTriggerViaOutputPins =
true);
630 bool bForwardTriggerViaOutputPins =
true);
650 template <
typename Interface,
typename Instance>
664 template <
typename Interface>
678 template <
typename Interface>
693 template <
typename ReaderType = cPinReader>
694 std::shared_ptr<ReaderType>
CreateReader(
const char* strName,
709 template <
typename WriterType = cPinWriter>
710 std::shared_ptr<WriterType>
CreateWriter(
const char* strName,
713 using cRuntimeBehaviour::RegisterRunner;
891 void SetEditor(
const char* strName,
const char* strUrl);
904 void SetupStreamer(std::shared_ptr<streaming::flash::ISampleStreamer> pStreamer,
913 bool bDataInTrigger =
true,
914 bool bForwardTriggerViaOutputPins =
true);
921 bool bForwardTriggerViaOutputPins =
true);
928 bool bForwardTriggerViaOutputPins =
true);
935 bool bForwardTriggerViaOutputPins =
true);
955 class cImplementation;
956 std::unique_ptr<cImplementation> m_pImplementation;
959 template <
typename ReaderType>
962 bool bForwardTriggerViaOutputPins)
964 return CreateInputPin<ReaderType>(strName,
966 bDataInTrigger, bForwardTriggerViaOutputPins);
969 template <
typename ReaderType>
973 bool bForwardTriggerViaOutputPins)
975 auto pReader = CreateReader<ReaderType>(strName, oType);
976 CreateInputPin(pReader, bDataInTrigger, bForwardTriggerViaOutputPins);
977 return pReader.get();
980 template <
typename ReaderType>
984 bool bForwardTriggerViaOutputPins)
986 auto pReader = CreateReader<ReaderType>(strName, oType);
987 CreateInputPin(pReader, fnTriggerCallback, bForwardTriggerViaOutputPins);
988 return pReader.get();
991 template <
typename ReaderType>
995 bool bForwardTriggerViaOutputPins)
997 auto pReader = CreateReader<ReaderType>(strName, oType);
998 CreateInputPin(pReader, fnSampleCallback, bForwardTriggerViaOutputPins);
999 return pReader.get();
1002 template<
typename ReaderType>
1006 bool bForwardTriggerViaOutputPins)
1008 auto pReader = CreateReader<ReaderType>(strName, oType);
1009 CreateInputPin(pReader, fnSampleDataCallback, bForwardTriggerViaOutputPins);
1010 return pReader.get();
1014 template <
typename Type,
typename ReaderType>
1018 bool bForwardTriggerViaOutputPins)
1024 if (pBuffer->GetSize() <
sizeof(Type))
1026 RETURN_ERROR_DESC(ERR_INVALID_ARG,
"Invalid sample received, its too small for the requested type");
1030 bForwardTriggerViaOutputPins);
1033 template <
typename WriterType>
1039 template <
typename WriterType>
1042 auto pWriter = CreateWriter<WriterType>(strName, oType);
1044 return pWriter.get();
1047 template <
typename Interface,
typename Instance>
1051 if (!pInstancePointer)
1053 THROW_ERROR_DESC(ERR_NOT_INITIALIZED,
"Unable to add interface server '%s', object_ptr_from_this has not been initialized. "
1054 "This AddInterfaceServer overload cannot be called from within the constructor.",
1061 ucom_object_ptr_cast<IObject>(pInstancePointer));
1065 template <
typename Interface>
1072 ucom_object_ptr_cast<IObject>(pInstance));
1076 template <
typename Interface>
1080 ucom::ant::make_object_ptr<streaming::ant::cBindingClient>(strName,
1083 return pBindingClient;
1086 template <
typename ReaderType>
1090 auto pReader = std::make_shared<ReaderType>();
1094 return AcceptType(pReader, pType);
1099 template <
typename WriterType>
1103 auto pWriter = std::make_shared<WriterType>();
1135 template <
typename RequestableWriterType = streaming::requestable_writer<>>
1136 RequestableWriterType* CreateRequestableOutputPin(
const char* strName,
1149 uint32_t nSubStreamId,
1185 uint32_t nSubStreamId,
1190 template <
typename RequestableWriterType>
1191 RequestableWriterType* cGraphObject::CreateRequestableOutputPin(
const char* strName,
const cStreamTypeHelper& oType)
1193 auto pWriter = CreateWriter<RequestableWriterType>(strName, oType);
1195 pWriter->SetCallbacks(std::bind(&cGraphObject::LockedCallEnableSubStream,
this, pWriter.get(), std::placeholders::_1, std::placeholders::_2),
1196 std::bind(&cGraphObject::LockedCallDisableSubStream,
this, pWriter.get(), std::placeholders::_1));
1197 return pWriter.get();
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 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)
Called by the default implementation of ProcessInput(streaming::flash::ISampleReader*,...
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)
Called by the default implementation of ProcessInput(base::flash::tNanoSeconds, streaming::flash::ISa...
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)
Default method to process input 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.
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.
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 RETURN_IF_FAILED(s)
returns if the expression returns a failed tResult or throws an 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