ATLAS Offline Software
OffloadBuffer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGACCELEVENT_OFFLOADBUFFER_H
6 #define TRIGACCELEVENT_OFFLOADBUFFER_H
7 
8 #include "DataExportBuffer.h"
9 #include <cstring>
10 
11 namespace TrigAccel {
12 
13  class OffloadBuffer {
14  public:
16  m_rawBuffer = new unsigned char[m_bufferSize];
17  }
18 
20  const size_t bufferOffset = 256;
21  m_bufferSize = pB->m_size - bufferOffset;
22  m_rawBuffer = new unsigned char[m_bufferSize];
23  memcpy(m_rawBuffer, pB->m_buffer + bufferOffset, m_bufferSize);
24  }
25 
26  virtual ~OffloadBuffer() {
27  delete[] m_rawBuffer;
28  }
29 
30  // no copy/assign
31  OffloadBuffer(const OffloadBuffer&) = delete;
33 
34  unsigned char* get() {
35  return m_rawBuffer;
36  }
37 
38  size_t m_bufferSize;
39  unsigned char* m_rawBuffer;
40  };
41 }
42 
43 #endif
TrigAccel::DataExportBuffer
Definition: DataExportBuffer.h:14
TrigAccel::OffloadBuffer::OffloadBuffer
OffloadBuffer(const DATA_EXPORT_BUFFER *pB)
Definition: OffloadBuffer.h:19
TrigAccel::OffloadBuffer::m_bufferSize
size_t m_bufferSize
Definition: OffloadBuffer.h:38
TrigAccel::DataExportBuffer::m_size
size_t m_size
Definition: DataExportBuffer.h:56
DataExportBuffer.h
TrigAccel::OffloadBuffer::operator=
OffloadBuffer & operator=(const OffloadBuffer &)=delete
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TrigAccel::OffloadBuffer::~OffloadBuffer
virtual ~OffloadBuffer()
Definition: OffloadBuffer.h:26
TrigAccel::OffloadBuffer::OffloadBuffer
OffloadBuffer(size_t size)
Definition: OffloadBuffer.h:15
TrigAccel::DataExportBuffer::m_buffer
char * m_buffer
Definition: DataExportBuffer.h:57
TrigAccel::OffloadBuffer::m_rawBuffer
unsigned char * m_rawBuffer
Definition: OffloadBuffer.h:39
TrigAccel::OffloadBuffer
Definition: OffloadBuffer.h:13
TrigAccel::OffloadBuffer::get
unsigned char * get()
Definition: OffloadBuffer.h:34
TrigAccel::OffloadBuffer::OffloadBuffer
OffloadBuffer(const OffloadBuffer &)=delete
TrigAccel
Definition: DataExportBuffer.h:12