ADTF  3.15.1
samplebuffer_intf.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include <adtfucom3/adtf_ucom3.h>
10 
11 namespace adtf
12 {
13 namespace streaming
14 {
15 namespace ant
16 {
17 
22 {
23  protected:
25  ~ISampleBuffer() = default;
26  public:
28  ADTF_IID(ISampleBuffer, "samplebuffer.ant.streaming.adtf.iid");
29  public:
30 
40  virtual tResult Write(const base::ant::IRawMemory& oBufferWrite) = 0;
41 
51  virtual tResult Read(base::ant::IRawMemory&& oBufferRead) const = 0;
52 
60  virtual void* GetPtr() = 0;
61 
68  virtual const void* GetPtr() const = 0;
72  virtual size_t GetSize() const = 0;
76  virtual size_t GetCapacity() const = 0;
77 
87  virtual tResult Reserve(size_t szSize) = 0;
88 
98  virtual tResult Resize(size_t szSize) = 0;
99 };
100 
105 {
106  protected:
109  public:
111  ADTF_IID(ISampleBufferFactory, "samplebufferfactory.ant.streaming.adtf.iid");
112 
113  public:
122  virtual tResult GetBuffer(ucom::ant::iobject_ptr<ISampleBuffer>& pBuffer, size_t szPreAllocateSize) = 0;
123 };
124 
125 } //namespace ant
127 using ant::ISampleBuffer;
130 } //namespace streaming
131 
132 namespace base
133 {
134 namespace ant
135 {
136 
139 template <>
141 {
142  static tResult Assign(const ::adtf::streaming::ant::ISampleBuffer* /* pAssignValue */,
143  const size_t /* szStaticSize */,
144  const void* /* pValueToSet */,
145  const size_t /* szSizeToSet */)
146  {
147  RETURN_ERROR_DESC(ERR_ACCESS_DENIED, "Const Variant. NoAssignment possible");
148  }
149  static const void* GetPtr(const ::adtf::streaming::ant::ISampleBuffer* pAssignValue)
150  {
151  return pAssignValue->GetPtr();
152  }
153  static size_t GetSize(const ::adtf::streaming::ant::ISampleBuffer* pAssignValue, const size_t /* szStaticSize */)
154  {
155  return pAssignValue->GetSize();
156  }
157 };
158 
159 } // namespace ant
160 } // namespace base
161 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
A common result class usable as return value throughout.
The IRawMemory interface provides methods for getting and setting memory values through abstract inte...
The SampleBuffer factory manages and can create SampleBuffers.
~ISampleBufferFactory()=default
not destructable
virtual tResult GetBuffer(ucom::ant::iobject_ptr< ISampleBuffer > &pBuffer, size_t szPreAllocateSize)=0
Retrieve a Buffer of the factory with the szPreAllocateSize in bytes.
ADTF_IID(ISampleBufferFactory, "samplebufferfactory.ant.streaming.adtf.iid")
defintion of interfac id
The SampleBuffer is the memory block object for the data of a ISample.
virtual tResult Reserve(size_t szSize)=0
Reserves memory.
virtual size_t GetCapacity() const =0
Returns the current maximal capacity in bytes.
virtual tResult Resize(size_t szSize)=0
Resizes the Buffer.
ADTF_IID(ISampleBuffer, "samplebuffer.ant.streaming.adtf.iid")
Defintion of interface ID.
virtual tResult Write(const base::ant::IRawMemory &oBufferWrite)=0
Copy Writing Access.
virtual size_t GetSize() const =0
Returns the current size in bytes.
~ISampleBuffer()=default
not destructable
virtual void * GetPtr()=0
Direct Writing Access.
virtual tResult Read(base::ant::IRawMemory &&oBufferRead) const =0
Copy Reading Access.
virtual const void * GetPtr() const =0
Direct Reading Access.
Base class for every interface type within the uCOM.
Definition: object_intf.h:31
The ISharedLockedObject interface defines shared locking of an object.
Base object pointer to realize binary compatible reference counting in interface methods.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
#define RETURN_ERROR_DESC(_code,...)
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
Concept template class for non trivial penguin::adtf_memory types of type T to specialize the usage o...
static tResult Assign(T *pAssignValue, const size_t szStaticSize, const void *pValueToSet, const size_t szSizeToSet)
Sets (copy) the memory value pValueToSet of size in bytes szSizeToSet to the of container class T in ...
static size_t GetSize(const T *pAssignValue, const size_t szStaticSize)
Gets size in bytes of the memory pointer of container class T in parameter pAssignValue.
static const void * GetPtr(const T *pAssignValue)
Gets the memory pointer to the of container class T in parameter pAssignValue.