2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
6 * @file StoreGate/UpdateHandleKey.icc
7 * @author scott snyder <snyder@bnl.gov>
9 * @brief Property holding a SG store/key/clid from which an UpdateHandle is made.
18 * @param key The StoreGate key for the object.
19 * @param storeName Name to use for the store, if it's not encoded in sgkey.
21 * The provided key may actually start with the name of the store,
22 * separated by a "+": "MyStore+Obj". If no "+" is present
23 * the store named by @c storeName is used.
26UpdateHandleKey<T>::UpdateHandleKey (const std::string& key /*= ""*/,
27 const std::string& storeName /*= "StoreGateSvc"*/)
28 : VarHandleKey (ClassID_traits<T>::ID(), key,
29 Gaudi::DataHandle::Reader,
35 * @brief auto-declaring Property Constructor.
36 * @param owner Owning component.
37 * @param name name of the Property
38 * @param key default StoreGate key for the object.
39 * @param doc Documentation string.
41 * will associate the named Property with this WHK via declareProperty
43 * The provided key may actually start with the name of the store,
44 * separated by a "+": "MyStore+Obj". If no "+" is present
45 * the store named by @c storeName is used.
48template <std::derived_from<IProperty> OWNER>
50UpdateHandleKey<T>::UpdateHandleKey( OWNER* owner,
52 const std::string& key /*= {}*/,
53 std::string doc /*= ""*/)
54 : UpdateHandleKey<T> (key)
56 auto p = owner->declareProperty(std::move(name), *this, std::move(doc));
57 p->template setOwnerType<OWNER>();
63 * @brief Change the key of the object to which we're referring.
64 * @param sgkey The StoreGate key for the object.
66 * The provided key may actually start with the name of the store,
67 * separated by a "+": "MyStore+Obj". If no "+" is present,
68 * the store is not changed.
71UpdateHandleKey<T>& UpdateHandleKey<T>::operator= (const std::string& sgkey)
73 VarHandleKey::operator= (sgkey);