Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-05-14 07:56:58

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "ActsExamples/Io/Podio/CollectionBaseWriteHandle.hpp"
0010 
0011 #include "ActsExamples/Framework/WhiteBoard.hpp"
0012 
0013 #include <memory>
0014 
0015 #include <podio/CollectionBase.h>
0016 
0017 namespace ActsExamples {
0018 
0019 CollectionBaseWriteHandle::CollectionBaseWriteHandle(SequenceElement* parent,
0020                                                      const std::string& name)
0021     : WriteDataHandleBase{parent, name} {
0022   registerAsWriteHandle();
0023 }
0024 
0025 void CollectionBaseWriteHandle::store(
0026     WhiteBoard& wb, std::unique_ptr<podio::CollectionBase> collection) const {
0027   if (!isInitialized()) {
0028     throw std::runtime_error{"CollectionBaseHandle '" + fullName() +
0029                              "' not initialized"};
0030   }
0031 
0032   add(wb, std::move(collection));
0033 }
0034 
0035 const std::type_info& CollectionBaseWriteHandle::typeInfo() const {
0036   return typeid(std::unique_ptr<podio::CollectionBase>);
0037 }
0038 
0039 }  // namespace ActsExamples