forked from sPHENIX-Collaboration/acts
/
IWriter.hpp
41 lines (31 loc) · 1.1 KB
/
IWriter.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// This file is part of the Acts project.
//
// Copyright (C) 2017 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
/// @file
/// @date 2017-07-25
/// @author Moritz Kiehnn <msmk@cern.ch>
#pragma once
#include "ActsExamples/Framework/AlgorithmContext.hpp"
#include "ActsExamples/Framework/ProcessCode.hpp"
#include <string>
namespace ActsExamples {
/// Event data writer interface.
///
/// Get data from the event store and write it to disk. The writer can have
/// internal state and implementations are responsible to handle concurrent
/// calls.
class IWriter {
public:
virtual ~IWriter() = default;
/// The writer name.
virtual std::string name() const = 0;
/// Write data from one event.
virtual ProcessCode write(const AlgorithmContext& context) = 0;
/// End the run (e.g. aggregate statistics, write down output, close files).
virtual ProcessCode endRun() = 0;
};
} // namespace ActsExamples