176 {
177
178 if ( !outputData.getStore() )
179 {
180 m_msg << MSG::ERROR <<
"output data does not have the store" <<
endmsg;
181 return StatusCode::FAILURE;
182 }
183
184
185 SG::ReadHandle< DataVector< T > > queryHandle( queryKey, sourceContext );
186
187
189
190
192 for ( const SG::View* inputView : viewVector )
193 {
194
196
197 StatusCode sc = queryHandle.setProxyDict( nc_inputView );
198 if ( !
sc.isSuccess() )
199 {
200 m_msg << MSG::ERROR <<
"Failed to use view " << inputView->name() <<
" to read " << queryHandle.key() <<
endmsg;
202 }
203
204
205 if ( queryHandle->empty() )
206 {
207 if (
m_msg.level() <= MSG::DEBUG) {
208 m_msg << MSG::DEBUG <<
"Empty collection " << queryHandle.key() <<
" in a view " << inputView->name() <<
endmsg;
209 continue;
210 }
211 }
212
213
214 for (
SG::auxid_t decor : queryHandle->getDecorIDs() ) {
216 m_msg << MSG::WARNING <<
"mergeViewCollection: skipped unlocked decoration " << queryHandle.key() <<
"." <<
r.getName( decor ) <<
endmsg;
217 }
218
219
220 for ( const auto inputObject : *queryHandle.cptr() )
221 {
222
223 T * outputObject =
new T();
225 *outputObject = *inputObject;
226
227
228 viewBookkeeper( *outputObject ) = inputView->getROI();
229 }
230
231 if (
m_msg.level() <= MSG::DEBUG) {
232 m_msg << MSG::DEBUG <<
"Copied " << queryHandle->size() <<
" objects from collection in view " << inputView->name() <<
endmsg;
233 }
234
235
236 auto proxy = inputView->proxy( queryHandle.clid(), queryHandle.key() );
237 m_sg->remap( ClassID_traits< DataVector< T > >
::ID(),
239 queryHandle.name(),
240 offset );
241 offset += queryHandle->size();
242 }
243
244 return StatusCode::SUCCESS;
245 }
std::vector< Identifier > ID
#define ATLAS_THREAD_SAFE
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
SG::Accessor< T, ALLOC > Accessor
static AuxTypeRegistry & instance()
Return the singleton registry instance.
::StatusCode StatusCode
StatusCode definition for legacy code.
size_t auxid_t
Identifier for a particular aux data item.