Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Utilities
StorageFactory
src
Storage.cc
Go to the documentation of this file.
1
#include "
Utilities/StorageFactory/interface/Storage.h
"
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
#include <cassert>
4
5
Storage::Storage
(
void
) {}
6
7
Storage::~Storage
(
void
) {}
8
10
IOSize
Storage::read
(
IOBuffer
into,
IOOffset
pos
) {
return
read
(into.
data
(), into.
size
(),
pos
); }
11
12
IOSize
Storage::read
(
void
*into,
IOSize
n
,
IOOffset
pos
) {
13
// FIXME: this is not thread safe! split into separate interface
14
// that a particular storage can choose to support or not? make
15
// sure that throw semantics are correct here!
16
// FIXME: use saveposition object in case exceptions are thrown?
17
IOOffset
here =
position
();
18
position
(
pos
);
19
n
=
read
(into,
n
);
20
position
(here);
21
return
n
;
22
}
23
24
IOSize
Storage::readv
(
IOPosBuffer
*into,
IOSize
n
) {
25
IOOffset
here =
position
();
26
IOSize
total
= 0;
27
for
(
IOSize
i
= 0;
i
<
n
; ++
i
) {
28
try
{
29
position
(into[
i
].
offset
());
30
total
+=
read
(into[
i
].
data
(), into[
i
].
size
());
31
}
catch
(
cms::Exception
&) {
32
if
(!
total
)
33
throw
;
34
break
;
35
}
36
}
37
position
(here);
38
return
total
;
39
}
40
42
IOSize
Storage::write
(
IOBuffer
from,
IOOffset
pos
) {
return
write
(from.
data
(), from.
size
(),
pos
); }
43
44
IOSize
Storage::write
(
const
void
*from,
IOSize
n
,
IOOffset
pos
) {
45
// FIXME: this is not thread safe! split into separate interface
46
// that a particular storage can choose to support or not? make
47
// sure that throw semantics are correct here!
48
49
// FIXME: use saveposition object in case exceptions are thrown?
50
IOOffset
here =
position
();
51
position
(
pos
);
52
n
=
write
(from,
n
);
53
position
(here);
54
return
n
;
55
}
56
57
IOSize
Storage::writev
(
const
IOPosBuffer
*from,
IOSize
n
) {
58
IOSize
total
= 0;
59
for
(
IOSize
i
= 0;
i
<
n
; ++
i
) {
60
try
{
61
total
+=
write
(from[
i
].
data
(), from[
i
].
size
(), from[
i
].
offset
());
62
}
catch
(
cms::Exception
&) {
63
if
(!
total
)
64
throw
;
65
break
;
66
}
67
}
68
return
total
;
69
}
70
72
IOOffset
Storage::position
(
void
)
const
{
73
Storage
*
self
= const_cast<Storage *>(
this
);
74
return
self
->position(0,
CURRENT
);
75
}
76
77
IOOffset
Storage::size
(
void
)
const
{
78
// FIXME: use saveposition object in case exceptions are thrown?
79
Storage
*
self
= const_cast<Storage *>(
this
);
80
IOOffset
here =
position
();
81
self
->position(0,
END
);
82
IOOffset
size
=
position
();
83
self
->position(here);
// FIXME: VERIFY()?
84
return
size
;
85
}
86
87
void
Storage::rewind
(
void
) {
position
(0); }
88
90
bool
Storage::prefetch
(
const
IOPosBuffer
*
/* what */
,
IOSize
/* n */
) {
return
false
; }
91
93
void
Storage::flush
(
void
) {}
94
95
void
Storage::close
(
void
) {}
96
98
bool
Storage::eof
(
void
)
const
{
return
position
() ==
size
(); }
Storage::size
virtual IOOffset size(void) const
Definition:
Storage.cc:77
IOBuffer::size
IOSize size(void) const
Definition:
IOBuffer.h:34
mps_fire.i
i
Definition:
mps_fire.py:428
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
pos
Definition:
PixelAliasList.h:18
Storage::eof
virtual bool eof(void) const
Definition:
Storage.cc:98
Storage::END
Definition:
Storage.h:22
Storage.h
Storage::readv
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition:
Storage.cc:24
IOBuffer
Definition:
IOBuffer.h:7
IOBuffer::data
void * data(void) const
Definition:
IOBuffer.h:31
Storage::rewind
virtual void rewind(void)
Definition:
Storage.cc:87
IOOffset
int64_t IOOffset
Definition:
IOTypes.h:19
Storage::Storage
Storage(void)
Definition:
Storage.cc:5
Storage::~Storage
~Storage(void) override
Definition:
Storage.cc:7
Storage::flush
virtual void flush(void)
Definition:
Storage.cc:93
Storage::prefetch
virtual bool prefetch(const IOPosBuffer *what, IOSize n)
Definition:
Storage.cc:90
Storage::writev
virtual IOSize writev(const IOPosBuffer *from, IOSize buffers)
Definition:
Storage.cc:57
Storage::position
virtual IOOffset position(void) const
Definition:
Storage.cc:72
IOInput::read
int read(void)
Definition:
IOInput.cc:52
Storage::close
virtual void close(void)
Definition:
Storage.cc:95
Exception.h
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
Storage::CURRENT
Definition:
Storage.h:22
dqmMemoryStats.total
total
Definition:
dqmMemoryStats.py:152
IOPosBuffer
Definition:
IOPosBuffer.h:7
cms::Exception
Definition:
Exception.h:70
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition:
hltrates_dqm_sourceclient-live_cfg.py:82
IOSize
size_t IOSize
Definition:
IOTypes.h:14
Storage
Definition:
Storage.h:20
Storage::write
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition:
Storage.cc:44
Generated for CMSSW Reference Manual by
1.8.16