The Gaudi Framework  v30r4 (9b837755)
DataHandleConfigurable.cpp
Go to the documentation of this file.
2 
4 #include "GaudiKernel/Parsers.h"
5 
7 
8 namespace Gaudi
9 {
10  namespace Parsers
11  {
13  {
14  DataObjID id;
15  StatusCode sc = parse( id, s );
16 
17  if ( sc.isSuccess() ) {
18  v.setTargetKey( std::move( id ) );
19  }
20  return sc;
21  }
22  }
23 
24  namespace Utils
25  {
27  {
28  o << "DataHandle(path=";
29  toStream( v.targetKey(), o );
30  o << ", whiteboard='" << v.metadata().whiteBoard() << '\'';
31  o << ", access=DataHandle.AccessMode.";
32  using AccessMode = Gaudi::v2::DataHandle::AccessMode;
33  switch ( v.metadata().access() ) {
34  case AccessMode::Read:
35  o << "Read";
36  break;
37  case AccessMode::Write:
38  o << "Write";
39  break;
40  default:
41  throw std::runtime_error( "Unsupported DataHandle access mode" );
42  }
43  o << ')';
44  return o;
45  }
46  }
47 } //> ns Gaudi
48 
50 {
51  return Gaudi::Utils::toStream( dhc, str );
52 }
std::ostream & operator<<(std::ostream &o, const Catalog &c)
printout operator
Definition: Catalog.h:61
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition: ToStream.h:303
IDataHandleMetadata::AccessMode AccessMode
Definition: DataHandle.h:115
bool isSuccess() const
Definition: StatusCode.h:287
Configurable entity associated with a DataHandle property.
const DataObjID & targetKey() const
Tell what the currently configured target is.
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
void setTargetKey(const DataObjID &key)
Change the target of the data handle.
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
T move(T...args)
virtual std::string whiteBoard() const =0
Identifier of the Whiteboard implementation used by the subclass.
string s
Definition: gaudirun.py:253
Gaudi::DataHandleConfigurable DataHandleConfigurable
virtual AccessMode access() const =0
const IDataHandleMetadata & metadata() const
Propagate metadata of the underlying DataHandle type.
STL class.
Helper functions to set/get the application return code.
Definition: __init__.py:1