The Gaudi Framework  master (48d4dc99)
Loading...
Searching...
No Matches
deprecated.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
15#include <algorithm>
16#include <iterator>
17#include <sstream>
18#include <string>
19#include <vector>
20
22 template <typename Handles>
23 [[deprecated]] Handles make_vector_of_handles( IDataHandleHolder* owner, const std::vector<DataObjID>& init ) {
24 Handles handles;
25 handles.reserve( init.size() );
26 std::transform( init.begin(), init.end(), std::back_inserter( handles ),
27 [&]( const auto& loc ) -> typename Handles::value_type {
28 return { loc, owner };
29 } );
30 return handles;
31 }
32
33 template <typename OutputSpec, typename InputSpec, typename Traits_>
34 class DataHandleMixin;
35
36 template <typename Out, typename In, typename Tr>
37 [[deprecated]] void updateHandleLocation( DataHandleMixin<Out, In, Tr>& parent, const std::string& prop,
38 const std::string& newLoc ) {
39 parent.setProperty( prop, newLoc ).orThrow( "Could not set Property", prop + " -> " + newLoc );
40 }
41
42 template <typename Out, typename In, typename Tr>
43 [[deprecated]] void updateHandleLocations( DataHandleMixin<Out, In, Tr>& parent, const std::string& prop,
44 const std::vector<std::string>& newLocs ) {
45 std::ostringstream ss;
46 GaudiUtils::details::ostream_joiner( ss << '[', newLocs, ", ", []( std::ostream& os, const auto& i ) -> auto& {
47 return os << "'" << i << "'";
48 } ) << ']';
49 parent.setProperty( prop, ss.str() ).orThrow( "Could not set Property", prop + " -> " + ss.str() );
50 }
51} // namespace Gaudi::Functional::details
Provide serialization function (output only) for some common STL classes (vectors,...
Handles make_vector_of_handles(IDataHandleHolder *owner, const std::vector< DataObjID > &init)
Definition deprecated.h:23
void updateHandleLocation(DataHandleMixin< Out, In, Tr > &parent, const std::string &prop, const std::string &newLoc)
Definition deprecated.h:37
void updateHandleLocations(DataHandleMixin< Out, In, Tr > &parent, const std::string &prop, const std::vector< std::string > &newLocs)
Definition deprecated.h:43
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})