The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::TestSuite::PIntVectorsToIntVector Struct Referencefinal
Inheritance diagram for Gaudi::TestSuite::PIntVectorsToIntVector:
Collaboration diagram for Gaudi::TestSuite::PIntVectorsToIntVector:

Public Member Functions

 PIntVectorsToIntVector (const std::string &name, ISvcLocator *svcLoc)
std::vector< int > operator() (const Gaudi::Functional::vector_of_const_< std::vector< int > * > &intVectors) const override

Detailed Description

Definition at line 262 of file MakeAndConsume.cpp.

Constructor & Destructor Documentation

◆ PIntVectorsToIntVector()

Gaudi::TestSuite::PIntVectorsToIntVector::PIntVectorsToIntVector ( const std::string & name,
ISvcLocator * svcLoc )
inline

Definition at line 266 of file MakeAndConsume.cpp.

267 : MergingTransformer( name, svcLoc, { "InputLocations", {} },
268 { "OutputLocation", "/Event/MyConcatenatedIntVector" } ) {}
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingTransformer

Member Function Documentation

◆ operator()()

std::vector< int > Gaudi::TestSuite::PIntVectorsToIntVector::operator() ( const Gaudi::Functional::vector_of_const_< std::vector< int > * > & intVectors) const
inlineoverride

Definition at line 271 of file MakeAndConsume.cpp.

271 {
272 // Create a vector and pre-allocate enough space for the number of integers we have
273 auto nelements = std::accumulate( intVectors.begin(), intVectors.end(), 0,
274 []( const auto a, const auto b ) { return a + ( b ? b->size() : 0 ); } );
275 std::vector<int> out;
276 out.reserve( nelements );
277 // Concatenate the input vectors to form the output
278 for ( auto& intVector : intVectors ) {
279 info() << "Concatening vector " << intVector << endmsg;
280 if ( intVector ) {
281 out.insert( out.end(), intVector->begin(), intVector->end() );
282 // intVector->clear(); // should not be possible!!! and does indeed not compile ;-)
283 }
284 }
285 info() << "Storing output vector " << out << " to " << outputLocation() << endmsg;
286 return out;
287 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198

The documentation for this struct was generated from the following file: