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

Persistency writer for YODA flat text format. More...

#include <WriterYODA.h>

Inheritance diagram for YODA::WriterYODA:
YODA::Writer

Static Public Member Functions

static Writercreate ()
 Singleton creation function.
 

Protected Member Functions

void writeAO (std::ostream &stream, const AnalysisObject &c)
 
- 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 YODA flat text format.

Definition at line 15 of file WriterYODA.h.

Member Function Documentation

◆ create()

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

Singleton creation function.

Definition at line 21 of file WriterYODA.cc.

21 {
22 static WriterYODA _instance;
23 _instance.setPrecision(6);
24 return _instance;
25 }

References YODA::Writer::setPrecision().

Referenced by YODA::mkWriter().

◆ writeAO()

void YODA::WriterYODA::writeAO ( std::ostream &  stream,
const AnalysisObject c 
)
protectedvirtual

Implements YODA::Writer.

Definition at line 59 of file WriterYODA.cc.

59 {
60 ios_base::fmtflags oldflags = os.flags();
61 os << scientific << showpoint << setprecision(_aoprecision);
62 os << "BEGIN " << _iotypestr(ao.type()) << " " << ao.path() << "\n";
63 _writeAnnotations(os, ao);
64 ao._renderYODA(os, _aoprecision+7); // = "-1." + _aoprecision + "e+23"
65 os << "END " << _iotypestr(ao.type()) << "\n\n";
66 os << flush;
67 os.flags(oldflags);
68 }

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


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