src
FWCore
SharedMemory
interface
ROOTDeserializer.h
Go to the documentation of this file.
1
#ifndef FWCore_SharedMemory_ROOTDeserializer_h
2
#define FWCore_SharedMemory_ROOTDeserializer_h
3
// -*- C++ -*-
4
//
5
// Package: FWCore/SharedMemory
6
// Class : ROOTDeserializer
7
//
16
//
17
// Original Author: Chris Jones
18
// Created: 22/01/2020
19
//
20
21
// system include files
22
#include "TClass.h"
23
#include "TBufferFile.h"
24
25
// user include files
26
27
// forward declarations
28
29
namespace
edm::shared_memory
{
30
template
<
typename
T,
typename
READBUFFER>
31
class
ROOTDeserializer
{
32
public
:
33
ROOTDeserializer
(READBUFFER& iBuffer)
34
:
buffer_
{iBuffer},
class_
{TClass::GetClass(
typeid
(
T
))},
bufferFile_
(TBuffer::kRead) {}
35
36
ROOTDeserializer
(
const
ROOTDeserializer
&) =
delete
;
37
const
ROOTDeserializer
&
operator=
(
const
ROOTDeserializer
&) =
delete
;
38
ROOTDeserializer
(
ROOTDeserializer
&&) =
delete
;
39
const
ROOTDeserializer
&
operator=
(
ROOTDeserializer
&&) =
delete
;
40
41
// ---------- const member functions ---------------------
42
43
// ---------- member functions ---------------------------
44
T
deserialize
() {
45
T
value
;
46
if
(
previousBufferIdentifier_
!=
buffer_
.bufferIdentifier()) {
47
auto
buff =
buffer_
.buffer();
48
bufferFile_
.SetBuffer(buff.first, buff.second, kFALSE);
49
previousBufferIdentifier_
=
buffer_
.bufferIdentifier();
50
}
51
52
class_
->ReadBuffer(
bufferFile_
, &
value
);
53
bufferFile_
.Reset();
54
return
value
;
55
}
56
57
private
:
58
// ---------- member data --------------------------------
59
READBUFFER&
buffer_
;
60
TClass*
const
class_
;
61
TBufferFile
bufferFile_
;
62
int
previousBufferIdentifier_
= 0;
63
};
64
}
// namespace edm::shared_memory
65
66
#endif
edm::shared_memory::ROOTDeserializer::previousBufferIdentifier_
int previousBufferIdentifier_
Definition:
ROOTDeserializer.h:62
edm::shared_memory::ROOTDeserializer::operator=
const ROOTDeserializer & operator=(const ROOTDeserializer &)=delete
edm::shared_memory
Definition:
buffer_names.h:27
edm::shared_memory::ROOTDeserializer::bufferFile_
TBufferFile bufferFile_
Definition:
ROOTDeserializer.h:61
value
Definition:
value.py:1
relativeConstraints.value
value
Definition:
relativeConstraints.py:53
edm::shared_memory::ROOTDeserializer::class_
TClass *const class_
Definition:
ROOTDeserializer.h:60
ROOTDeserializer
edm::shared_memory::ROOTDeserializer::buffer_
READBUFFER & buffer_
Definition:
ROOTDeserializer.h:59
edm::shared_memory::ROOTDeserializer
Definition:
ROOTDeserializer.h:31
edm::shared_memory::ROOTDeserializer::ROOTDeserializer
ROOTDeserializer(READBUFFER &iBuffer)
Definition:
ROOTDeserializer.h:33
edm::shared_memory::ROOTDeserializer::deserialize
T deserialize()
Definition:
ROOTDeserializer.h:44
T
long double T
Definition:
Basic3DVectorLD.h:48
Generated for CMSSW Reference Manual by
1.8.14