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