2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
7 * @file StoreGate/WriteHandleKey.icc
8 * @author scott snyder <snyder@bnl.gov>
10 * @brief Property holding a SG store/key/clid from which a WriteHandle is made.
19 * @param key The StoreGate key for the object.
20 * @param storeName Name to use for the store, if it's not encoded in sgkey.
22 * The provided key may actually start with the name of the store,
23 * separated by a "+": "MyStore+Obj". If no "+" is present
24 * the store named by @c storeName is used.
27 WriteHandleKey<T>::WriteHandleKey (const std::string& key /*= ""*/,
28 const std::string& storeName /*= "StoreGateSvc"*/)
29 : VarHandleKey (ClassID_traits<T>::ID(), key,
30 Gaudi::DataHandle::Writer,
37 * @brief auto-declaring Property Constructor.
38 * @param owner Owning component.
39 * @param name name of the Property
40 * @param key default StoreGate key for the object.
41 * @param doc Documentation string.
43 * will associate the named Property with this WHK via declareProperty
45 * The provided key may actually start with the name of the store,
46 * separated by a "+": "MyStore+Obj". If no "+" is present
47 * the store named by @c storeName is used.
50 template <class OWNER,
51 typename /*= typename std::enable_if<std::is_base_of<IProperty, OWNER>::value>::type*/>
53 WriteHandleKey<T>::WriteHandleKey( OWNER* owner,
55 const std::string& key /*= {}*/,
56 std::string doc /*= ""*/)
57 : WriteHandleKey<T> (key)
59 auto p = owner->declareProperty(std::move(name), *this, std::move(doc));
60 p->template setOwnerType<OWNER>();
65 * @brief Change the key of the object to which we're referring.
66 * @param sgkey The StoreGate key for the object.
68 * The provided key may actually start with the name of the store,
69 * separated by a "+": "MyStore+Obj". If no "+" is present,
70 * the store is not changed.
73 WriteHandleKey<T>& WriteHandleKey<T>::operator= (const std::string& sgkey)
75 VarHandleKey::operator= (sgkey);