ADTF
sampleoutstream_intf.h
Go to the documentation of this file.
1 
7 #pragma once
9 #include "streamitem_intf.h"
10 
11 #include <adtfucom3/adtf_ucom3.h>
12 
13 namespace adtf
14 {
15 namespace streaming
16 {
17 namespace ant
18 {
29  {
30  protected:
32  ~ISampleOutStream() = default;
33  public:
35  ADTF_IID(ISampleOutStream, "sampleoutstream.ant.streaming.adtf.iid");
36 
37  public:
39  template <typename T>
41 
42  public:
47  virtual ISampleStreamAccess::tMode GetMode() const = 0;
48 
60  virtual tResult Flush() = 0;
61 
71  virtual tResult Write(const iobject_ptr<const ISample>& pSample) = 0;
79  virtual tResult Write(const iobject_ptr<const IStreamType>& pStreamType) = 0;
80 
86  virtual tResult SetStreamError(const tResult& oError) = 0;
87  };
88 
98  {
99  oStreamWriter.Write(pSample);
100  return oStreamWriter;
101  }
102 
112  {
113  oStreamWriter.Write(pStreamType);
114  return oStreamWriter;
115  }
116 
127  {
128  adtf::ucom::object_ptr<const IStreamType> pConst = pStreamType;
129  oStreamWriter.Write(pConst);
130  return oStreamWriter;
131  }
132 
145  {
146  return pStreamfunc(oStreamWriter);
147  }
148 
157  inline ISampleOutStream& operator<<(ISampleOutStream& oStreamWriter, const tResult& oErr)
158  {
159  oStreamWriter.SetStreamError(oErr);
160  return oStreamWriter;
161  }
162 
163 } //namespace ant
165 using ant::ISampleOutStream;
166 } //namespace streaming
167 } //namespace adtf
Copyright © Audi Electronics Venture GmbH.
The ISampleOutStream interface is return by the ISampleStream::Open call which allows to write into a...
virtual tResult Write(const iobject_ptr< const IStreamType > &pStreamType)=0
Write an stream type reference to the write queue of the ISampleStream.
virtual ISampleStreamAccess::tMode GetMode() const =0
Returns the writing mode of ISampleStream.
virtual tResult SetStreamError(const tResult &oError)=0
Forward an error to the corresponding stream.
~ISampleOutStream()=default
not destructable
virtual tResult Write(const iobject_ptr< const ISample > &pSample)=0
Write a sample refernce to a writers queue of the ISampleStream.
ADTF_IID(ISampleOutStream, "sampleoutstream.ant.streaming.adtf.iid")
Definition of interface id.
virtual tResult Flush()=0
Flushes the writers queue within the ISampleStream.
Base class for every interface type within the uCOM.
Definition: object_intf.h:31
Base object pointer to realize binary compatible reference counting in interface methods.
Object pointer implementation used for reference counting on objects of type IObject.
Definition: object_ptr.h:163
ISampleOutStream & operator<<(ISampleOutStream &oStreamWriter, const adtf::ucom::ant::iobject_ptr< const ISample > &pSample)
Streaming Operator<< to write a sample to a writers queue of the ISampleStream.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.