ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::io::writer_interface< detector_t > Class Template Referenceabstract

Abstract base class for detray detector component writers. More...

#include <detray/io/frontend/writer_interface.hpp>

Inheritance diagram for detray::io::writer_interface< detector_t >:
[legend]

Public Member Functions

 writer_interface ()=delete
 All writers must define a file extension.
 writer_interface (const std::string &ext)
 File gets created with a fixed ext.
virtual ~writer_interface ()=default
 Default destructor.
const std::string & file_extension () const
virtual std::string write (const detector_t &detector, const typename detector_t::name_map &names, const std::ios_base::openmode mode, const std::filesystem::path &path)=0
 Write detector components to a path using the supplied name map.

Detailed Description

template<class detector_t>
class detray::io::writer_interface< detector_t >

Abstract base class for detray detector component writers.

Constructor & Destructor Documentation

◆ writer_interface()

template<class detector_t>
detray::io::writer_interface< detector_t >::writer_interface ( const std::string & ext)
explicit

File gets created with a fixed ext.

Parameters
extfile extension handled by this writer

Member Function Documentation

◆ file_extension()

template<class detector_t>
const std::string & detray::io::writer_interface< detector_t >::file_extension ( ) const
Returns
the file extension

◆ write()

template<class detector_t>
virtual std::string detray::io::writer_interface< detector_t >::write ( const detector_t & detector,
const typename detector_t::name_map & names,
const std::ios_base::openmode mode,
const std::filesystem::path & path )
pure virtual

Write detector components to a path using the supplied name map.

Parameters
detectordetector components to serialize
namesmap used to name detector components
modestream open mode
pathoutput directory guaranteed to exist by the caller
Returns
path or filename written by the implementation

Implemented in detray::io::json_converter< detector_t, backend_t >.