ATLAS Offline Software
Event
ByteStreamCnvSvcLegacy
src
offline_EventStorage
v5_DataBuffer.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "
v5_DataBuffer.h
"
7
8
#include <string.h>
9
10
class
offline_EventStorage_v5::DataBuffer::implementation
{
11
12
public
:
13
14
implementation
():
15
m_buffer
(0),
16
m_buffersize
(0){}
17
18
implementation
(
const
uint32_t
&
size
):
19
m_buffer
(0),
20
m_buffersize
(0){
21
m_buffer
=
new
char
[
size
];
22
m_buffersize
=
size
;
23
}
24
25
implementation
(
const
implementation
&) =
delete
;
26
implementation
&
operator=
(
const
implementation
&) =
delete
;
27
28
~implementation
()
29
{
delete
[]
m_buffer
; }
30
31
32
void
realloc
(
const
uint32_t
& newsize)
33
{
34
delete
[]
m_buffer
;
35
m_buffer
=
new
char
[newsize];
36
m_buffersize
= newsize;
37
}
38
39
void
grow
(
const
uint32_t
& newsize)
40
{
41
if
(newsize <=
m_buffersize
)
42
return
;
43
44
char
* new_buffer =
new
char
[newsize];
45
::memcpy(new_buffer,
m_buffer
,
m_buffersize
);
46
delete
[]
m_buffer
;
47
48
m_buffer
= new_buffer;
49
m_buffersize
= newsize;
50
}
51
52
void
*
handle
()
53
{
return
m_buffer
; }
54
55
uint32_t
buffersize
()
const
56
{
return
m_buffersize
; }
57
58
private
:
59
char
*
m_buffer
;
60
uint32_t
m_buffersize
;
61
62
};
63
64
offline_EventStorage_v5::DataBuffer::DataBuffer
():
65
m_rep(
new
implementation
())
66
{}
67
68
offline_EventStorage_v5::DataBuffer::DataBuffer
(
const
uint32_t
&
size
):
69
m_rep(
new
implementation
(
size
))
70
{}
71
72
offline_EventStorage_v5::DataBuffer::~DataBuffer
()
73
{
delete
m_rep; }
74
75
void
offline_EventStorage_v5::DataBuffer::realloc
(
const
uint32_t
& newsize)
76
{
return
m_rep->realloc(newsize); }
77
78
void
offline_EventStorage_v5::DataBuffer::grow
(
const
uint32_t
& newsize)
79
{
return
m_rep->grow(newsize); }
80
81
void
*
offline_EventStorage_v5::DataBuffer::handle
()
82
{
return
m_rep->handle(); }
83
84
uint32_t
offline_EventStorage_v5::DataBuffer::buffersize
()
const
85
{
return
m_rep->buffersize(); }
offline_EventStorage_v5::DataBuffer::implementation::implementation
implementation(const uint32_t &size)
Definition:
v5_DataBuffer.cxx:18
xAOD::uint32_t
setEventNumber uint32_t
Definition:
EventInfo_v1.cxx:127
offline_EventStorage_v5::DataBuffer::~DataBuffer
virtual ~DataBuffer()
Definition:
v5_DataBuffer.cxx:72
offline_EventStorage_v5::DataBuffer::implementation::handle
void * handle()
Definition:
v5_DataBuffer.cxx:52
CSV_InDetExporter.new
new
Definition:
CSV_InDetExporter.py:145
v5_DataBuffer.h
offline_EventStorage_v5::DataBuffer::implementation::m_buffer
char * m_buffer
Definition:
v5_DataBuffer.cxx:59
offline_EventStorage_v5::DataBuffer::grow
void grow(const uint32_t &newsize)
Definition:
v5_DataBuffer.cxx:78
offline_EventStorage_v5::DataBuffer::handle
void * handle()
Definition:
v5_DataBuffer.cxx:81
python.setupRTTAlg.size
int size
Definition:
setupRTTAlg.py:39
offline_EventStorage_v5::DataBuffer::implementation
Definition:
v5_DataBuffer.cxx:10
offline_EventStorage_v5::DataBuffer::implementation::operator=
implementation & operator=(const implementation &)=delete
offline_EventStorage_v5::DataBuffer::implementation::~implementation
~implementation()
Definition:
v5_DataBuffer.cxx:28
offline_EventStorage_v5::DataBuffer::DataBuffer
DataBuffer()
Definition:
v5_DataBuffer.cxx:64
offline_EventStorage_v5::DataBuffer::implementation::implementation
implementation()
Definition:
v5_DataBuffer.cxx:14
offline_EventStorage_v5::DataBuffer::realloc
void realloc(const uint32_t &newsize)
Definition:
v5_DataBuffer.cxx:75
offline_EventStorage_v5::DataBuffer::implementation::grow
void grow(const uint32_t &newsize)
Definition:
v5_DataBuffer.cxx:39
offline_EventStorage_v5::DataBuffer::implementation::realloc
void realloc(const uint32_t &newsize)
Definition:
v5_DataBuffer.cxx:32
offline_EventStorage_v5::DataBuffer::implementation::buffersize
uint32_t buffersize() const
Definition:
v5_DataBuffer.cxx:55
offline_EventStorage_v5::DataBuffer::buffersize
uint32_t buffersize() const
Definition:
v5_DataBuffer.cxx:84
offline_EventStorage_v5::DataBuffer::implementation::implementation
implementation(const implementation &)=delete
offline_EventStorage_v5::DataBuffer::implementation::m_buffersize
uint32_t m_buffersize
Definition:
v5_DataBuffer.cxx:60
Generated on Thu Nov 7 2024 21:31:20 for ATLAS Offline Software by
1.8.18