2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 #ifndef ASGTOOLS_TOOLHANDLEARRAY_ICC
6 #define ASGTOOLS_TOOLHANDLEARRAY_ICC
9 ToolHandleArray< T >::ToolHandleArray()
10 : std::vector< ToolHandle< T > >() {
15 ToolHandleArray< T >::
16 ToolHandleArray( const std::initializer_list< ToolHandle< T > >& l )
17 : std::vector< ToolHandle< T > >( l ) {
22 ToolHandleArray< T >::
23 ToolHandleArray( const std::initializer_list< std::string >& l )
24 : std::vector< ToolHandle< T > >() {
26 // Create ToolHandle objects from all the names:
27 for( auto name : l ) {
28 this->push_back( ToolHandle< T >( name ) );
32 template< class T > template< typename Parent >
33 ToolHandleArray< T >::
34 ToolHandleArray( Parent *parent, const std::string& name, const std::initializer_list< std::string >& l, const std::string& description )
35 : ToolHandleArray (l) {
37 parent->declareProperty (name, *this, description);
41 StatusCode ToolHandleArray< T >::retrieve() const {
43 // Loop over all the elements:
44 typename ToolHandleArray< T >::const_iterator itr = this->begin();
45 typename ToolHandleArray< T >::const_iterator end = this->end();
46 for( ; itr != end; ++itr ) {
47 if( itr->retrieve().isFailure() ) {
48 return StatusCode::FAILURE;
53 return StatusCode::SUCCESS;
60 template<typename T> struct GetStringHelper;
62 template<typename T> struct GetStringHelper<ToolHandleArray<T> >
63 : public GetStringHelper<std::vector<ToolHandle<T> > >
67 template<typename T> struct SetStringHelper;
69 template<typename T> struct SetStringHelper<ToolHandleArray<T> >
70 : public SetStringHelper<std::vector<ToolHandle<T> > >
76 #endif // ASGTOOLS_TOOLHANDLEARRAY_ICC