The Gaudi Framework  master (cc9a61f4)
Loading...
Searching...
No Matches
Gaudi::DataHandle Class Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/DataHandle.h>

Inheritance diagram for Gaudi::DataHandle:
Collaboration diagram for Gaudi::DataHandle:

Public Types

enum  Mode { Reader = 1 << 2 , Writer = 1 << 4 }
using PropertyType = DataHandleProperty

Public Member Functions

 DataHandle (DataObjID k, Mode a=Reader, IDataHandleHolder *owner=nullptr)
 DataHandle (DataObjID k, bool isCond, Mode a=Reader, IDataHandleHolder *owner=nullptr)
virtual ~DataHandle ()=default
virtual void setOwner (IDataHandleHolder *o)
virtual IDataHandleHolderowner () const
virtual Mode mode () const
virtual void setKey (DataObjID key)
virtual void updateKey (std::string key)
virtual const std::string & objKey () const
virtual const DataObjIDfullKey () const
virtual void reset (bool)
virtual std::string pythonRepr () const
virtual bool init ()
virtual bool isCondition () const

Protected Attributes

DataObjID m_key = { "NONE" }
 The key of the object behind this DataHandle Although it may look strange to have it mutable, this can actually change in case the object had alternative names, and it should not be visible to the end user, for which the Handle is still the same.
IDataHandleHolderm_owner = nullptr

Static Protected Attributes

static const std::string default_type = "unknown_t"

Private Attributes

Mode m_mode = Reader
bool m_isCond = false

Friends

std::ostream & operator<< (std::ostream &str, const DataHandle &d)

Detailed Description

Definition at line 37 of file DataHandle.h.

Member Typedef Documentation

◆ PropertyType

Member Enumeration Documentation

◆ Mode

Enumerator
Reader 
Writer 

Definition at line 39 of file DataHandle.h.

39{ Reader = 1 << 2, Writer = 1 << 4 };

Constructor & Destructor Documentation

◆ DataHandle() [1/2]

Gaudi::DataHandle::DataHandle ( DataObjID k,
Mode a = Reader,
IDataHandleHolder * owner = nullptr )
inline

Definition at line 41 of file DataHandle.h.

42 : m_key( std::move( k ) ), m_owner( owner ), m_mode( a ) {}
DataObjID m_key
The key of the object behind this DataHandle Although it may look strange to have it mutable,...
Definition DataHandle.h:79
IDataHandleHolder * m_owner
Definition DataHandle.h:80
virtual IDataHandleHolder * owner() const
Definition DataHandle.h:52

◆ DataHandle() [2/2]

Gaudi::DataHandle::DataHandle ( DataObjID k,
bool isCond,
Mode a = Reader,
IDataHandleHolder * owner = nullptr )
inline

Definition at line 44 of file DataHandle.h.

45 : m_key( std::move( k ) ), m_owner( owner ), m_mode( a ), m_isCond( isCond ) {}

◆ ~DataHandle()

virtual Gaudi::DataHandle::~DataHandle ( )
virtualdefault

Member Function Documentation

◆ fullKey()

virtual const DataObjID & Gaudi::DataHandle::fullKey ( ) const
inlinevirtual

Definition at line 60 of file DataHandle.h.

60{ return m_key; }

◆ init()

virtual bool Gaudi::DataHandle::init ( )
inlinevirtual

Reimplemented in DataObjectHandleBase.

Definition at line 65 of file DataHandle.h.

65{ return true; }

◆ isCondition()

virtual bool Gaudi::DataHandle::isCondition ( ) const
inlinevirtual

Definition at line 68 of file DataHandle.h.

68{ return m_isCond; }

◆ mode()

virtual Mode Gaudi::DataHandle::mode ( ) const
inlinevirtual

Definition at line 54 of file DataHandle.h.

54{ return m_mode; }

◆ objKey()

virtual const std::string & Gaudi::DataHandle::objKey ( ) const
inlinevirtual

Definition at line 59 of file DataHandle.h.

59{ return m_key.key(); }

◆ owner()

virtual IDataHandleHolder * Gaudi::DataHandle::owner ( ) const
inlinevirtual

Definition at line 52 of file DataHandle.h.

52{ return m_owner; }

◆ pythonRepr()

std::string Gaudi::DataHandle::pythonRepr ( ) const
virtual

Reimplemented in DataObjectHandle< T >, DataObjectHandle< AnyDataWithViewWrapper< View, Owned > >, DataObjectHandle< AnyDataWrapper< T > >, DataObjectHandle< DataObject >, DataObjectHandle< Gaudi::NamedRange_< T > >, DataObjectHandle< Gaudi::Range_< T > >, DataObjectHandle< Payload_t< Gaudi::DataHandle::Reader, T, U > >, DataObjectHandle< Payload_t< Gaudi::DataHandle::Writer, T, U > >, and DataObjectHandle< std::optional< Gaudi::NamedRange_< T > > >.

Definition at line 19 of file DataHandle.cpp.

19 {
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 }
static const std::string default_type
Definition DataHandle.h:82
virtual Mode mode() const
Definition DataHandle.h:54
virtual const DataObjID & fullKey() const
Definition DataHandle.h:60

◆ reset()

virtual void Gaudi::DataHandle::reset ( bool )
inlinevirtual

Definition at line 62 of file DataHandle.h.

62{}

◆ setKey()

virtual void Gaudi::DataHandle::setKey ( DataObjID key)
inlinevirtual

Definition at line 56 of file DataHandle.h.

56{ m_key = std::move( key ); }

◆ setOwner()

virtual void Gaudi::DataHandle::setOwner ( IDataHandleHolder * o)
inlinevirtual

Definition at line 51 of file DataHandle.h.

51{ m_owner = o; }

◆ updateKey()

virtual void Gaudi::DataHandle::updateKey ( std::string key)
inlinevirtual

Definition at line 57 of file DataHandle.h.

57{ m_key.updateKey( std::move( key ) ); }

◆ operator<<

std::ostream & operator<< ( std::ostream & str,
const DataHandle & d )
friend

Definition at line 37 of file DataHandle.cpp.

37 {
38 str << d.fullKey() << " m: " << d.mode();
39 if ( d.owner() ) str << " o: " << d.owner()->name();
40 return str;
41 }

Member Data Documentation

◆ default_type

std::string const Gaudi::DataHandle::default_type = "unknown_t"
staticprotected

Definition at line 82 of file DataHandle.h.

◆ m_isCond

bool Gaudi::DataHandle::m_isCond = false
private

Definition at line 86 of file DataHandle.h.

◆ m_key

DataObjID Gaudi::DataHandle::m_key = { "NONE" }
protected

The key of the object behind this DataHandle Although it may look strange to have it mutable, this can actually change in case the object had alternative names, and it should not be visible to the end user, for which the Handle is still the same.

Definition at line 79 of file DataHandle.h.

79{ "NONE" };

◆ m_mode

Mode Gaudi::DataHandle::m_mode = Reader
private

Definition at line 85 of file DataHandle.h.

◆ m_owner

IDataHandleHolder* Gaudi::DataHandle::m_owner = nullptr
protected

Definition at line 80 of file DataHandle.h.


The documentation for this class was generated from the following files: