Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:41:48

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 #pragma once
0010 
0011 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0012 #include "ActsExamples/Framework/ProcessCode.hpp"
0013 #include "ActsExamples/Framework/SequenceElement.hpp"
0014 
0015 namespace ActsExamples {
0016 
0017 /// Event data writer interface.
0018 ///
0019 /// Get data from the event store and write it to disk. The writer can have
0020 /// internal state and implementations are responsible to handle concurrent
0021 /// calls.
0022 class IWriter : public SequenceElement {
0023  public:
0024   /// Write data from one event.
0025   virtual ProcessCode write(const AlgorithmContext& context) = 0;
0026 
0027   /// Internal execute method forwards to the write method as mutable
0028   /// @param context The algorithm context
0029   ProcessCode internalExecute(const AlgorithmContext& context) final {
0030     return write(context);
0031   }
0032 
0033   /// Informs the writer that the sequencer will start processing the next
0034   /// event.
0035   /// @param threadId The thread ID
0036   virtual ProcessCode beginEvent(std::size_t threadId) {
0037     static_cast<void>(threadId);
0038     return ProcessCode::SUCCESS;
0039   }
0040 
0041   /// Fulfill the algorithm interface
0042   ProcessCode initialize() override { return ProcessCode::SUCCESS; }
0043 
0044   /// Return the type for debug output
0045   std::string_view typeName() const override { return "Writer"; }
0046 };
0047 
0048 }  // namespace ActsExamples