The Gaudi Framework
master (ad37f17d)
Toggle main menu visibility
Loading...
Searching...
No Matches
DataHandle.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#include <
GaudiKernel/DataHandle.h
>
12
#include <
GaudiKernel/IDataHandleHolder.h
>
13
14
#include <sstream>
15
16
std::string
const
Gaudi::DataHandle::default_type
=
"unknown_t"
;
17
18
namespace
Gaudi
{
19
std::string
DataHandle::pythonRepr
()
const
{
20
std::ostringstream ost;
21
ost <<
"DataHandle("
<<
fullKey
() <<
", '"
;
22
switch
(
mode
() ) {
23
case
DataHandle::Mode::Reader
:
24
ost <<
"R"
;
25
break
;
26
case
DataHandle::Mode::Writer
:
27
ost <<
"W"
;
28
break
;
29
default
:
30
ost <<
"UNKNOWN"
;
31
break
;
32
}
33
ost <<
"', '"
+
default_type
+
"')"
;
34
return
ost.str();
35
}
36
37
std::string
DataHandleVectorBase::semantics
()
const
{
38
switch
(
mode
() ) {
39
case
DataHandle::Mode::Reader
:
40
return
"Gaudi::DataHandleVector<DataObjectReadHandle, "
+
type
() +
">"
;
41
case
DataHandle::Mode::Writer
:
42
return
"Gaudi::DataHandleVector<DataObjectWriteHandle, "
+
type
() +
">"
;
43
default
:
44
return
"Gaudi::DataHandleVector<DataHandle, "
+
type
() +
">"
;
45
}
46
}
47
48
std::string
DataHandleVectorBase::pythonRepr
()
const
{
49
std::ostringstream ost;
50
ost <<
pythonPropertyClassName
() <<
"(["
;
51
const
char
* sep =
""
;
52
for
(
const
auto
& key :
keys
() ) {
53
ost << sep <<
"'"
<< key.key() <<
"'"
;
54
sep =
","
;
55
}
56
ost <<
"], '"
;
57
switch
(
mode
() ) {
58
case
DataHandle::Mode::Reader
:
59
ost <<
"R"
;
60
break
;
61
case
DataHandle::Mode::Writer
:
62
ost <<
"W"
;
63
break
;
64
default
:
65
ost <<
"UNKNOWN"
;
66
break
;
67
}
68
ost <<
"', '"
<<
type
() <<
"')"
;
69
return
ost.str();
70
}
71
72
std::ostream&
operator<<
( std::ostream& str,
const
DataHandle
& d ) {
73
str << d.
fullKey
() <<
" m: "
<< d.
mode
();
74
if
( d.
owner
() ) str <<
" o: "
<< d.
owner
()->
name
();
75
return
str;
76
}
77
}
// namespace Gaudi
DataHandle.h
IDataHandleHolder.h
Gaudi::DataHandle::default_type
static const std::string default_type
Definition
DataHandle.h:88
Gaudi::DataHandle::pythonRepr
virtual std::string pythonRepr() const
Definition
DataHandle.cpp:19
Gaudi::DataHandle::owner
virtual IDataHandleHolder * owner() const
Definition
DataHandle.h:58
Gaudi::DataHandle::mode
virtual Mode mode() const
Definition
DataHandle.h:60
Gaudi::DataHandle::fullKey
virtual const DataObjID & fullKey() const
Definition
DataHandle.h:66
Gaudi::DataHandle::DataHandle
DataHandle(DataObjID k, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition
DataHandle.h:47
Gaudi::DataHandle::Reader
@ Reader
Definition
DataHandle.h:45
Gaudi::DataHandle::Writer
@ Writer
Definition
DataHandle.h:45
Gaudi::DataHandleVectorBase::type
virtual std::string type() const =0
Demangled C++ type of the data accessed by each handle.
Gaudi::DataHandleVectorBase::semantics
std::string semantics() const
GaudiConfig2 semantics name including handle mode and value type.
Definition
DataHandle.cpp:37
Gaudi::DataHandleVectorBase::keys
virtual const std::vector< DataObjID > & keys() const =0
Configured TES keys, in property order.
Gaudi::DataHandleVectorBase::mode
virtual DataHandle::Mode mode() const =0
Access mode shared by all handles in the vector.
Gaudi::DataHandleVectorBase::pythonPropertyClassName
std::string pythonPropertyClassName() const
Python class used to represent the property value.
Definition
DataHandle.h:116
Gaudi::DataHandleVectorBase::pythonRepr
std::string pythonRepr() const
Python expression reproducing the configured value.
Definition
DataHandle.cpp:48
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
Gaudi::operator<<
std::ostream & operator<<(std::ostream &o, const Gaudi::StringKey &key)
printout of the object reply on the native printout for the string
Definition
StringKey.h:182
GaudiKernel
src
Lib
DataHandle.cpp
Generated on
for The Gaudi Framework by
1.17.0