ADTF  3.18.2
stream_intf.h
Go to the documentation of this file.
1 
8 #ifndef _ADTF_UCOM_ANT_STREAM_INTERFACE_INCLUDES_HEADER_
9 #define _ADTF_UCOM_ANT_STREAM_INTERFACE_INCLUDES_HEADER_
10 
11 namespace adtf
12 {
13 namespace ucom
14 {
15 namespace ant
16 {
17 
23 class DOEXPORT IInputStream : public IObject
24 {
25  public:
30  ADTF_IID(IInputStream, "input_stream.ant.ucom.adtf.iid");
31 
32  public:
45  virtual tResult Read(void* pvBuffer, size_t nBufferSize, size_t* pnBytesRead = nullptr) const = 0;
46 };
47 
53 class DOEXPORT IOutputStream: public IObject
54 {
55  public:
60  ADTF_IID(IOutputStream, "output_stream.ant.ucom.adtf.iid");
61 
62  public:
75  virtual tResult Write(const void* pvBuffer, size_t nBufferSize, size_t* pnBytesWritten = nullptr) = 0;
76 };
77 
83 class DOEXPORT IStream : public IInputStream, public IOutputStream
84 {
85 public:
90  ADTF_IID(IStream, "stream.ant.ucom.adtf.iid");
91 
93 
94  public:
95  static const uint8_t m_ui8PlatformByteOrder;
96 
97  public:
99  typedef enum : uint8_t
100  {
102  SO_Begin = 0,
103 
105  SO_Current = 1,
106 
108  SO_End = 2
109  } tSeekOrigin;
110 
112  typedef enum
113  {
115  SF_NONE = 0x00
116  } tStreamFlags;
117 
118  public:
119 
132  virtual tResult Seek(tFilePos nPos, tSeekOrigin eOrigin, tFilePos* pNewPos=nullptr) const = 0;
133 
141  virtual tResult Reset() = 0;
142 
150  virtual tResult Flush() = 0;
151 
152  protected:
154  ~IStream() = default;
155 };
156 
157 }//namespace ant
158 
160 using ant::IStream;
161 using ant::IInputStream;
162 using ant::IOutputStream;
163 
164 
165 }//namespace ucom
166 }//namespace adtf
167 
168 //*************************************************************************************************
169 #endif //_ADTF_UCOM_ANT_STREAM_INTERFACE_INCLUDES_HEADER_
#define UCOM_RESOLVE(...)
Resolve a path to a base class which is inherited multiple times.
Definition: adtf_iid.h:40
tInt64 tFilePos
type definition for a file or stream position value (platform and compiler independent type).
An interface for reading data from a stream.
Definition: stream_intf.h:24
virtual tResult Read(void *pvBuffer, size_t nBufferSize, size_t *pnBytesRead=nullptr) const =0
Read data from stream.
ADTF_IID(IInputStream, "input_stream.ant.ucom.adtf.iid")
Marks the IInputStream to be castable with the ucom_cast<>
Base class for every interface type within the uCOM.
Definition: object_intf.h:31
An interface for writing data to a stream.
Definition: stream_intf.h:54
virtual tResult Write(const void *pvBuffer, size_t nBufferSize, size_t *pnBytesWritten=nullptr)=0
Write data to stream.
ADTF_IID(IOutputStream, "output_stream.ant.ucom.adtf.iid")
Marks the IOutputStream to be castable with the ucom_cast<>
The IStream interface provides defines methods for streaming data.
Definition: stream_intf.h:84
tSeekOrigin
Stream seek origin.
Definition: stream_intf.h:100
virtual tResult Seek(tFilePos nPos, tSeekOrigin eOrigin, tFilePos *pNewPos=nullptr) const =0
Set stream position.
virtual tResult Reset()=0
Reset stream.
ADTF_IID(IStream, "stream.ant.ucom.adtf.iid")
Marks the IStream to be castable with the ucom_cast<>
~IStream()=default
Protected destructor --> Use implemented Destroy() instead of delete!
virtual tResult Flush()=0
Flush stream data.
Namespace for entire ADTF SDK.