ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
reader_interface.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s)
12#include "detray/builders/detector_builder.hpp"
13
14// System include(s)
15#include <filesystem>
16#include <ios>
17#include <string>
18#include <string_view>
19
20namespace detray::io {
21
23template <class detector_t>
25 public:
27 reader_interface() = delete;
28
31 explicit reader_interface(const std::string& ext) : m_file_extension{ext} {}
32
34 virtual ~reader_interface() = default;
35
37 const std::string& file_extension() const { return m_file_extension; }
38
42 virtual void read(
44 const std::string&) = 0;
45
46 private:
48 std::string m_file_extension;
49};
50
51} // namespace detray::io
Provides functionality to build a detray detector volume by volume.
Definition detector_builder.hpp:40
const std::string & file_extension() const
Definition reader_interface.hpp:37
reader_interface(const std::string &ext)
Only accept files with a fixed ext.
Definition reader_interface.hpp:31
reader_interface()=delete
All readers must define a file extension.
virtual ~reader_interface()=default
Default destructor.
virtual void read(detector_builder< typename detector_t::metadata, volume_builder > &, const std::string &)=0
Reads the respective detector component from file.
The following enums are global for all detectors.
Definition concepts.hpp:18