ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
samplestream.h
Go to the documentation of this file.
1
7#pragma once
8#include "samplestream_intf.h"
11#include "streamtype.h"
13#include "triggerpipe_intf.h"
14#include "triggerpipe.h"
16
17#include <adtfbase/adtf_base.h>
19
20#include <memory>
21
22namespace adtf
23{
24namespace streaming
25{
26namespace ant
27{
28namespace detail
29{
37 class cSampleStreamBase: public adtf::base::ant::runnable<adtf::base::ant::IRunnable::RUN_TRIGGER>
38 {
41
42
43 protected:
52
53 public:
57 virtual ~cSampleStreamBase() override;
58
64
65 public:
68 tResult Open(const char* strName,
70 const adtf::ucom::ant::iobject_ptr<const IStreamType>& pInitialAcceptedStreamType,
71 ISampleStream::IPushReadEventSink*& pPushEventSink,
73 size_t szQueueSize,
93 tResult Open(const char* strName,
96 size_t szQueueSize,
98
101
115
121 tResult SetFullName(const char* strName);
122
126 tResult RunTrigger(tTimeStamp tmActivationTime);
127
134
139 void SetSubStreamFilter(const char* strSubStream);
140
144 uint64_t GetItemCount();
145 };
146}
147
152 template <typename INTERFACE = ISampleStream>
153 class sample_stream: public ucom::catwo::object<detail::cSampleStreamBase, ISampleStream, named_graph_object<trigger_pipe_item<INTERFACE>>>
154 {
156
157 protected:
158 sample_stream(sample_stream&&) = delete;
159 sample_stream(const sample_stream&) = delete;
160 sample_stream& operator=(sample_stream&&) = delete;
161 sample_stream& operator=(const sample_stream&) = delete;
162
163 public:
164 sample_stream()
165 {
166 base_type::SetRunnable(*static_cast<detail::cSampleStreamBase*>(this));
167 }
168 sample_stream(const char* strName) : sample_stream()
169 {
170 SetName(strName);
171 }
172 ~sample_stream() = default;
173
174 tResult SetName(const char* strName) override
175 {
178 }
179
180 tResult SetParent(const ucom::ant::IObject* oParentObject) override
181 {
184 }
185
186 tResult Open(const char* strName,
188 const adtf::ucom::ant::iobject_ptr<const IStreamType>& pInitialAcceptedStreamType,
189 ISampleStream::IPushReadEventSink*& pPushEventSink,
191 size_t szQueueSize) override
192 {
193 return detail::cSampleStreamBase::Open(strName,
194 pInStream,
195 pInitialAcceptedStreamType,
196 pPushEventSink,
197 ui32Mode,
198 szQueueSize,
200 }
201
202 tResult Open(const char* strName,
205 size_t szQueueSize) override
206 {
207 return detail::cSampleStreamBase::Open(strName,
208 pOutStream,
209 ui32Mode,
210 szQueueSize,
212 }
213
214 tResult GetType(adtf::ucom::ant::iobject_ptr<const IStreamType>& pStreamType) const override
215 {
216 return detail::cSampleStreamBase::GetType(pStreamType);
217 }
218
223 tTimeStamp GetTime() const override
224 {
226 }
227
228 tResult SetStreamError(const tResult& oError) override
229 {
231 }
232
234 {
235 return detail::cSampleStreamBase::AttachRouting(pSampleStreamTo);
236 }
237
239 {
240 return detail::cSampleStreamBase::DetachRouting(pSampleStreamTo);
241 }
242 };
243
251 public sample_stream<ISampleStream>
252 {
255
256 public:
258 ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream");
259
260 public:
262 template<typename T>
263 using iobject_ptr = adtf::ucom::ant::iobject_ptr < T >;
264
265 protected:
267 cSampleStream(const cSampleStream&) = delete;
274
275 public:
277 cSampleStream() = default;
279 cSampleStream(const char* strName)
280 {
281 sample_stream::SetName(strName);
282 }
283
284 virtual ~cSampleStream() = default;
285
286 };
287
288
289} //namespace ant
290
291namespace flash
292{
293
294class cSampleStream: public ucom::catwo::object<base::ant::IRunnable,
295 ant::ITriggerPipeSource,
296 ant::ITriggerPipeItem,
297 ant::INamedGraphObject,
298 ant::ISampleStream,
299 hollow::IInternalBindingProxy,
300 base::flash::IRunnable>
301{
302 public:
303 ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream");
304
305 public:
306 cSampleStream();
307 cSampleStream(const char* strName);
308
309 public:
310 tResult GetStreamError();
311 tResult GetType(ucom::ant::iobject_ptr<const ant::IStreamType>& pStreamType) const override;
312 tTimeStamp GetTime() const override;
313 tResult SetStreamError(const tResult& oError) override;
314 tResult AttachRouting(const ucom::ant::iobject_ptr<ant::ISampleStream>& pSampleStreamTo) override;
315 tResult DetachRouting(const ucom::ant::iobject_ptr<ant::ISampleStream>& pSampleStreamTo) override;
316 tResult Open(const char* strName,
318 const ucom::ant::iobject_ptr<const ant::IStreamType>& pInitialAcceptedStreamType,
321 size_t szQueueSize) override;
322 tResult Open(const char* strName,
325 size_t szQueueSize) override;
326
327 ADTF_FLASH_TRIGGER_PIPE_ITEM_METHOD_DECLARATIONS
328
329 tResult GetInternalBindingProxy(ucom::ant::iobject_ptr<ant::IBindingProxy>& pBindingProxy) override;
330 void SetSubStreamFilter(const char* strSubStream);
331 void SetForwardAllTriggers(bool bForwardAll);
332
333 protected:
334 ~cSampleStream() override;
335
336 protected:
337 class cImplementation;
338 std::unique_ptr<cImplementation> m_pImplementation;
339};
340
341}
342
343namespace quiet
344{
345
346class cSampleStream: public ucom::catwo::object<flash::cSampleStream,
347 ITriggerPipeHierachy>
348{
349 public:
350 ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream");
351
352 public:
353 cSampleStream();
354 cSampleStream(const char* strName);
355
356 ADTF_QUIET_TRIGGER_PIPE_ITEM_METHOD_DECLARATIONS
357
358 ~cSampleStream() override;
359};
360
361}
362
364using quiet::cSampleStream;
365
366using ant::sample_stream;
367} //namespac streaming
368} //namespace adtf
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
#define ADTF_CLASS_ID_NAME(_class, _strcid, _strclabel)
Common macro to enable correct treatment of class identifier AND Class Name by IClassInfo.
Definition class_id.h:33
Runnable helper implementaton template.
Definition runnable.h:58
adtf::ucom::ant::iobject_ptr< T > iobject_ptr
used type for iobject_ptr
A_UTILS_D(cSampleStream)
private d-pointer
cSampleStream(const cSampleStream &)=delete
deleted copy CTOR
cSampleStream & operator=(const cSampleStream &)=delete
deleted copy operator
ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream")
Implements adtf::ucom::IClassInfo.
cSampleStream(cSampleStream &&)=delete
deleted move CTOR
cSampleStream(const char *strName)
CTOR initializes the name of the stream.
cSampleStream & operator=(cSampleStream &&)=delete
deleted move operator
virtual ~cSampleStream()=default
DTOR.
The implementation of the ISampleStream base implemenation.
cSampleStreamBase & operator=(const cSampleStreamBase &)=delete
deleted copy operator
tResult GetType(adtf::ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const
Retrieves the current type of the stream.
tResult RunTrigger(tTimeStamp tmActivationTime)
Internal Run implementation.
tResult AttachRouting(const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo)
Attaches a SampleStream where to route the Write / Flush and Run calls to.
cSampleStreamBase & operator=(cSampleStreamBase &&)=delete
deleted move operator
tResult SetStreamError(const tResult &oError)
Sets and forwards a StreamError to the readers.
void SetSubStreamFilter(const char *strSubStream)
If set, only Stream Types and Samples of the given Substream mwill be forwarded.
tResult Open(const char *strName, adtf::ucom::ant::iobject_ptr< ISampleOutStream > &pOutStream, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize, adtf::ucom::ant::IObject *pParent)
Opens The SampleStream for writing access.
tTimeStamp GetTime() const
Returns the last flush time and so the current position of the stream.
tResult Open(const char *strName, adtf::ucom::ant::iobject_ptr< ISampleInStream > &pInStream, const adtf::ucom::ant::iobject_ptr< const IStreamType > &pInitialAcceptedStreamType, ISampleStream::IPushReadEventSink *&pPushEventSink, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize, adtf::ucom::ant::IObject *pParent)
Opens The SampleStream for reading access.
cSampleStreamBase(const cSampleStreamBase &)=delete
deleted copy CTOR
tResult GetStreamError()
Getter for the last forwarded stream error.
tResult DetachRouting(const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo)
Detaches a SampleStream where the routing was set by AttachRouting.
tResult GetInternalBindingProxy(ucom::ant::iobject_ptr< ant::IBindingProxy > &pBindingProxy)
Get the internal Binding Proxy.
cSampleStreamBase(cSampleStreamBase &&)=delete
deleted move CTOR
A_UTILS_D(cSampleStreamBase)
private d-pointer
tResult SetFullName(const char *strName)
Set the name which is used for error handling etc.
Default convenient implementation for INamedGraphObject.
tResult SetParent(const ucom::ant::IObject *poParentObject) override
tResult AttachRouting(const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo) override
Attaches a SampleStream where to route the Write / Flush and Run calls to.
tResult SetStreamError(const tResult &oError) override
Sets and forwards a StreamError to the readers.
tResult DetachRouting(const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo) override
Detaches a SampleStream where the routing was set by AttachRouting.
tTimeStamp GetTime() const override
Returns the last flush time and so the current position of the stream.
Base class for every interface type within the uCOM.
Definition object_intf.h:33
Base object pointer to realize binary compatible reference counting in interface methods.
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition object.h:397
Namespace for internal functionality.
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
adtf_util::cString get_named_graph_object_full_name(const INamedGraphObject &oGraphObject)
Helper function to retrieve a full qualified unique name of an object registered in IFilterGraph.
Namespace for all functionality of the ADTF Streaming SDK provided since v3.5.
Namespace for all functionality of the ADTF Streaming SDK provided since v3.16.
Namespace for the ADTF Streaming SDK.
InterfacePointerType ucom_cast(ObjectPointerType i_pObject)
Used to cast arbitrary interface types within the UCOM.
Definition ucom_cast.h:126
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.