6#ifndef HEPMC3_WRITERASCII_H
7#define HEPMC3_WRITERASCII_H
31 std::shared_ptr<GenRunInfo> run = std::shared_ptr<GenRunInfo>());
35 std::shared_ptr<GenRunInfo> run = std::shared_ptr<GenRunInfo>());
38 std::shared_ptr<GenRunInfo> run = std::shared_ptr<GenRunInfo>());
55 void close()
override;
84 std::string
escape(
const std::string& s)
const;
Definition of class GenEvent.
Definition of class GenRunInfo.
Definition of interface Writer.
Stores event-related information.
GenEvent I/O serialization for structured text files.
void set_buffer_size(const size_t &size)
Set buffer size (in bytes)
void set_precision(const int &prec)
Set output precision.
std::string escape(const std::string &s) const
Escape '\' and ' ' characters in string.
void allocate_buffer()
Attempts to allocate buffer of the chosen size.
char * m_cursor
Cursor inside stream buffer.
bool failed() override
Return status of the stream.
char * m_buffer
Stream buffer.
std::string m_float_printf_specifier
the specifier of printf used for floats
~WriterAscii()
Destructor.
void close() override
Close file stream.
int precision() const
Return output precision.
void write_particle(ConstGenParticlePtr p, int second_field)
Write particle.
int m_precision
Output precision.
std::string m_vertex_short_printf_specifier
the specifier of printf used for zero vertices
std::shared_ptr< std::ostream > m_shared_stream
Output temp. stream.
std::ofstream m_file
Output file.
void write_string(const std::string &str)
Inline function for writing strings.
unsigned long m_buffer_size
Buffer size.
std::string m_particle_printf_specifier
the specifier of printf used for floats
void write_event(const GenEvent &evt) override
Write event to file.
void write_vertex(ConstGenVertexPtr v)
Write vertex.
std::string m_vertex_long_printf_specifier
the specifier of printf used for vertices
void flush()
Inline function flushing buffer to output stream when close to buffer capacity.
void write_run_info()
Write the GenRunInfo object to file.
void forced_flush()
Inline function forcing flush to the output stream.
std::ostream * m_stream
Output stream.
Base class for all I/O writers.