ATLAS Offline Software
Loading...
Searching...
No Matches
AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7// VarHandleBase.cxx
8// Implementation file for class VarHandleBase
9// Author: Nils Krumnack <Nils.Erik.Krumnack@cern.ch>
10// Author: Paolo Calafiura (for original)
11// Author: S.Binet<binet@cern.ch> (for original)
13
16
17// #include "AsgDataHandles/exceptions.h"
18
19// #include <algorithm>
20#include <sstream>
21
22
23namespace SG {
24
25
30 VarHandleBase::VarHandleBase(const std::string& sgkey) :
31 m_ownedKey (std::make_unique<VarHandleKey> (sgkey)),
32 m_key (m_ownedKey.get())
33 {
34 }
35
36
46 const EventContext* /*ctx*/)
47 : m_key (&key)
48 {
49 }
50
51
52
53 //*************************************************************************
54 // Accessors
55 //
56
57
64 const std::string& VarHandleBase::key() const
65 {
66 return m_key->key();
67 }
68
69
75 const std::string& VarHandleBase::name() const
76 {
77 return this->key();
78 }
79
80
81// /**
82// * @brief Return the name of the store holding the object we are proxying.
83// */
84// std::string VarHandleBase::store() const
85// {
86// if (m_store)
87// return m_store->name();
88// return this->storeHandle().name();
89// }
90
91
92 //*************************************************************************
93 // Protected methods.
94 //
95
96
97//*************************************************************************
98 // Free functions.
99 //
100
101
107 std::ostream& operator<<( std::ostream& out, const VarHandleBase& o )
108 {
109 out << "VarHandleBase @" << &o
110 // << " store=" <<o.store()
111 << ", key=" <<o.key();
112 return out;
113 }
114
115
120 {
121 return (l.name() == r.name());// &&
122 // l.store() == r.store());
123 }
124
125
130 {
131 return !(l==r);
132 }
133
134
135} /* namespace SG */
Base class for VarHandle classes.
A property holding a SG store/key/clid from which a VarHandle is made.
Base class for VarHandle types.
VarHandleBase(CLID clid, Gaudi::DataHandle::Mode mode)
Constructor with default key.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
const VarHandleKey * m_key
The associated key object.
const std::string & name() const
Return the StoreGate ID for the referenced object.
A property holding a SG store/key/clid from which a VarHandle is made.
int r
Definition globals.cxx:22
Forward declaration.
bool operator==(const VarHandleBase &l, const VarHandleBase &r)
Equality comparison.
bool operator!=(const VarHandleBase &l, const VarHandleBase &r)
Inequality comparison.
std::ostream & operator<<(std::ostream &os, const ArenaAllocatorBase::Stats::Stat &stat)
Format a statistic structure.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
sgkey(tool)
Definition common.py:1027