The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
DataHandle.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 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\***********************************************************************************/
13
14#include <sstream>
15
16std::string const Gaudi::DataHandle::default_type = "unknown_t";
17
18namespace Gaudi {
19 std::string DataHandle::pythonRepr() const {
20 std::ostringstream ost;
21 ost << "DataHandle(" << fullKey() << ", '";
22 switch ( mode() ) {
24 ost << "R";
25 break;
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::ostream& operator<<( std::ostream& str, const DataHandle& d ) {
38 str << d.fullKey() << " m: " << d.mode();
39 if ( d.owner() ) str << " o: " << d.owner()->name();
40 return str;
41 }
42} // namespace Gaudi
static const std::string default_type
Definition DataHandle.h:82
virtual std::string pythonRepr() const
virtual IDataHandleHolder * owner() const
Definition DataHandle.h:52
virtual Mode mode() const
Definition DataHandle.h:54
virtual const DataObjID & fullKey() const
Definition DataHandle.h:60
DataHandle(DataObjID k, Mode a=Reader, IDataHandleHolder *owner=nullptr)
Definition DataHandle.h:41
virtual const std::string & name() const =0
Retrieve the name of the instance.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
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:176