ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
stream_intf.h
Go to the documentation of this file.
1
7
8#ifndef _ADTF_UCOM_ANT_STREAM_INTERFACE_INCLUDES_HEADER_
9#define _ADTF_UCOM_ANT_STREAM_INTERFACE_INCLUDES_HEADER_
10
11namespace adtf
12{
13namespace ucom
14{
15namespace ant
16{
17
23class 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
53class 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
83class DOEXPORT IStream : public IInputStream, public IOutputStream
84{
85public:
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 {
103
106
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
160using ant::IStream;
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:45
tInt64 tFilePos
type definition for a file or stream position value (platform and compiler independent type).
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
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:33
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.
@ SO_End
The position is relative to end of the stream.
@ SO_Current
The position is relative to the current stream position.
@ SO_Begin
The position origin is the beginning of the stream.
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 --> Only the final implementation can be destroyed!
virtual tResult Flush()=0
Flush stream data.
Namespace for all functionality provided since v3.0.
Namespace for the ADTF uCOM3 SDK.
Namespace for entire ADTF SDK.