yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.2

Persistency writer for flat text format. More...

#include <WriterFLAT.h>

Inheritance diagram for YODA::WriterFLAT:
YODA::Writer

Static Public Member Functions

static Writercreate ()
 Singleton creation function.
 

Protected Member Functions

void writeAO (std::ostream &stream, const AnalysisObject &ao)
 
- Protected Member Functions inherited from YODA::Writer
virtual void writeHead (std::ostream &)
 Write any opening boilerplate required by the format to stream.
 
virtual void writeBody (std::ostream &stream, const AnalysisObject *ao)
 Write the body elements corresponding to AnalysisObject ao to stream.
 
virtual void writeBody (std::ostream &stream, const AnalysisObject &ao)
 Write the body elements corresponding to AnalysisObject pointer ao to stream.
 
template<typename T >
std::enable_if_t< DerefableToAO< T >::value > writeBody (std::ostream &stream, const T &ao)
 Write the body elements corresponding to AnalysisObject ao to stream.
 
virtual void writeFoot (std::ostream &stream)
 Write any closing boilerplate required by the format to stream.
 

Additional Inherited Members

- Public Member Functions inherited from YODA::Writer
virtual ~Writer ()
 Virtual destructor.
 
void setPrecision (int precision)
 Set precision of numerical quantities in this writer's output.
 
void setAOPrecision (const bool needsDP=false)
 Set precision of numerical quantities for current AO in this writer's output.
 
void useCompression (const bool compress=true)
 Use libz compression?
 
void write (const std::string &filename, const AnalysisObject &ao)
 Write out object ao to file filename.
 
void write (std::ostream &stream, const AnalysisObject &ao)
 Write out object ao to output stream stream.
 
template<typename T >
std::enable_if_t< DerefableToAO< T >::value > write (std::ostream &stream, const T &ao)
 Write out pointer-like object ao to output stream stream.
 
template<typename T >
std::enable_if_t< DerefableToAO< T >::value > write (const std::string &filename, const T &ao)
 Write out pointer-like object ao to file filename.
 
void write (std::ostream &stream, const std::vector< const AnalysisObject * > &aos)
 
template<typename RANGE >
std::enable_if_t< CIterable< RANGE >::value > write (std::ostream &stream, const RANGE &aos)
 
template<typename RANGE >
std::enable_if_t< CIterable< RANGE >::value > write (const std::string &filename, const RANGE &aos)
 Write out a collection of objects objs to file filename.
 
template<typename AOITER >
void write (std::ostream &stream, const AOITER &begin, const AOITER &end)
 
template<typename AOITER >
void write (const std::string &filename, const AOITER &begin, const AOITER &end)
 

Detailed Description

Persistency writer for flat text format.

Definition at line 15 of file WriterFLAT.h.

Member Function Documentation

◆ create()

Writer & YODA::WriterFLAT::create ( )
static

Singleton creation function.

Definition at line 17 of file WriterFLAT.cc.

17 {
18 static WriterFLAT _instance;
19 _instance.setPrecision(6);
20 return _instance;
21 }

References YODA::Writer::setPrecision().

Referenced by YODA::mkWriter().

◆ writeAO()

void YODA::WriterFLAT::writeAO ( std::ostream &  stream,
const AnalysisObject ao 
)
protectedvirtual

Implements YODA::Writer.

Definition at line 35 of file WriterFLAT.cc.

35 {
36 ios_base::fmtflags oldflags = os.flags();
37 os << scientific << showpoint << setprecision(_aoprecision);
38 os << "BEGIN SCATTER" << std::to_string(ao.dim()) << "D " << ao.path() << "\n";
39 _writeAnnotations(os, ao);
40 ao._renderFLAT(os, _aoprecision+7); // = "-1." + _aoprecision + "e+23"
41 os << "END SCATTER" << std::to_string(ao.dim()) << "D" << "\n\n";
42
43 os << flush;
44 os.flags(oldflags);
45 }

References YODA::AnalysisObject::dim(), and YODA::AnalysisObject::path().


The documentation for this class was generated from the following files: