ATLAS Offline Software
Loading...
Searching...
No Matches
ReadMetaHandleKey.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef STOREGATE_READMETAHANDLEKEY_H
6#define STOREGATE_READMETAHANDLEKEY_H
7
9#include <concepts>
10#include <string>
11
12namespace SG {
13
14 template <class T> class ReadMetaHandle;
15
16 template <class T> class ReadMetaHandleKey
17 : public MetaHandleKey<T>
18 {
19 public:
20 friend class ReadMetaHandle<T>;
21
22 explicit ReadMetaHandleKey (const std::string& key
23 , const std::string& dbKey="")
24 : MetaHandleKey<T>(key, dbKey, Gaudi::DataHandle::Reader)
25 {}
26
27 template <std::derived_from<IProperty> OWNER>
28 inline ReadMetaHandleKey( OWNER* owner
29 , std::string name
30 , const std::string& key={}
31 , std::string doc="")
32 : ReadMetaHandleKey<T>( key ) {
33 auto p = owner->declareProperty(std::move(name), *this, std::move(doc));
34 p->template setOwnerType<OWNER>();
35 }
36
37 inline ReadMetaHandleKey& operator= (const std::string& sgkey) {
39 return *this;
40 }
41
42 };
43
44} // namespace SG
45
46#endif // not STOREGATE_READMETAHANDLEKEY_H
an iterator over instances of a given type in StoreGateSvc.
Definition DataHandle.h:43
const MetaContBase::SourceID & dbKey() const
MetaHandleKey(const std::string &key, const std::string &dbKey, Gaudi::DataHandle::Mode a)
ReadMetaHandleKey(const std::string &key, const std::string &dbKey="")
ReadMetaHandleKey(OWNER *owner, std::string name, const std::string &key={}, std::string doc="")
ReadMetaHandleKey & operator=(const std::string &sgkey)
VarHandleKey & operator=(const std::string &sgkey)
Change the key of the object to which we're referring.
const std::string & key() const
Return the StoreGate ID for the referenced object.
=============================================================================
Forward declaration.