75 _runtime->GetObject(_clock);
114 RETURN_IF_FAILED(
SetType(pType));
168 tTimeStamp tmTime = _clock ? _clock->GetStreamTime() : adtf::util::cSystem::GetTime();
189 return oSampleWriter;
203 return oSampleWriter;
216 return oSampleWriter;
228 return pStreamfunc(oSampleWriter);
241 return oSampleWriter;
248template<
typename DATA_TYPE>
297 tTimeStamp tmTime = _clock ? _clock->GetStreamTime() : adtf_util::cSystem::GetTime();
298 RETURN_IF_FAILED(pSample->Set(tmTime, &oSampleData,
sizeof(DATA_TYPE)));
313template<
typename DATA_TYPE>
314ADTF3_DEPRECATED(
"Use sample_writer<DATA_TYPE>::Write(tmTime, oSampleData) instead.")
317 oSampleWriter.Transmit(oSampleData);
318 return oSampleWriter;
333 oSampleWriter << pSample;
335 return oSampleReader;
345 const char* strNameOfWriter,
348 oWriter.
SetName(strNameOfWriter);
349 return oWriter.
SetType(pStreamType);
364 ~cSampleWriter()
override;
399 class cImplementation;
400 std::unique_ptr<cImplementation> m_pImplementation;
405 const char* strNameOfWriter,
408 oWriter.
SetName(strNameOfWriter);
409 return oWriter.
SetType(pStreamType);
423 return oSampleWriter;
437 return oSampleWriter;
449 return pStreamfunc(oSampleWriter);
462 return oSampleWriter;
473template<
typename DATA_TYPE>
477 return oSampleWriter;
485 oSampleWriter << pSample;
487 return oSampleReader;
497template<
typename DATA_TYPE,
typename BASE = cSampleWriter>
511 using BASE::Transmit;
522 ADTF3_DEPRECATED(
"Use sample_writer<DATA_TYPE>::Write(tmTime, oSampleData) instead.")
527 return Write(tmTime, oSampleData);
551 static_assert(!std::is_pointer_v<DATA_TYPE>,
"pointer types are not allowed for sample writing. To support "
552 "this you need to specialize the sample_writer template");
558 RETURN_IF_FAILED(pFlashSample->SetTime(tmTime));
562 RETURN_IF_FAILED(pFlashSample->WriteLock(pSampleBuffer, oMemory.
GetSize()));
563 pSampleBuffer->Write(oMemory);
565 return BASE::Write(pSample);
568 ADTF3_DEPRECATED(
"Use sample_writer<DATA_TYPE>::Write(tmTime, oSampleData) instead.")
569 tResult Transmit(const DATA_TYPE& oSampleData)
571 return Write(oSampleData);
587 return Write(tmTime, oSampleData);
599template<
typename DATA_TYPE>
600ADTF3_DEPRECATED(
"Use sample_writer<DATA_TYPE>::Write(tmTime, oSampleData) instead.")
604 return oSampleWriter;
609using flash::cSampleWriter;
610using flash::sample_writer;
611using flash::make_sample_writer;
#define ADTF3_DEPRECATED(_depr_message_)
Definition adtf_base_deprecated.h:27
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 IS_OK(s)
Check if result is OK.
Definition result.h:17
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult
Definition result.h:88
#define RETURN_IF_POINTER_NULL(_ptr)
Return ERR_POINTER if _ptr is nullptr, which requires the calling function's return type to be tResul...
Definition result.h:49
@ RUN_TRIGGER
Trigger run call.
Definition runnable_intf.h:63
Definition string_intf.h:29
Definition rawmemory_base.h:412
size_t GetSize() const override
Retrieves the size of the content of the assigned value of type T.
Definition rawmemory_base.h:479
@ PushRead
Definition samplestreamaccess_intf.h:31
Definition samplestream_intf.h:30
virtual tResult Open(const char *strName, adtf::ucom::ant::iobject_ptr< ISampleInStream > &pInStream, const adtf::ucom::ant::iobject_ptr< const IStreamType > &pInitialAcceptedStreamType, IPushReadEventSink *&pPushEventSink, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize)=0
The default Sample Reader will read the incomung Stream of a IInPin. This sample reader has no intern...
Definition samplereader.h:177
virtual tResult GetNextSample(ucom::ant::iobject_ptr< const ISample > &pSample)
Definition samplereader.h:340
Definition samplewriter.h:34
virtual tResult ChangeType(const ucom::ant::iobject_ptr< const IStreamType > &pType)
Definition samplewriter.h:112
cSampleWriter(const char *strName, const ucom::ant::iobject_ptr< const IStreamType > &pStreamType)
Definition samplewriter.h:57
sample_streamer< ISampleWriter, cOutPin > base_type
base type
Definition samplewriter.h:40
virtual tResult Transmit(const ucom::ant::iobject_ptr< const ISample > &pSample)
Definition samplewriter.h:94
virtual tResult SetStreamError(tResult oErr)
Definition samplewriter.h:144
virtual tResult Flush()
Definition samplewriter.h:126
tResult BeginStreaming(ISampleStream &oSampleStream) override
Definition samplewriter.h:62
tResult EndStreaming() override
Definition samplewriter.h:81
tResult ManualTrigger()
Definition samplewriter.h:164
ucom::object_ptr< ISampleOutStream > m_pOutStream
The SampleOutStream which is opened while BeginStreaming.
Definition samplewriter.h:37
virtual ~cSampleWriter()
DTOR.
Definition samplewriter.h:51
cSampleWriter()
CTOR.
Definition samplewriter.h:47
ucom::object_ptr< const IStreamType > m_pStreamType
Definition samplereader.h:49
adtf_util::cString m_strName
Definition samplereader.h:47
tResult SetType(const ucom::ant::iobject_ptr< const IStreamType > &pStreamType)
Definition samplereader.h:140
ucom::object_ptr< cOutPin > m_poPin
Definition samplereader.h:51
void SetName(const char *strName)
Definition samplereader.h:84
sample_streamer(const sample_streamer &)=delete
Definition samplewriter.h:250
tResult Transmit(const DATA_TYPE &oSampleData)
Definition samplewriter.h:293
Definition samplestreamer_intf.h:188
virtual tResult GetNextSample(ucom::ant::iobject_ptr< const ant::ISample > &pSample)=0
virtual void SetName(const char *strName)=0
virtual tResult SetType(const ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType)=0
Definition samplestreamer_intf.h:234
virtual tResult ChangeType(const ucom::ant::iobject_ptr< const ant::IStreamType > &pType)=0
virtual tResult SetStreamError(tResult oError)=0
virtual tResult Write(const ucom::ant::iobject_ptr< const ant::ISample > &pSample)=0
tResult GetStreamerPin(ucom::ant::iobject_ptr< IStreamerPin > &pStreamerPin) const
void SetName(const char *strName) override
tResult EndStreaming() override
tResult GetType(ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType) const override
tResult Write(const ucom::ant::iobject_ptr< const ant::ISample > &pSample) override
tResult ChangeType(const ucom::ant::iobject_ptr< const ant::IStreamType > &pType) override
tResult ManualTrigger(base::flash::tNanoSeconds tmActivationTime=base::flash::tNanoSeconds{-1}) override
tResult BeginStreaming(ISampleStream &oSampleStream) override
tResult GetName(base::ant::IString &&strName) override
virtual tResult Transmit(const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
tResult SetType(const ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType) override
tResult SetStreamerPin(const ucom::ant::iobject_ptr< IStreamerPin > &pStreamerPin) override
tResult SetStreamError(tResult oError) override
Definition samplewriter.h:499
sample_writer()
Default CTOR.
Definition samplewriter.h:505
ucom::ant::object_ptr< services::flash::IReferenceClock > m_pClock
Definition samplewriter.h:596
tResult Transmit(base::flash::tNanoSeconds tmTime, const DATA_TYPE &oSampleData)
Writes Data of the given DATA_TYPE. The Sample Time of the created Sample is retrieved from the IRefe...
Definition samplewriter.h:585
tResult Write(tTimeStamp tmTime, const DATA_TYPE &oSampleData)
Definition samplewriter.h:537
tResult Write(base::flash::tNanoSeconds tmTime, const DATA_TYPE &oSampleData)
Definition samplewriter.h:549
tResult Transmit(tTimeStamp tmTime, const DATA_TYPE &oSampleData)
Writes Data of the given DATA_TYPE. The Sample Time of the created Sample is retrieved from the IRefe...
Definition samplewriter.h:577
tResult Write(const DATA_TYPE &oSampleData)
Writes Data of the given DATA_TYPE. The Sample Time of the created Sample is retrieved from the IRefe...
Definition samplewriter.h:523
Base object pointer to realize binary compatible reference counting in interface methods.
Definition object_ptr_intf.h:112
Definition lockedobject_intf.h:207
Definition object_ptr.h:384
DestinationTimeStamp duration_cast(const SourceTimeStamp &) noexcept
Duration cast base template to converted between different time resolution.
Definition chrono.h:155
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
Definition bindingproxyoutport.h:16
tResult make_sample_writer(cSampleWriter &oWriter, const char *strNameOfWriter, const ucom::ant::iobject_ptr< const IStreamType > &pStreamType)
Definition samplewriter.h:344
const ISampleInStream & operator>>(const ISampleInStream &oStreamReader, IStreamItem &oItem)
Definition sampleinstream_intf.h:80
ISampleOutStream & operator<<(ISampleOutStream &oStreamWriter, const adtf::ucom::ant::iobject_ptr< const ISample > &pSample)
Definition sampleoutstream_intf.h:97
tResult alloc_sample(ucom::ant::iobject_ptr< ucom::ant::IObject > &pSampleObject, const char *strSampleCID)
ISampleWriter & operator<<(ISampleWriter &oSampleWriter, const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
streaming operator to write a sample to the sample writer
Definition samplewriter.h:419
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
tResult alloc_sample(ucom::ant::iobject_ptr< ucom::ant::IObject > &pSample)
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
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14
A timestamp with nanosecond precision.
Definition chrono.h:23