ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
ByteStreamCnvSvcBase
ByteStreamCnvSvcBase
IByteStreamCnvSvc.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef BYTESTREAMCNVSVCBASE_IBYTESTREAMCNVSVC_H
6
#define BYTESTREAMCNVSVCBASE_IBYTESTREAMCNVSVC_H
7
8
#include "GaudiKernel/IInterface.h"
9
10
#include "
AthenaKernel/errorcheck.h
"
11
#include "
ByteStreamData/RawEvent.h
"
12
#include "
ByteStreamCnvSvcBase/FullEventAssembler.h
"
13
14
18
class
IByteStreamCnvSvc
:
virtual
public
IInterface {
19
public
:
21
DeclareInterfaceID
(
IByteStreamCnvSvc
, 1, 0);
22
24
template
<
class
T> StatusCode
getFullEventAssembler
(T*&t,
const
std::string& name);
25
26
protected
:
27
31
virtual
FullEventAssemblerBase
*
findFullEventAssembler
(
const
std::string& name)
const
= 0;
32
36
virtual
StatusCode
storeFullEventAssembler
(std::unique_ptr<FullEventAssemblerBase> fea,
const
std::string& name) = 0;
37
};
38
39
40
// Implementation of template method:
41
template
<
class
T>
42
StatusCode
IByteStreamCnvSvc::getFullEventAssembler
(T*& t,
const
std::string& name)
43
{
44
// Find existing FEA
45
FullEventAssemblerBase
* fea =
findFullEventAssembler
(name);
46
if
(fea) {
47
t =
dynamic_cast<
T*
>
(fea);
48
if
(t ==
nullptr
) {
49
REPORT_MESSAGE_WITH_CONTEXT
(MSG::ERROR,
"IByteStreamCnvSvc"
)
50
<<
"FullEventAssembler with key '"
<< name <<
"' exists, but of different type"
<<
endmsg
;
51
return
StatusCode::FAILURE;
52
}
53
return
StatusCode::SUCCESS;
54
}
55
else
{
// create new FEA
56
auto
ptr = std::make_unique<T>();
57
t = ptr.get();
58
return
storeFullEventAssembler
(std::move(ptr), name);
59
}
60
}
61
62
#endif
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:345
FullEventAssembler.h
RawEvent.h
FullEventAssemblerBase
base class for assembling a full atlas raw event from subfragments
Definition
FullEventAssembler.h:21
IByteStreamCnvSvc
interface for bytestream conversion services
Definition
IByteStreamCnvSvc.h:18
IByteStreamCnvSvc::DeclareInterfaceID
DeclareInterfaceID(IByteStreamCnvSvc, 1, 0)
Gaudi interface id.
IByteStreamCnvSvc::getFullEventAssembler
StatusCode getFullEventAssembler(T *&t, const std::string &name)
Access to FullEventAssembler.
Definition
IByteStreamCnvSvc.h:42
IByteStreamCnvSvc::findFullEventAssembler
virtual FullEventAssemblerBase * findFullEventAssembler(const std::string &name) const =0
Find FullEventAssembler with given name.
IByteStreamCnvSvc::storeFullEventAssembler
virtual StatusCode storeFullEventAssembler(std::unique_ptr< FullEventAssemblerBase > fea, const std::string &name)=0
Store FullEventAssembler under given name.
Generated on
for ATLAS Offline Software by
1.17.0