2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
11 * @brief forward the initialization to the member VarHandleKeys
12 * @param used If false, then this handle is not to be used.
13 * Instead of normal initialization, the key will be cleared.
17 StatusCode VarHandleKeyArrayCommon<Base>::initialize (bool used /*= true*/) {
18 StatusCode sc(StatusCode::SUCCESS);
20 // IDataHandleHolder* const owner = this->owner();
21 for (Base& b : *this) {
22 // if (owner != nullptr) {
25 if ( b.initialize().isFailure() ) {
26 sc = StatusCode::FAILURE;
37 // // Set the VarHandleKey from a string
39 // template <class Base>
41 // StatusCode VarHandleKeyArrayCommon<Base>::assign(const std::vector<std::string>& vs) {
42 // StatusCode sc(StatusCode::SUCCESS);
44 // for (auto & s : vs) {
46 // if (!b.assign(s)) {
47 // sc = StatusCode::FAILURE;
50 // if (b.key() != "") {
51 // this->push_back(b);
59 // string representation of VarHandleKeyArray
63 std::string VarHandleKeyArrayCommon<Base>::toString() const {
64 std::ostringstream ost;
65 typename std::vector<Base>::const_iterator itr;
67 size_t sz = this->size();
68 for ( size_t i=0; i < sz; ++i, ++itr) {
69 // ost << "'" << itr->objKey() << "'";
70 ost << "'" << itr->key() << "'";
79 // // create array of all base VarHandleKeys in the Array
81 // template <class Base>
83 // std::vector<SG::VarHandleKey*> VarHandleKeyArrayCommon<Base>::keys() const {
84 // std::vector<SG::VarHandleKey*> keys;
85 // for (const SG::VarHandleKey& k : *this) {
86 // // FIXME: This is a rule violation, but we can't really fix it without
87 // // changing the IDataHandleHolder base class from Gaudi.
88 // SG::VarHandleKey* k_nc ATLAS_THREAD_SAFE = const_cast<SG::VarHandleKey*>(&k);
89 // keys.push_back (k_nc);
94 // template <class Base>
96 // void VarHandleKeyArrayCommon<Base>::declare(IDataHandleHolder* owner) {
97 // if ( renounced() ) {
100 // for (auto k: keys() ) {
101 // owner->declare ( *k );
102 // k->setOwner( owner );