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