ATLAS Offline Software
Loading...
Searching...
No Matches
AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandleKey.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5/**
6 * @file AsgDataHandles/WriteHandleKey.icc
7 * @author Nils Krumnack <Nils.Erik.Krumnack@cern.h>
8 * @author scott snyder <snyder@bnl.gov> (for original version)
9 * @brief Property holding a SG store/key/clid from which a WriteHandle is made.
10 */
11
12
13namespace SG {
14
15
16/**
17 * @brief Constructor.
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.
20 *
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.
24 */
25template <class T>
26WriteHandleKey<T>::WriteHandleKey (const std::string& key /*= ""*/)
27 // const std::string& storeName /*= "StoreGateSvc"*/)
28 : VarHandleKey (key)
29 // : VarHandleKey (ClassID_traits<T>::ID(), key,
30 // Gaudi::DataHandle::Writer,
31 // storeName)
32{
33}
34
35
36/**
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.
42 *
43 * will associate the named Property with this WHK via declareProperty
44 *
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.
48 */
49template <class T>
50template <class OWNER, class K>
51inline
52WriteHandleKey<T>::WriteHandleKey( OWNER* owner,
53 std::string name,
54 const K& key /*= {}*/,
55 std::string doc /*= ""*/)
56 : WriteHandleKey<T> (key)
57{
58 owner->declareProperty(std::move(name), *this, std::move(doc));
59}
60
61
62/**
63 * @brief Change the key of the object to which we're referring.
64 * @param sgkey The StoreGate key for the object.
65 *
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.
69 */
70template <class T>
71WriteHandleKey<T>& WriteHandleKey<T>::operator= (const std::string& sgkey)
72{
73 VarHandleKey::operator= (sgkey);
74 return *this;
75}
76
77
78} // namespace SG